public List<TConsensusGroupId> getAllRegionGroupIds(TConsensusGroupType type) {
    return regionGroupMap.keySet().stream()
        .filter(regionGroupId -> regionGroupId.getType().equals(type))
        .collect(Collectors.toList());
  }
Only leader use this interface.

<p>Get all the RegionGroups currently owned by the specified Database

@param type SchemaRegion or DataRegion
@return List of TConsensusGroupId
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/DatabasePartitionTable.java