类 RegionGroupCache
- java.lang.Object
-
- org.apache.iotdb.confignode.manager.partition.heartbeat.RegionGroupCache
-
public class RegionGroupCache extends java.lang.Object
-
-
字段概要
字段 修饰符和类型 字段 说明 protected RegionGroupStatisticspreviousStatistics
-
构造器概要
构造器 构造器 说明 RegionGroupCache(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId consensusGroupId)Constructor for create RegionGroupCache with default RegionGroupStatistics
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcacheHeartbeatSample(int dataNodeId, RegionHeartbeatSample newHeartbeatSample)Cache the newest RegionHeartbeatSamplevoidforceUpdate(java.util.Map<java.lang.Integer,RegionHeartbeatSample> newHeartbeatSamples)Actively append custom NodeHeartbeatSamples to force a change in the RegionGroupStatistics.RegionGroupStatisticsgetStatistics()booleanperiodicUpdate()Invoking periodically in the Cluster-LoadStatistics-Service to update currentStatistics and compare with the previousStatistics, in order to detect whether the RegionGroup's statistics has changedvoidremoveCacheIfExists(int dataNodeId)protected voidupdateCurrentStatistics()Update currentStatistics based on recent NodeHeartbeatSamples that cached in the slidingWindow
-
-
-
字段详细资料
-
previousStatistics
protected volatile RegionGroupStatistics previousStatistics
-
-
方法详细资料
-
cacheHeartbeatSample
public void cacheHeartbeatSample(int dataNodeId, RegionHeartbeatSample newHeartbeatSample)Cache the newest RegionHeartbeatSample- 参数:
dataNodeId- Where the specified Region residesnewHeartbeatSample- The newest RegionHeartbeatSample
-
periodicUpdate
public boolean periodicUpdate()
Invoking periodically in the Cluster-LoadStatistics-Service to update currentStatistics and compare with the previousStatistics, in order to detect whether the RegionGroup's statistics has changed- 返回:
- True if the currentStatistics has changed recently(compare with the previousStatistics), false otherwise
-
forceUpdate
public void forceUpdate(java.util.Map<java.lang.Integer,RegionHeartbeatSample> newHeartbeatSamples)
Actively append custom NodeHeartbeatSamples to force a change in the RegionGroupStatistics.For example, this interface can be invoked in RegionGroup creating process to forcibly activate the corresponding RegionGroup's status to Available without waiting for heartbeat sampling
Notice: The ConfigNode-leader doesn't know the specified RegionGroup's statistics has changed even if this interface is invoked, since the ConfigNode-leader only detect cluster RegionGroups' statistics by periodicUpdate interface. However, other service can still read the update of currentStatistics by invoking getters below.
- 参数:
newHeartbeatSamples- Custom RegionHeartbeatSamples that will lead to needed RegionGroupStatistics
-
updateCurrentStatistics
protected void updateCurrentStatistics()
Update currentStatistics based on recent NodeHeartbeatSamples that cached in the slidingWindow
-
removeCacheIfExists
public void removeCacheIfExists(int dataNodeId)
-
getStatistics
public RegionGroupStatistics getStatistics()
-
-