java.lang.Object
org.apache.iotdb.confignode.manager.load.cache.region.RegionGroupCache

public class RegionGroupCache extends Object
RegionGroupCache caches the RegionHeartbeatSamples of all Regions in the same RegionGroup. Update and cache the current statistics of the RegionGroup based on the latest RegionHeartbeatSamples from all Regions it contains.
  • Constructor Details

    • RegionGroupCache

      public RegionGroupCache(String database, Set<Integer> dataNodeIds, boolean isStrongConsistency)
      Constructor for create RegionGroupCache with default RegionGroupStatistics.
  • Method Details

    • cacheHeartbeatSample

      public void cacheHeartbeatSample(int dataNodeId, RegionHeartbeatSample newHeartbeatSample, boolean overwrite)
      Cache the newest RegionHeartbeatSample.
      Parameters:
      dataNodeId - Where the specified Region resides
      newHeartbeatSample - The newest RegionHeartbeatSample
      overwrite - Able to overwrite Adding or Removing
    • cacheHeartbeatSample

      public void cacheHeartbeatSample(int dataNodeId, RegionHeartbeatSample newHeartbeatSample)
    • createRegionCache

      public void createRegionCache(int dataNodeId)
      Create the cache of the specified Region.
      Parameters:
      dataNodeId - the specified DataNode
    • removeRegionCache

      public void removeRegionCache(int dataNodeId)
      Remove the cache of the specified Region in the specified RegionGroup.
      Parameters:
      dataNodeId - the specified DataNode
    • updateCurrentStatistics

      public void updateCurrentStatistics()
      Update currentStatistics based on the latest NodeHeartbeatSamples that cached in the slidingWindow.
    • getCurrentStatistics

      public RegionGroupStatistics getCurrentStatistics()
    • getDatabase

      public String getDatabase()
    • getRegionLocations

      public Set<Integer> getRegionLocations()
    • getRegionCache

      public RegionCache getRegionCache(int nodeId)