Class CachingRlsLbClient.RlsLbHelper
- java.lang.Object
-
- io.grpc.LoadBalancer.Helper
-
- io.grpc.util.ForwardingLoadBalancerHelper
-
- io.grpc.rls.CachingRlsLbClient.RlsLbHelper
-
- Enclosing class:
- CachingRlsLbClient
private static final class CachingRlsLbClient.RlsLbHelper extends ForwardingLoadBalancerHelper
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LoadBalancer.Helper
helper
private LoadBalancer.SubchannelPicker
picker
private ConnectivityState
state
-
Constructor Summary
Constructors Constructor Description RlsLbHelper(LoadBalancer.Helper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoadBalancer.Helper
delegate()
Returns the underlying helper.(package private) void
triggerPendingRpcProcessing()
void
updateBalancingState(ConnectivityState newState, LoadBalancer.SubchannelPicker newPicker)
Set a new state with a new picker to the channel.-
Methods inherited from class io.grpc.util.ForwardingLoadBalancerHelper
createOobChannel, createOobChannel, createResolvingOobChannel, createResolvingOobChannelBuilder, createResolvingOobChannelBuilder, createSubchannel, getAuthority, getChannelCredentials, getChannelLogger, getChannelTarget, getMetricRecorder, getNameResolverArgs, getNameResolverRegistry, getScheduledExecutorService, getSynchronizationContext, getUnsafeChannelCredentials, ignoreRefreshNameResolutionCheck, refreshNameResolution, toString, updateOobChannelAddresses, updateOobChannelAddresses
-
-
-
-
Field Detail
-
helper
final LoadBalancer.Helper helper
-
state
private ConnectivityState state
-
picker
private LoadBalancer.SubchannelPicker picker
-
-
Constructor Detail
-
RlsLbHelper
RlsLbHelper(LoadBalancer.Helper helper)
-
-
Method Detail
-
delegate
protected LoadBalancer.Helper delegate()
Description copied from class:ForwardingLoadBalancerHelper
Returns the underlying helper.- Specified by:
delegate
in classForwardingLoadBalancerHelper
-
updateBalancingState
public void updateBalancingState(ConnectivityState newState, LoadBalancer.SubchannelPicker newPicker)
Description copied from class:LoadBalancer.Helper
Set a new state with a new picker to the channel.When a new picker is provided via
updateBalancingState()
, the channel will apply the picker on all buffered RPCs, by callingLoadBalancer.SubchannelPicker.pickSubchannel( LoadBalancer.PickSubchannelArgs)
.The channel will hold the picker and use it for all RPCs, until
updateBalancingState()
is called again and a new picker replaces the old one. IfupdateBalancingState()
has never been called, the channel will buffer all RPCs until a picker is provided.It should be called from the Synchronization Context. Currently will log a warning if violated. It will become an exception eventually. See #5015 for the background.
The passed state will be the channel's new state. The SHUTDOWN state should not be passed and its behavior is undefined.
- Overrides:
updateBalancingState
in classForwardingLoadBalancerHelper
-
triggerPendingRpcProcessing
void triggerPendingRpcProcessing()
-
-