@Internal public final class OutlierDetectionLoadBalancer extends LoadBalancer
LoadBalancer
while monitoring for outlier backends and removing them from
the use of the child LB.
This implements the outlier detection gRFC: https://github.com/grpc/proposal/blob/master/A50-xds-outlier-detection.md
Modifier and Type | Class and Description |
---|---|
static class |
OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig
The configuration for
OutlierDetectionLoadBalancer . |
LoadBalancer.CreateSubchannelArgs, LoadBalancer.Factory, LoadBalancer.Helper, LoadBalancer.PickResult, LoadBalancer.PickSubchannelArgs, LoadBalancer.ResolvedAddresses, LoadBalancer.Subchannel, LoadBalancer.SubchannelPicker, LoadBalancer.SubchannelStateListener
ATTR_HEALTH_CHECKING_CONFIG
Constructor and Description |
---|
OutlierDetectionLoadBalancer(LoadBalancer.Helper helper,
io.grpc.internal.TimeProvider timeProvider)
Creates a new instance of
OutlierDetectionLoadBalancer . |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptResolvedAddresses(LoadBalancer.ResolvedAddresses resolvedAddresses)
Accepts newly resolved addresses from the name resolution system.
|
void |
handleNameResolutionError(Status error)
Handles an error from the name resolution system.
|
void |
shutdown()
The channel asks the load-balancer to shutdown.
|
canHandleEmptyAddressListFromNameResolution, handleResolvedAddresses, handleSubchannelState, requestConnection
public OutlierDetectionLoadBalancer(LoadBalancer.Helper helper, io.grpc.internal.TimeProvider timeProvider)
OutlierDetectionLoadBalancer
.public boolean acceptResolvedAddresses(LoadBalancer.ResolvedAddresses resolvedAddresses)
LoadBalancer
EquivalentAddressGroup
addresses should be considered equivalent but may be flattened into a
single list if needed.
Implementations can choose to reject the given addresses by returning false
.
Implementations should not modify the given addresses
.
acceptResolvedAddresses
in class LoadBalancer
resolvedAddresses
- the resolved server addresses, attributes, and config.true
if the resolved addresses were accepted. false
if rejected.public void handleNameResolutionError(Status error)
LoadBalancer
handleNameResolutionError
in class LoadBalancer
error
- a non-OK statuspublic void shutdown()
LoadBalancer
shutdown
in class LoadBalancer