Package io.grpc.util
Class OutlierDetectionLoadBalancer.OutlierDetectionSubchannel
java.lang.Object
io.grpc.LoadBalancer.Subchannel
io.grpc.util.ForwardingSubchannel
io.grpc.util.OutlierDetectionLoadBalancer.OutlierDetectionSubchannel
- Enclosing class:
OutlierDetectionLoadBalancer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Wraps the actual listener so that state changes from the actual one can be intercepted. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LoadBalancer.Subchannel
private boolean
private ConnectivityStateInfo
private final ChannelLogger
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescription(package private) void
protected LoadBalancer.Subchannel
delegate()
Returns the underlying Subchannel.(package private) void
eject()
The same attributes passed toHelper.createSubchannel()
.(package private) boolean
(package private) void
setEndpointTracker
(OutlierDetectionLoadBalancer.EndpointTracker endpointTracker) If theLoadBalancer.Subchannel
is considered for outlier detection the associatedOutlierDetectionLoadBalancer.EndpointTracker
should be set.void
shutdown()
Shuts down the Subchannel.void
start
(LoadBalancer.SubchannelStateListener listener) Starts the Subchannel.toString()
(package private) void
uneject()
void
updateAddresses
(List<EquivalentAddressGroup> addressGroups) Replaces the existing addresses used with thisSubchannel
.Methods inherited from class io.grpc.util.ForwardingSubchannel
asChannel, getAllAddresses, getChannelLogger, getConnectedAddressAttributes, getInternalSubchannel, requestConnection
Methods inherited from class io.grpc.LoadBalancer.Subchannel
getAddresses
-
Field Details
-
delegate
-
endpointTracker
-
ejected
private boolean ejected -
lastSubchannelState
-
subchannelStateListener
-
logger
-
-
Constructor Details
-
OutlierDetectionSubchannel
OutlierDetectionSubchannel(LoadBalancer.CreateSubchannelArgs args, LoadBalancer.Helper helper)
-
-
Method Details
-
start
Description copied from class:LoadBalancer.Subchannel
Starts the Subchannel. Can only be called once.Must be called prior to any other method on this class, except for
LoadBalancer.Subchannel.shutdown()
which may be called at any time.Must be called from the
Synchronization Context
, otherwise it may throw. See #5015 for more discussions.- Overrides:
start
in classForwardingSubchannel
- Parameters:
listener
- receives state updates for this Subchannel.
-
shutdown
public void shutdown()Description copied from class:LoadBalancer.Subchannel
Shuts down the Subchannel. After this method is called, this Subchannel should no longer be returned by the latestpicker
, and can be safely discarded.Calling it on an already shut-down Subchannel has no effect.
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.
- Overrides:
shutdown
in classForwardingSubchannel
-
getAttributes
Description copied from class:LoadBalancer.Subchannel
The same attributes passed toHelper.createSubchannel()
. LoadBalancer can use it to attach additional information here, e.g., the shard this Subchannel belongs to.- Overrides:
getAttributes
in classForwardingSubchannel
-
updateAddresses
Description copied from class:LoadBalancer.Subchannel
Replaces the existing addresses used with thisSubchannel
. If the new and old addresses overlap, the Subchannel can continue using an existing connection.It must be called from the Synchronization Context or will throw.
- Overrides:
updateAddresses
in classForwardingSubchannel
-
setEndpointTracker
If theLoadBalancer.Subchannel
is considered for outlier detection the associatedOutlierDetectionLoadBalancer.EndpointTracker
should be set. -
clearEndpointTracker
void clearEndpointTracker() -
eject
void eject() -
uneject
void uneject() -
isEjected
boolean isEjected() -
delegate
Description copied from class:ForwardingSubchannel
Returns the underlying Subchannel.- Specified by:
delegate
in classForwardingSubchannel
-
toString
- Overrides:
toString
in classForwardingSubchannel
-