Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AbstractXdsClient to ControlPlaneClient #9934

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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