public int getRegionGroupCount(final String database, final TConsensusGroupType type)
      throws DatabaseNotExistsException {
    if (!isDatabaseExisted(database)) {
      throw new DatabaseNotExistsException(database);
    }

    return databasePartitionTables.get(database).getRegionGroupCount(type);
  }
Only leader use this interface.

<p>Get the number of RegionGroups currently owned by the specified Database

@param database DatabaseName
@param type SchemaRegion or DataRegion
@return Number of Regions currently owned by the specific database
@throws DatabaseNotExistsException When the specific database doesn't exist
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java