mirror of https://github.com/grpc/grpc-java.git
xds: CdsLoadBalancer2 to use acceptResolvedAddresses (#9570)
xds: CdsLoadBalancer2 to use acceptResolvedAddresses Moving over from handleResolvedAddresses() as part of an API migration.
This commit is contained in:
parent
950fb7da61
commit
8473e270eb
|
@ -79,9 +79,9 @@ final class CdsLoadBalancer2 extends LoadBalancer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) {
|
||||
public boolean acceptResolvedAddresses(ResolvedAddresses resolvedAddresses) {
|
||||
if (this.resolvedAddresses != null) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
logger.log(XdsLogLevel.DEBUG, "Received resolution result: {0}", resolvedAddresses);
|
||||
this.resolvedAddresses = resolvedAddresses;
|
||||
|
@ -91,6 +91,7 @@ final class CdsLoadBalancer2 extends LoadBalancer {
|
|||
logger.log(XdsLogLevel.INFO, "Config: {0}", config);
|
||||
cdsLbState = new CdsLbState(config.name);
|
||||
cdsLbState.start();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -135,7 +135,7 @@ public class CdsLoadBalancer2Test {
|
|||
lbRegistry.register(new FakeLoadBalancerProvider("least_request_experimental",
|
||||
new LeastRequestLoadBalancerProvider()));
|
||||
loadBalancer = new CdsLoadBalancer2(helper, lbRegistry);
|
||||
loadBalancer.handleResolvedAddresses(
|
||||
loadBalancer.acceptResolvedAddresses(
|
||||
ResolvedAddresses.newBuilder()
|
||||
.setAddresses(Collections.<EquivalentAddressGroup>emptyList())
|
||||
.setAttributes(
|
||||
|
|
Loading…
Reference in New Issue