mirror of https://github.com/grpc/grpc-java.git
Rename AbstractXdsClient to ControlPlaneClient (#9934)
AbstractXdsClient is not abstract.
This commit is contained in:
parent
b55ecd5c35
commit
56e4ce49bd
|
@ -60,7 +60,7 @@ import javax.annotation.Nullable;
|
||||||
* Common base type for XdsClient implementations, which encapsulates the layer abstraction of
|
* Common base type for XdsClient implementations, which encapsulates the layer abstraction of
|
||||||
* the xDS RPC stream.
|
* the xDS RPC stream.
|
||||||
*/
|
*/
|
||||||
final class AbstractXdsClient {
|
final class ControlPlaneClient {
|
||||||
|
|
||||||
public static final String CLOSED_BY_SERVER = "Closed by server";
|
public static final String CLOSED_BY_SERVER = "Closed by server";
|
||||||
private final SynchronizationContext syncContext;
|
private final SynchronizationContext syncContext;
|
||||||
|
@ -92,7 +92,7 @@ final class AbstractXdsClient {
|
||||||
|
|
||||||
/** An entity that manages ADS RPCs over a single channel. */
|
/** An entity that manages ADS RPCs over a single channel. */
|
||||||
// TODO: rename to XdsChannel
|
// TODO: rename to XdsChannel
|
||||||
AbstractXdsClient(
|
ControlPlaneClient(
|
||||||
XdsChannelFactory xdsChannelFactory,
|
XdsChannelFactory xdsChannelFactory,
|
||||||
ServerInfo serverInfo,
|
ServerInfo serverInfo,
|
||||||
Node bootstrapNode,
|
Node bootstrapNode,
|
||||||
|
@ -388,7 +388,7 @@ final class AbstractXdsClient {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeStart(ClientCallStreamObserver<DiscoveryRequest> requestStream) {
|
public void beforeStart(ClientCallStreamObserver<DiscoveryRequest> requestStream) {
|
||||||
requestStream.setOnReadyHandler(AbstractXdsClient.this::readyHandler);
|
requestStream.setOnReadyHandler(ControlPlaneClient.this::readyHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -93,7 +93,7 @@ final class XdsClientImpl extends XdsClient
|
||||||
private final FilterRegistry filterRegistry = FilterRegistry.getDefaultRegistry();
|
private final FilterRegistry filterRegistry = FilterRegistry.getDefaultRegistry();
|
||||||
private final LoadBalancerRegistry loadBalancerRegistry
|
private final LoadBalancerRegistry loadBalancerRegistry
|
||||||
= LoadBalancerRegistry.getDefaultRegistry();
|
= LoadBalancerRegistry.getDefaultRegistry();
|
||||||
private final Map<ServerInfo, AbstractXdsClient> serverChannelMap = new HashMap<>();
|
private final Map<ServerInfo, ControlPlaneClient> serverChannelMap = new HashMap<>();
|
||||||
private final Map<XdsResourceType<? extends ResourceUpdate>,
|
private final Map<XdsResourceType<? extends ResourceUpdate>,
|
||||||
Map<String, ResourceSubscriber<? extends ResourceUpdate>>>
|
Map<String, ResourceSubscriber<? extends ResourceUpdate>>>
|
||||||
resourceSubscribers = new HashMap<>();
|
resourceSubscribers = new HashMap<>();
|
||||||
|
@ -144,7 +144,7 @@ final class XdsClientImpl extends XdsClient
|
||||||
if (serverChannelMap.containsKey(serverInfo)) {
|
if (serverChannelMap.containsKey(serverInfo)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractXdsClient xdsChannel = new AbstractXdsClient(
|
ControlPlaneClient xdsChannel = new ControlPlaneClient(
|
||||||
xdsChannelFactory,
|
xdsChannelFactory,
|
||||||
serverInfo,
|
serverInfo,
|
||||||
bootstrapInfo.node(),
|
bootstrapInfo.node(),
|
||||||
|
@ -218,7 +218,7 @@ final class XdsClientImpl extends XdsClient
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isShutdown = true;
|
isShutdown = true;
|
||||||
for (AbstractXdsClient xdsChannel : serverChannelMap.values()) {
|
for (ControlPlaneClient xdsChannel : serverChannelMap.values()) {
|
||||||
xdsChannel.shutdown();
|
xdsChannel.shutdown();
|
||||||
}
|
}
|
||||||
if (reportingLoad) {
|
if (reportingLoad) {
|
||||||
|
@ -490,7 +490,7 @@ final class XdsClientImpl extends XdsClient
|
||||||
*/
|
*/
|
||||||
private final class ResourceSubscriber<T extends ResourceUpdate> {
|
private final class ResourceSubscriber<T extends ResourceUpdate> {
|
||||||
@Nullable private final ServerInfo serverInfo;
|
@Nullable private final ServerInfo serverInfo;
|
||||||
@Nullable private final AbstractXdsClient xdsChannel;
|
@Nullable private final ControlPlaneClient xdsChannel;
|
||||||
private final XdsResourceType<T> type;
|
private final XdsResourceType<T> type;
|
||||||
private final String resource;
|
private final String resource;
|
||||||
private final Set<ResourceWatcher<T>> watchers = new HashSet<>();
|
private final Set<ResourceWatcher<T>> watchers = new HashSet<>();
|
||||||
|
@ -518,7 +518,7 @@ final class XdsClientImpl extends XdsClient
|
||||||
// is created but not yet requested because the client is in backoff.
|
// is created but not yet requested because the client is in backoff.
|
||||||
this.metadata = ResourceMetadata.newResourceMetadataUnknown();
|
this.metadata = ResourceMetadata.newResourceMetadataUnknown();
|
||||||
|
|
||||||
AbstractXdsClient xdsChannelTemp = null;
|
ControlPlaneClient xdsChannelTemp = null;
|
||||||
try {
|
try {
|
||||||
maybeCreateXdsChannelWithLrs(serverInfo);
|
maybeCreateXdsChannelWithLrs(serverInfo);
|
||||||
xdsChannelTemp = serverChannelMap.get(serverInfo);
|
xdsChannelTemp = serverChannelMap.get(serverInfo);
|
||||||
|
|
|
@ -158,7 +158,7 @@ public abstract class XdsClientImplTestBase {
|
||||||
new FakeClock.TaskFilter() {
|
new FakeClock.TaskFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldAccept(Runnable command) {
|
public boolean shouldAccept(Runnable command) {
|
||||||
return command.toString().contains(AbstractXdsClient.RpcRetryTask.class.getSimpleName());
|
return command.toString().contains(ControlPlaneClient.RpcRetryTask.class.getSimpleName());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue