diff --git a/core/src/main/java/io/grpc/LoadBalancer.java b/core/src/main/java/io/grpc/LoadBalancer.java index 7f4eaaf3b3..c75c7c2b59 100644 --- a/core/src/main/java/io/grpc/LoadBalancer.java +++ b/core/src/main/java/io/grpc/LoadBalancer.java @@ -551,9 +551,10 @@ public abstract class LoadBalancer { public abstract ManagedChannel createOobChannel(EquivalentAddressGroup eag, String authority); /** - * Updates the addresses used for connections in the {@code Channel}. This is supperior to - * {@link #createOobChannel} when the old and new addresses overlap, since the channel can - * continue using an existing connection. + * Updates the addresses used for connections in the {@code Channel} that was created by {@link + * #createOobChannel(EquivalentAddressGroup, String)}. This is supperior to {@link + * #createOobChannel(EquivalentAddressGroup, String)} when the old and new addresses overlap, + * since the channel can continue using an existing connection. * * @throws IllegalArgumentException if {@code channel} was not returned from {@link * #createOobChannel} @@ -563,6 +564,26 @@ public abstract class LoadBalancer { throw new UnsupportedOperationException(); } + /** + * Creates an out-of-band channel for LoadBalancer's own RPC needs, e.g., talking to an external + * load-balancer service, that is specified by a target string. See the documentation on + * {@link ManagedChannelBuilder#forTarget} for the format of a target string. + * + *

The target string will be resolved by a {@link NameResolver} created according to the + * target string. The out-of-band channel doesn't have load-balancing. If multiple addresses + * are resolved for the target, the first working address will be used. + * + *

The LoadBalancer is responsible for closing unused OOB channels, and closing all OOB + * channels within {@link #shutdown}. + * + *

NOT IMPLEMENTED: this method is currently a stub and not yet implemented by gRPC. + * + * @since 1.20.0 + */ + public ManagedChannel createResolvingOobChannel(String target) { + throw new UnsupportedOperationException("Not implemented"); + } + /** * Set a new state with a new picker to the channel. * diff --git a/core/src/main/java/io/grpc/util/ForwardingLoadBalancerHelper.java b/core/src/main/java/io/grpc/util/ForwardingLoadBalancerHelper.java index c9f9e320f8..ce5e76fc95 100644 --- a/core/src/main/java/io/grpc/util/ForwardingLoadBalancerHelper.java +++ b/core/src/main/java/io/grpc/util/ForwardingLoadBalancerHelper.java @@ -59,6 +59,11 @@ public abstract class ForwardingLoadBalancerHelper extends LoadBalancer.Helper { delegate().updateOobChannelAddresses(channel, eag); } + @Override + public ManagedChannel createResolvingOobChannel(String target) { + return delegate().createResolvingOobChannel(target); + } + @Override public void updateBalancingState( ConnectivityState newState, SubchannelPicker newPicker) {