Skip to content

Commit

Permalink
Rename AbstractXdsClient to ControlPlaneClient (#9934)
Browse files Browse the repository at this point in the history
AbstractXdsClient is not abstract.
  • Loading branch information
temawi committed Mar 6, 2023
1 parent b55ecd5 commit 56e4ce4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* 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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -388,7 +388,7 @@ void start() {

@Override
public void beforeStart(ClientCallStreamObserver<DiscoveryRequest> requestStream) {
requestStream.setOnReadyHandler(AbstractXdsClient.this::readyHandler);
requestStream.setOnReadyHandler(ControlPlaneClient.this::readyHandler);
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions xds/src/main/java/io/grpc/xds/XdsClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void uncaughtException(Thread t, Throwable e) {
private final FilterRegistry filterRegistry = FilterRegistry.getDefaultRegistry();
private final LoadBalancerRegistry loadBalancerRegistry
= LoadBalancerRegistry.getDefaultRegistry();
private final Map<ServerInfo, AbstractXdsClient> serverChannelMap = new HashMap<>();
private final Map<ServerInfo, ControlPlaneClient> serverChannelMap = new HashMap<>();
private final Map<XdsResourceType<? extends ResourceUpdate>,
Map<String, ResourceSubscriber<? extends ResourceUpdate>>>
resourceSubscribers = new HashMap<>();
Expand Down Expand Up @@ -144,7 +144,7 @@ private void maybeCreateXdsChannelWithLrs(ServerInfo serverInfo) {
if (serverChannelMap.containsKey(serverInfo)) {
return;
}
AbstractXdsClient xdsChannel = new AbstractXdsClient(
ControlPlaneClient xdsChannel = new ControlPlaneClient(
xdsChannelFactory,
serverInfo,
bootstrapInfo.node(),
Expand Down Expand Up @@ -218,7 +218,7 @@ public void run() {
return;
}
isShutdown = true;
for (AbstractXdsClient xdsChannel : serverChannelMap.values()) {
for (ControlPlaneClient xdsChannel : serverChannelMap.values()) {
xdsChannel.shutdown();
}
if (reportingLoad) {
Expand Down Expand Up @@ -490,7 +490,7 @@ private <T extends ResourceUpdate> void handleResourceUpdate(XdsResourceType.Arg
*/
private final class ResourceSubscriber<T extends ResourceUpdate> {
@Nullable private final ServerInfo serverInfo;
@Nullable private final AbstractXdsClient xdsChannel;
@Nullable private final ControlPlaneClient xdsChannel;
private final XdsResourceType<T> type;
private final String resource;
private final Set<ResourceWatcher<T>> watchers = new HashSet<>();
Expand Down Expand Up @@ -518,7 +518,7 @@ private final class ResourceSubscriber<T extends ResourceUpdate> {
// 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);
Expand Down
2 changes: 1 addition & 1 deletion xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
};

Expand Down

0 comments on commit 56e4ce4

Please sign in to comment.