Class AbstractLoadCache
java.lang.Object
org.apache.iotdb.confignode.manager.load.cache.AbstractLoadCache
- Direct Known Subclasses:
BaseNodeCache,ConsensusGroupCache,RegionCache
AbstractLoadCache caches the recent MAXIMUM_WINDOW_SIZE heartbeat samples and calculates the
current statistics based on the latest heartbeat mple.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicReference<AbstractStatistics>protected final IFailureDetectorprotected final List<AbstractHeartbeatSample> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheHeartbeatSample(AbstractHeartbeatSample newHeartbeatSample) Cache the latest heartbeat sample.Get the latest heartbeat sample that cached in the slidingWindow.abstract voidupdateCurrentStatistics(boolean forceUpdate) Update currentStatistics based on the latest heartbeat sample that cached in the slidingWindow.
-
Field Details
-
slidingWindow
-
currentStatistics
-
failureDetector
-
-
Constructor Details
-
AbstractLoadCache
protected AbstractLoadCache()
-
-
Method Details
-
cacheHeartbeatSample
Cache the latest heartbeat sample.- Parameters:
newHeartbeatSample- The latest heartbeat sample.
-
getLastSample
Get the latest heartbeat sample that cached in the slidingWindow.- Returns:
- The latest heartbeat sample.
-
updateCurrentStatistics
public abstract void updateCurrentStatistics(boolean forceUpdate) Update currentStatistics based on the latest heartbeat sample that cached in the slidingWindow. -
getCurrentStatistics
-