Skip to content

Commit 3e38536

Browse files
committed
fix: merge conflict
1 parent 0346e90 commit 3e38536

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

xds/src/main/java/io/grpc/xds/GrpcXdsTransportFactory.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@
5454
final class GrpcXdsTransportFactory implements XdsTransportFactory {
5555

5656
private final CallCredentials callCredentials;
57-
<<<<<<< child-channel-plugin
5857
private final ChannelConfigurer channelConfigurer;
59-
=======
58+
6059
// The map of xDS server info to its corresponding gRPC xDS transport.
6160
// This enables reusing and sharing the same underlying gRPC channel.
6261
//
@@ -65,8 +64,6 @@ final class GrpcXdsTransportFactory implements XdsTransportFactory {
6564
// for reference counting of each GrpcXdsTransport instance.
6665
private static final Map<Bootstrapper.ServerInfo, GrpcXdsTransport> xdsServerInfoToTransportMap =
6766
new ConcurrentHashMap<>();
68-
>>>>>>> master
69-
7067

7168
GrpcXdsTransportFactory(CallCredentials callCredentials,
7269
ChannelConfigurer channelConfigurer) {
@@ -76,19 +73,15 @@ final class GrpcXdsTransportFactory implements XdsTransportFactory {
7673

7774
@Override
7875
public XdsTransport create(Bootstrapper.ServerInfo serverInfo) {
79-
<<<<<<< child-channel-plugin
80-
return new GrpcXdsTransport(serverInfo, callCredentials, channelConfigurer);
81-
=======
8276
return xdsServerInfoToTransportMap.compute(
8377
serverInfo,
8478
(info, transport) -> {
8579
if (transport == null) {
86-
transport = new GrpcXdsTransport(serverInfo, callCredentials);
80+
transport = new GrpcXdsTransport(serverInfo, callCredentials, channelConfigurer);
8781
}
8882
++transport.refCount;
8983
return transport;
9084
});
91-
>>>>>>> master
9285
}
9386

9487
@VisibleForTesting
@@ -136,6 +129,7 @@ public GrpcXdsTransport(Bootstrapper.ServerInfo serverInfo,
136129
}
137130
this.channel = channelBuilder.build();
138131
this.callCredentials = callCredentials;
132+
this.serverInfo = serverInfo;
139133
}
140134

141135
@VisibleForTesting

xds/src/test/java/io/grpc/xds/GrpcXdsTransportFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void refCountedXdsTransport_sameXdsServerAddress_returnsExistingTransport
136136
Bootstrapper.ServerInfo xdsServerInfo =
137137
Bootstrapper.ServerInfo.create(
138138
"localhost:" + server.getPort(), InsecureChannelCredentials.create());
139-
GrpcXdsTransportFactory xdsTransportFactory = new GrpcXdsTransportFactory(null);
139+
GrpcXdsTransportFactory xdsTransportFactory = new GrpcXdsTransportFactory(null, null);
140140
// Calling create() for the first time creates a new GrpcXdsTransport instance.
141141
// The ref count was previously 0 and now is 1.
142142
XdsTransportFactory.XdsTransport transport1 = xdsTransportFactory.create(xdsServerInfo);
@@ -168,7 +168,7 @@ public void refCountedXdsTransport_differentXdsServerAddress_returnsDifferentTra
168168
Bootstrapper.ServerInfo xdsServerInfo2 =
169169
Bootstrapper.ServerInfo.create(
170170
"localhost:" + server2.getPort(), InsecureChannelCredentials.create());
171-
GrpcXdsTransportFactory xdsTransportFactory = new GrpcXdsTransportFactory(null);
171+
GrpcXdsTransportFactory xdsTransportFactory = new GrpcXdsTransportFactory(null, null);
172172
// Calling create() to the first xDS server creates a new GrpcXdsTransport instance.
173173
// The ref count was previously 0 and now is 1.
174174
XdsTransportFactory.XdsTransport transport1 = xdsTransportFactory.create(xdsServerInfo1);

xds/src/test/java/io/grpc/xds/XdsNameResolverTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,10 +2946,10 @@ void deliverErrorStatus() {
29462946
}
29472947

29482948
@Test
2949-
public void start_passesParentChannelToClientPoolFactory() {
2949+
public void start_passesChannelConfigurerToClientPoolFactory() {
29502950
ChannelConfigurer mockChannelConfigurer = mock(ChannelConfigurer.class);
29512951

2952-
// Build NameResolver.Args containing the child channel configurer
2952+
// Build NameResolver.Args containing the channel configurer
29532953
NameResolver.Args args = NameResolver.Args.newBuilder()
29542954
.setDefaultPort(8080)
29552955
.setProxyDetector(mock(ProxyDetector.class))
@@ -2975,7 +2975,7 @@ public void start_passesParentChannelToClientPoolFactory() {
29752975
.thenReturn(mockObjectPool);
29762976

29772977
XdsNameResolver resolver = new XdsNameResolver(
2978-
URI.create(AUTHORITY),
2978+
targetUri,
29792979
null, // targetAuthority (nullable)
29802980
AUTHORITY, // name
29812981
null, // overrideAuthority (nullable)

xds/src/test/java/io/grpc/xds/XdsServerBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public void testOverrideBootstrap() throws Exception {
330330
}
331331

332332
@Test
333-
public void start_passesParentServerToClientPoolFactory() throws Exception {
333+
public void start_passesChannelConfigurerToClientPoolFactory() throws Exception {
334334
ChannelConfigurer mockConfigurer = mock(ChannelConfigurer.class);
335335
XdsClientPoolFactory mockPoolFactory = mock(XdsClientPoolFactory.class);
336336
@SuppressWarnings("unchecked")
@@ -345,7 +345,7 @@ public void start_passesParentServerToClientPoolFactory() throws Exception {
345345

346346
Future<?> unused = startServerAsync();
347347

348-
// Verify getOrCreate called with the server instance
348+
// Verify getOrCreate called with the ChannelConfigurer instance
349349
verify(mockPoolFactory).getOrCreate(
350350
any(), any(), any(), org.mockito.ArgumentMatchers.eq(mockConfigurer));
351351
}

0 commit comments

Comments
 (0)