public Map<TConsensusGroupId, Set<Integer>> getCurrentRegionLocationMap(
      TConsensusGroupType type) {
    Map<TConsensusGroupId, Set<Integer>> regionGroupIdsMap = new TreeMap<>();
    regionGroupCacheMap.forEach(
        (regionGroupId, regionGroupCache) -> {
          if (type.equals(regionGroupId.getType())) {
            regionGroupIdsMap.put(regionGroupId, regionGroupCache.getRegionLocations());
          }
        });
    return regionGroupIdsMap;
  }
Get a map of cached RegionGroups

@param type SchemaRegion or DataRegion
@return Map<RegionGroupId, Set<DataNodeId>>
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java