@ThreadSafe public abstract static class LoadBalancer.Helper extends Object
| Constructor and Description |
|---|
Helper() |
| Modifier and Type | Method and Description |
|---|---|
abstract ManagedChannel |
createOobChannel(EquivalentAddressGroup eag,
String authority)
Out-of-band channel for LoadBalancer’s own RPC needs, e.g., talking to an external
load-balancer service.
|
abstract LoadBalancer.Subchannel |
createSubchannel(EquivalentAddressGroup addrs,
Attributes attrs)
Creates a Subchannel, which is a logical connection to the given group of addresses which are
considered equivalent.
|
abstract String |
getAuthority()
Returns the authority string of the channel, which is derived from the DNS-style target name.
|
abstract NameResolver.Factory |
getNameResolverFactory()
Returns the NameResolver of the channel.
|
abstract void |
runSerialized(Runnable task)
Schedule a task to be run in the Channel Executor, which serializes the task with the
callback methods on the
LoadBalancer interface. |
abstract void |
updatePicker(LoadBalancer.SubchannelPicker picker)
Set a new picker to the channel.
|
public abstract LoadBalancer.Subchannel createSubchannel(EquivalentAddressGroup addrs, Attributes attrs)
attrs are custom attributes associated with this
Subchannel, and can be accessed later through Subchannel.getAttributes().
The LoadBalancer is responsible for closing unused Subchannels, and closing all
Subchannels within LoadBalancer.shutdown().
public abstract ManagedChannel createOobChannel(EquivalentAddressGroup eag, String authority)
The LoadBalancer is responsible for closing unused OOB channels, and closing all OOB
channels within LoadBalancer.shutdown().
public abstract void updatePicker(LoadBalancer.SubchannelPicker picker)
When a new picker is provided via updatePicker(), the channel will apply the
picker on all buffered RPCs, by calling LoadBalancer.SubchannelPicker.pickSubchannel(
LoadBalancer.PickSubchannelArgs).
The channel will hold the picker and use it for all RPCs, until updatePicker() is
called again and a new picker replaces the old one. If updatePicker() has never been
called, the channel will buffer all RPCs until a picker is provided.
public abstract void runSerialized(Runnable task)
LoadBalancer interface.public abstract NameResolver.Factory getNameResolverFactory()
public abstract String getAuthority()