类 RegionGroupCache


  • public class RegionGroupCache
    extends java.lang.Object
    • 构造器概要

      构造器 
      构造器 说明
      RegionGroupCache​(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId consensusGroupId)
      Constructor for create RegionGroupCache with default RegionGroupStatistics
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void cacheHeartbeatSample​(int dataNodeId, RegionHeartbeatSample newHeartbeatSample)
      Cache the newest RegionHeartbeatSample
      void forceUpdate​(java.util.Map<java.lang.Integer,​RegionHeartbeatSample> newHeartbeatSamples)
      Actively append custom NodeHeartbeatSamples to force a change in the RegionGroupStatistics.
      RegionGroupStatistics getStatistics()  
      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
      void removeCacheIfExists​(int dataNodeId)  
      protected void updateCurrentStatistics()
      Update currentStatistics based on recent NodeHeartbeatSamples that cached in the slidingWindow
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • RegionGroupCache

        public RegionGroupCache​(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId consensusGroupId)
        Constructor for create RegionGroupCache with default RegionGroupStatistics
    • 方法详细资料

      • cacheHeartbeatSample

        public void cacheHeartbeatSample​(int dataNodeId,
                                         RegionHeartbeatSample newHeartbeatSample)
        Cache the newest RegionHeartbeatSample
        参数:
        dataNodeId - Where the specified Region resides
        newHeartbeatSample - 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)