@Override
  public boolean processTakeSnapshot(final File snapshotDir) throws IOException {
    return processDatabaseSchemaSnapshot(
            snapshotDir, TREE_SNAPSHOT_FILENAME, treeModelMTree::serialize)
        && processDatabaseSchemaSnapshot(
            snapshotDir, TABLE_SNAPSHOT_FILENAME, tableModelMTree::serialize)
        && templateTable.processTakeSnapshot(snapshotDir)
        && templatePreSetTable.processTakeSnapshot(snapshotDir);
  }
Only leader use this interface. Get the maxRegionGroupNum of specified Database.

@param database DatabaseName
@param consensusGroupType SchemaRegion or DataRegion
@return maxSchemaRegionGroupNum or maxDataRegionGroupNum
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java