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.Object
Tracks additional information about the endpoint needed for outlier detection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OutlierDetectionLoadBalancer.EndpointTracker.CallCounter
Tracks both successful and failed call counts.
-
Field Summary
Fields Modifier and Type Field Description private OutlierDetectionLoadBalancer.EndpointTracker.CallCounter
activeCallCounter
private OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig
config
private int
ejectionTimeMultiplier
private java.lang.Long
ejectionTimeNanos
private OutlierDetectionLoadBalancer.EndpointTracker.CallCounter
inactiveCallCounter
private 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) long
activeVolume()
(package private) 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.(package private) boolean
containsSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)
(package private) void
decrementEjectionTimeMultiplier()
(package private) void
ejectSubchannels(long ejectionTimeNanos)
(package private) double
failureRate()
(package private) java.util.Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel>
getSubchannels()
(package private) long
inactiveVolume()
(package private) void
incrementCallCount(boolean success)
boolean
maxEjectionTimeElapsed(long currentTimeNanos)
(package private) boolean
removeSubchannel(OutlierDetectionLoadBalancer.OutlierDetectionSubchannel subchannel)
(package private) void
resetCallCounters()
(package private) void
resetEjectionTimeMultiplier()
(package private) void
setConfig(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
(package private) boolean
subchannelsEjected()
(package private) double
successRate()
(package private) void
swapCounters()
Swaps the active and inactive counters.java.lang.String
toString()
(package private) void
unejectSubchannels()
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:
toString
in classjava.lang.Object
-
-