From 56e4ce49bde47d17be2c4d5bd3ba9ab6fa7240ab Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Mon, 6 Mar 2023 10:35:32 -0800 Subject: [PATCH] Rename AbstractXdsClient to ControlPlaneClient (#9934) AbstractXdsClient is not abstract. --- ...{AbstractXdsClient.java => ControlPlaneClient.java} | 6 +++--- xds/src/main/java/io/grpc/xds/XdsClientImpl.java | 10 +++++----- .../test/java/io/grpc/xds/XdsClientImplTestBase.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename xds/src/main/java/io/grpc/xds/{AbstractXdsClient.java => ControlPlaneClient.java} (99%) diff --git a/xds/src/main/java/io/grpc/xds/AbstractXdsClient.java b/xds/src/main/java/io/grpc/xds/ControlPlaneClient.java similarity index 99% rename from xds/src/main/java/io/grpc/xds/AbstractXdsClient.java rename to xds/src/main/java/io/grpc/xds/ControlPlaneClient.java index 57e0575890..5a3400c751 100644 --- a/xds/src/main/java/io/grpc/xds/AbstractXdsClient.java +++ b/xds/src/main/java/io/grpc/xds/ControlPlaneClient.java @@ -60,7 +60,7 @@ import javax.annotation.Nullable; * Common base type for XdsClient implementations, which encapsulates the layer abstraction of * the xDS RPC stream. */ -final class AbstractXdsClient { +final class ControlPlaneClient { public static final String CLOSED_BY_SERVER = "Closed by server"; private final SynchronizationContext syncContext; @@ -92,7 +92,7 @@ final class AbstractXdsClient { /** An entity that manages ADS RPCs over a single channel. */ // TODO: rename to XdsChannel - AbstractXdsClient( + ControlPlaneClient( XdsChannelFactory xdsChannelFactory, ServerInfo serverInfo, Node bootstrapNode, @@ -388,7 +388,7 @@ final class AbstractXdsClient { @Override public void beforeStart(ClientCallStreamObserver requestStream) { - requestStream.setOnReadyHandler(AbstractXdsClient.this::readyHandler); + requestStream.setOnReadyHandler(ControlPlaneClient.this::readyHandler); } @Override diff --git a/xds/src/main/java/io/grpc/xds/XdsClientImpl.java b/xds/src/main/java/io/grpc/xds/XdsClientImpl.java index af5fb5d350..02162966ad 100644 --- a/xds/src/main/java/io/grpc/xds/XdsClientImpl.java +++ b/xds/src/main/java/io/grpc/xds/XdsClientImpl.java @@ -93,7 +93,7 @@ final class XdsClientImpl extends XdsClient private final FilterRegistry filterRegistry = FilterRegistry.getDefaultRegistry(); private final LoadBalancerRegistry loadBalancerRegistry = LoadBalancerRegistry.getDefaultRegistry(); - private final Map serverChannelMap = new HashMap<>(); + private final Map serverChannelMap = new HashMap<>(); private final Map, Map>> resourceSubscribers = new HashMap<>(); @@ -144,7 +144,7 @@ final class XdsClientImpl extends XdsClient if (serverChannelMap.containsKey(serverInfo)) { return; } - AbstractXdsClient xdsChannel = new AbstractXdsClient( + ControlPlaneClient xdsChannel = new ControlPlaneClient( xdsChannelFactory, serverInfo, bootstrapInfo.node(), @@ -218,7 +218,7 @@ final class XdsClientImpl extends XdsClient return; } isShutdown = true; - for (AbstractXdsClient xdsChannel : serverChannelMap.values()) { + for (ControlPlaneClient xdsChannel : serverChannelMap.values()) { xdsChannel.shutdown(); } if (reportingLoad) { @@ -490,7 +490,7 @@ final class XdsClientImpl extends XdsClient */ private final class ResourceSubscriber { @Nullable private final ServerInfo serverInfo; - @Nullable private final AbstractXdsClient xdsChannel; + @Nullable private final ControlPlaneClient xdsChannel; private final XdsResourceType type; private final String resource; private final Set> watchers = new HashSet<>(); @@ -518,7 +518,7 @@ final class XdsClientImpl extends XdsClient // is created but not yet requested because the client is in backoff. this.metadata = ResourceMetadata.newResourceMetadataUnknown(); - AbstractXdsClient xdsChannelTemp = null; + ControlPlaneClient xdsChannelTemp = null; try { maybeCreateXdsChannelWithLrs(serverInfo); xdsChannelTemp = serverChannelMap.get(serverInfo); diff --git a/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java b/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java index 0f18d3d387..23364bbd96 100644 --- a/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java +++ b/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java @@ -158,7 +158,7 @@ public abstract class XdsClientImplTestBase { new FakeClock.TaskFilter() { @Override public boolean shouldAccept(Runnable command) { - return command.toString().contains(AbstractXdsClient.RpcRetryTask.class.getSimpleName()); + return command.toString().contains(ControlPlaneClient.RpcRetryTask.class.getSimpleName()); } };