Package io.grpc.util
Class OutlierDetectionLoadBalancer.EndpointTracker
- java.lang.Object
-
- io.grpc.util.OutlierDetectionLoadBalancer.EndpointTracker
-
- Enclosing class:
- OutlierDetectionLoadBalancer
static class OutlierDetectionLoadBalancer.EndpointTracker extends java.lang.ObjectTracks additional information about the endpoint needed for outlier detection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOutlierDetectionLoadBalancer.EndpointTracker.CallCounterTracks both successful and failed call counts.
-
Field Summary
Fields Modifier and Type Field Description private OutlierDetectionLoadBalancer.EndpointTracker.CallCounteractiveCallCounterprivate OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfigconfigprivate intejectionTimeMultiplierprivate java.lang.LongejectionTimeNanosprivate OutlierDetectionLoadBalancer.EndpointTracker.CallCounterinactiveCallCounterprivate java.util.Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel>subchannels
-
Constructor Summary
Constructors Constructor Description EndpointTracker(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) longactiveVolume()(package private) booleanaddSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)Adds a subchannel to the tracker, while assuring that the subchannel ejection status is updated to match the tracker's if needed.(package private) booleancontainsSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)(package private) voiddecrementEjectionTimeMultiplier()(package private) voidejectSubchannels(long ejectionTimeNanos)(package private) doublefailureRate()(package private) java.util.Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel>getSubchannels()(package private) longinactiveVolume()(package private) voidincrementCallCount(boolean success)booleanmaxEjectionTimeElapsed(long currentTimeNanos)(package private) booleanremoveSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)(package private) voidresetCallCounters()(package private) voidresetEjectionTimeMultiplier()(package private) voidsetConfig(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)(package private) booleansubchannelsEjected()(package private) doublesuccessRate()(package private) voidswapCounters()Swaps the active and inactive counters.java.lang.StringtoString()(package private) voidunejectSubchannels()Uneject a currently ejected address.
-
-
-
Field Detail
-
config
private OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config
-
activeCallCounter
private volatile OutlierDetectionLoadBalancer.EndpointTracker.CallCounter activeCallCounter
-
inactiveCallCounter
private OutlierDetectionLoadBalancer.EndpointTracker.CallCounter inactiveCallCounter
-
ejectionTimeNanos
private java.lang.Long ejectionTimeNanos
-
ejectionTimeMultiplier
private int ejectionTimeMultiplier
-
subchannels
private final java.util.Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel> subchannels
-
-
Constructor Detail
-
EndpointTracker
EndpointTracker(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
-
-
Method Detail
-
setConfig
void setConfig(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
-
addSubchannel
boolean addSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)
Adds a subchannel to the tracker, while assuring that the subchannel ejection status is updated to match the tracker's if needed.
-
removeSubchannel
boolean removeSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)
-
containsSubchannel
boolean containsSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)
-
getSubchannels
java.util.Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel> getSubchannels()
-
incrementCallCount
void incrementCallCount(boolean success)
-
activeVolume
long activeVolume()
-
inactiveVolume
long inactiveVolume()
-
successRate
double successRate()
-
failureRate
double failureRate()
-
resetCallCounters
void resetCallCounters()
-
decrementEjectionTimeMultiplier
void decrementEjectionTimeMultiplier()
-
resetEjectionTimeMultiplier
void resetEjectionTimeMultiplier()
-
swapCounters
void swapCounters()
Swaps the active and inactive counters.Note that this method is not thread safe as the swap is not done atomically. This is expected to only be called from the timer that is scheduled at a fixed delay, assuring that only one timer is active at a time.
-
ejectSubchannels
void ejectSubchannels(long ejectionTimeNanos)
-
unejectSubchannels
void unejectSubchannels()
Uneject a currently ejected address.
-
subchannelsEjected
boolean subchannelsEjected()
-
maxEjectionTimeElapsed
public boolean maxEjectionTimeElapsed(long currentTimeNanos)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-