private RegionGroupStatus caculateRegionGroupStatus(
      Map<Integer, RegionStatistics> regionStatisticsMap) {

    int runningCount = 0;
    int addingCount = 0;
    int removingCount = 0;
    for (RegionStatistics regionStatistics : regionStatisticsMap.values()) {
      runningCount += RegionStatus.Running.equals(regionStatistics.getRegionStatus()) ? 1 : 0;
      addingCount += RegionStatus.Adding.equals(regionStatistics.getRegionStatus()) ? 1 : 0;
      removingCount += RegionStatus.Removing.equals(regionStatistics.getRegionStatus()) ? 1 : 0;
    }
    int baseCount = regionCacheMap.size() - addingCount - removingCount;

    if (runningCount == baseCount) {
      // The RegionGroup is considered as Running only if all Regions are in the Running status.
      return RegionGroupStatus.Running;
    }
    if (isStrongConsistency) {
      // For strong consistency algorithms, the RegionGroup is considered as Available when the
      // number of Regions in the Running status is greater than half.
      return runningCount > (baseCount / 2)
          ? RegionGroupStatus.Available
          : RegionGroupStatus.Disabled;
    } else {
      // For weak consistency algorithms, the RegionGroup is considered as Available when the number
      // of Regions in the Running status is greater than or equal to 1.
      return (runningCount >= 1) ? RegionGroupStatus.Available : RegionGroupStatus.Disabled;
    }
  }
Update currentStatistics based on the latest NodeHeartbeatSamples that cached in the
slidingWindow.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java