Package io.grpc.util
Class OutlierDetectionLoadBalancer.EndpointTrackerMap
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.collect.ForwardingMap<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>
-
- io.grpc.util.OutlierDetectionLoadBalancer.EndpointTrackerMap
-
- All Implemented Interfaces:
java.util.Map<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>
- Enclosing class:
- OutlierDetectionLoadBalancer
static class OutlierDetectionLoadBalancer.EndpointTrackerMap extends com.google.common.collect.ForwardingMap<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>
Maintains a mapping from endpoint (a set of addresses) to their trackers.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>trackerMap
-
Constructor Summary
Constructors Constructor Description EndpointTrackerMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcancelTracking()When OD gets disabled we need to uneject any subchannels that may have been ejected and to reset the ejection time multiplier.protected java.util.Map<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>delegate()(package private) doubleejectionPercentage()How many percent of the addresses have been ejected.(package private) voidmaybeUnejectOutliers(java.lang.Long detectionTimerStartNanos)At the end of a timer run we need to decrement the ejection time multiplier for trackers that don't have ejected subchannels and uneject ones that have spent the maximum ejection time allowed.(package private) voidputNewTrackers(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, java.util.Set<java.util.Set<java.net.SocketAddress>> endpoints)Adds a new tracker for every given address.(package private) voidresetCallCounters()Resets the call counters for all the trackers in the map.(package private) voidswapCounters()Swaps the active and inactive counters for each tracker.(package private) voidupdateTrackerConfigs(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)-
Methods inherited from class com.google.common.collect.ForwardingMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, standardClear, standardContainsKey, standardContainsValue, standardEquals, standardHashCode, standardIsEmpty, standardPutAll, standardRemove, standardToString, values
-
-
-
-
Field Detail
-
trackerMap
private final java.util.Map<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker> trackerMap
-
-
Method Detail
-
delegate
protected java.util.Map<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker> delegate()
- Specified by:
delegatein classcom.google.common.collect.ForwardingMap<java.util.Set<java.net.SocketAddress>,OutlierDetectionLoadBalancer.EndpointTracker>
-
updateTrackerConfigs
void updateTrackerConfigs(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
-
putNewTrackers
void putNewTrackers(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, java.util.Set<java.util.Set<java.net.SocketAddress>> endpoints)
Adds a new tracker for every given address.
-
resetCallCounters
void resetCallCounters()
Resets the call counters for all the trackers in the map.
-
cancelTracking
void cancelTracking()
When OD gets disabled we need to uneject any subchannels that may have been ejected and to reset the ejection time multiplier.
-
swapCounters
void swapCounters()
Swaps the active and inactive counters for each tracker.
-
maybeUnejectOutliers
void maybeUnejectOutliers(java.lang.Long detectionTimerStartNanos)
At the end of a timer run we need to decrement the ejection time multiplier for trackers that don't have ejected subchannels and uneject ones that have spent the maximum ejection time allowed.
-
ejectionPercentage
double ejectionPercentage()
How many percent of the addresses have been ejected.
-
-