Class ClusterManagerLoadBalancer
java.lang.Object
io.grpc.LoadBalancer
io.grpc.util.MultiChildLoadBalancer
io.grpc.xds.ClusterManagerLoadBalancer
class ClusterManagerLoadBalancer
extends io.grpc.util.MultiChildLoadBalancer
The top-level load balancing policy for use in XDS.
This policy does not immediately delete its children. Instead, it marks them deactivated
and starts a timer for deletion. If a subsequent address update restores the child, then it is
simply reactivated instead of built from scratch. This is necessary because XDS can frequently
remove and then add back a server as machines are rebooted or repurposed for load management.
Note that this LB does not automatically reconnect children who go into IDLE status
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classThis differs from the base class in the use of the deletion timer.(package private) static final classNested classes/interfaces inherited from class io.grpc.util.MultiChildLoadBalancer
io.grpc.util.MultiChildLoadBalancer.AcceptResolvedAddrRetVal, io.grpc.util.MultiChildLoadBalancer.ChildLbState, io.grpc.util.MultiChildLoadBalancer.EndpointNested classes/interfaces inherited from class io.grpc.LoadBalancer
io.grpc.LoadBalancer.CreateSubchannelArgs, io.grpc.LoadBalancer.ErrorPicker, io.grpc.LoadBalancer.Factory, io.grpc.LoadBalancer.FixedResultPicker, io.grpc.LoadBalancer.Helper, io.grpc.LoadBalancer.PickDetailsConsumer, io.grpc.LoadBalancer.PickResult, io.grpc.LoadBalancer.PickSubchannelArgs, io.grpc.LoadBalancer.ResolvedAddresses, io.grpc.LoadBalancer.Subchannel, io.grpc.LoadBalancer.SubchannelPicker, io.grpc.LoadBalancer.SubchannelStateListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate io.grpc.LoadBalancer.ResolvedAddressesprivate final XdsLoggerprotected final io.grpc.SynchronizationContextprivate final ScheduledExecutorServiceFields inherited from class io.grpc.util.MultiChildLoadBalancer
currentConnectivityState, pickFirstLbProvider, resolvingAddressesFields inherited from class io.grpc.LoadBalancer
ATTR_HEALTH_CHECKING_CONFIG, DISABLE_SUBCHANNEL_RECONNECT_KEY, EMPTY_PICKER, HAS_HEALTH_PRODUCER_LISTENER_KEY, HEALTH_CONSUMER_LISTENER_ARG_KEY, IS_PETIOLE_POLICY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateChildAddressesMap(io.grpc.LoadBalancer.ResolvedAddresses resolvedAddresses) protected io.grpc.util.MultiChildLoadBalancer.ChildLbStatecreateChildLbState(Object key) protected io.grpc.LoadBalancer.SubchannelPickergetSubchannelPicker(Map<Object, io.grpc.LoadBalancer.SubchannelPicker> childPickers) voidhandleNameResolutionError(io.grpc.Status error) protected voidUsing the state of all children will calculate the current connectivity state, update currentConnectivityState, generate a picker and then callLoadBalancer.Helper.updateBalancingState(ConnectivityState, SubchannelPicker).Methods inherited from class io.grpc.util.MultiChildLoadBalancer
acceptResolvedAddresses, acceptResolvedAddressesInternal, aggregateState, getChildLbState, getChildLbStateEag, getChildLbStates, getHelper, getReadyChildren, shutdown, shutdownRemovedMethods inherited from class io.grpc.LoadBalancer
canHandleEmptyAddressListFromNameResolution, handleResolvedAddresses, handleSubchannelState, requestConnection
-
Field Details
-
DELAYED_CHILD_DELETION_TIME_MINUTES
public static final int DELAYED_CHILD_DELETION_TIME_MINUTES- See Also:
-
syncContext
protected final io.grpc.SynchronizationContext syncContext -
timeService
-
logger
-
lastResolvedAddresses
private io.grpc.LoadBalancer.ResolvedAddresses lastResolvedAddresses
-
-
Constructor Details
-
ClusterManagerLoadBalancer
ClusterManagerLoadBalancer(io.grpc.LoadBalancer.Helper helper)
-
-
Method Details
-
createChildLbState
- Overrides:
createChildLbStatein classio.grpc.util.MultiChildLoadBalancer
-
createChildAddressesMap
-
updateOverallBalancingState
protected void updateOverallBalancingState()Using the state of all children will calculate the current connectivity state, update currentConnectivityState, generate a picker and then callLoadBalancer.Helper.updateBalancingState(ConnectivityState, SubchannelPicker).- Specified by:
updateOverallBalancingStatein classio.grpc.util.MultiChildLoadBalancer
-
getSubchannelPicker
-
handleNameResolutionError
public void handleNameResolutionError(io.grpc.Status error) - Overrides:
handleNameResolutionErrorin classio.grpc.util.MultiChildLoadBalancer
-