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) classWraps the actual listener so that state changes from the actual one can be intercepted. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LoadBalancer.Subchannelprivate booleanprivate ConnectivityStateInfoprivate final ChannelLogger -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescription(package private) voidprotected LoadBalancer.Subchanneldelegate()Returns the underlying Subchannel.(package private) voideject()The same attributes passed toHelper.createSubchannel().(package private) boolean(package private) voidsetEndpointTracker(OutlierDetectionLoadBalancer.EndpointTracker endpointTracker) If theLoadBalancer.Subchannelis considered for outlier detection the associatedOutlierDetectionLoadBalancer.EndpointTrackershould be set.voidshutdown()Shuts down the Subchannel.voidstart(LoadBalancer.SubchannelStateListener listener) Starts the Subchannel.toString()(package private) voiduneject()voidupdateAddresses(List<EquivalentAddressGroup> addressGroups) Replaces the existing addresses used with thisSubchannel.Methods inherited from class io.grpc.util.ForwardingSubchannel
asChannel, getAllAddresses, getChannelLogger, getConnectedAddressAttributes, getInternalSubchannel, requestConnectionMethods 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.SubchannelStarts 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:
startin classForwardingSubchannel- Parameters:
listener- receives state updates for this Subchannel.
-
shutdown
public void shutdown()Description copied from class:LoadBalancer.SubchannelShuts 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:
shutdownin classForwardingSubchannel
-
getAttributes
Description copied from class:LoadBalancer.SubchannelThe same attributes passed toHelper.createSubchannel(). LoadBalancer can use it to attach additional information here, e.g., the shard this Subchannel belongs to.- Overrides:
getAttributesin classForwardingSubchannel
-
updateAddresses
Description copied from class:LoadBalancer.SubchannelReplaces 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:
updateAddressesin classForwardingSubchannel
-
setEndpointTracker
If theLoadBalancer.Subchannelis considered for outlier detection the associatedOutlierDetectionLoadBalancer.EndpointTrackershould be set. -
clearEndpointTracker
void clearEndpointTracker() -
eject
void eject() -
uneject
void uneject() -
isEjected
boolean isEjected() -
delegate
Description copied from class:ForwardingSubchannelReturns the underlying Subchannel.- Specified by:
delegatein classForwardingSubchannel
-
toString
- Overrides:
toStringin classForwardingSubchannel
-