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

xds: Make XdsNR.RoutingConfig.empty a constant #11868

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions xds/src/main/java/io/grpc/xds/XdsNameResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ final class XdsNameResolver extends NameResolver {
private final long randomChannelId;
private final MetricRecorder metricRecorder;

private volatile RoutingConfig routingConfig = RoutingConfig.empty;
private volatile RoutingConfig routingConfig = RoutingConfig.EMPTY;
private Listener2 listener;
private ObjectPool<XdsClient> xdsClientPool;
private XdsClient xdsClient;
Expand Down Expand Up @@ -856,7 +856,7 @@ private void cleanUpRoutes(String error) {
}
existingClusters = null;
}
routingConfig = RoutingConfig.empty;
routingConfig = RoutingConfig.EMPTY;
// Without addresses the default LB (normally pick_first) should become TRANSIENT_FAILURE, and
// the config selector handles the error message itself. Once the LB API allows providing
// failure information for addresses yet still providing a service config, the config seector
Expand Down Expand Up @@ -938,7 +938,7 @@ private static class RoutingConfig {
private final long fallbackTimeoutNano;
final ImmutableList<RouteData> routes;

private static RoutingConfig empty = new RoutingConfig(0, ImmutableList.of());
private static final RoutingConfig EMPTY = new RoutingConfig(0, ImmutableList.of());

private RoutingConfig(long fallbackTimeoutNano, ImmutableList<RouteData> routes) {
this.fallbackTimeoutNano = fallbackTimeoutNano;
Expand Down