public Map<String, List<TConsensusGroupId>> getAllRegionGroupIdMap(TConsensusGroupType type) {
    Map<String, List<TConsensusGroupId>> result = new TreeMap<>();
    databasePartitionTables.forEach(
        (database, databasePartitionTable) -> {
          if (databasePartitionTable.isNotPreDeleted()) {
            result.put(database, databasePartitionTable.getAllRegionGroupIds(type));
          }
        });
    return result;
  }
Only leader use this interface.

<p>Get the all RegionGroups currently in the cluster

@param type SchemaRegion or DataRegion
@return Map<Database, List<RegionGroupIds>>
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java