xds: remove unused variables

This commit is contained in:
ZHANG Dapeng 2019-05-30 14:38:43 -07:00 committed by GitHub
parent 3c931b40b0
commit f9decbf69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View File

@ -43,7 +43,6 @@ import io.grpc.xds.XdsSubchannelPickers.ErrorPicker;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@ -52,10 +51,6 @@ import javax.annotation.Nullable;
*/
final class XdsLoadBalancer extends LoadBalancer {
@VisibleForTesting
static final Attributes.Key<AtomicReference<ConnectivityStateInfo>> STATE_INFO =
Attributes.Key.create("io.grpc.xds.XdsLoadBalancer.stateInfo");
private final LocalityStore localityStore;
private final Helper helper;
private final LoadBalancerRegistry lbRegistry;
@ -98,7 +93,7 @@ final class XdsLoadBalancer extends LoadBalancer {
this.helper = helper;
this.lbRegistry = lbRegistry;
this.localityStore = new LocalityStoreImpl(new LocalityStoreHelper(), lbRegistry);
fallbackManager = new FallbackManager(helper, localityStore, lbRegistry);
fallbackManager = new FallbackManager(helper, lbRegistry);
}
private final class LocalityStoreHelper extends ForwardingLoadBalancerHelper {
@ -241,7 +236,6 @@ final class XdsLoadBalancer extends LoadBalancer {
private static final long FALLBACK_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(10); // same as grpclb
private final Helper helper;
private final LocalityStore localityStore;
private final LoadBalancerRegistry lbRegistry;
private LbConfig fallbackPolicy;
@ -260,10 +254,8 @@ final class XdsLoadBalancer extends LoadBalancer {
private boolean childBalancerWorked;
private boolean childPolicyHasBeenReady;
FallbackManager(
Helper helper, LocalityStore localityStore, LoadBalancerRegistry lbRegistry) {
FallbackManager(Helper helper, LoadBalancerRegistry lbRegistry) {
this.helper = helper;
this.localityStore = localityStore;
this.lbRegistry = lbRegistry;
}

View File

@ -32,7 +32,6 @@ import io.grpc.LoadBalancerRegistry;
import io.grpc.SynchronizationContext;
import io.grpc.internal.FakeClock;
import io.grpc.internal.ServiceConfigUtil.LbConfig;
import io.grpc.xds.LocalityStore.LocalityStoreImpl;
import io.grpc.xds.XdsLoadBalancer.FallbackManager;
import java.util.ArrayList;
import java.util.HashMap;
@ -130,8 +129,7 @@ public class FallbackManagerTest {
doReturn(channelLogger).when(helper).getChannelLogger();
lbRegistry.register(fakeRoundRonbinLbProvider);
lbRegistry.register(fakeFallbackLbProvider);
fallbackManager = new FallbackManager(
helper, new LocalityStoreImpl(helper, lbRegistry), lbRegistry);
fallbackManager = new FallbackManager(helper, lbRegistry);
fallbackPolicy = new LbConfig("test_policy", new HashMap<String, Void>());
}