public PathInfoResp getPathsSetTemplate(final GetPathsSetTemplatePlan getPathsSetTemplatePlan) {
    final PathInfoResp pathInfoResp = new PathInfoResp();
    TSStatus status;
    try {
      final String templateName = getPathsSetTemplatePlan.getName();
      final PathPatternTree scope = getPathsSetTemplatePlan.getScope();
      final int templateId;
      if (templateName.equals(ONE_LEVEL_PATH_WILDCARD)) {
        templateId = ALL_TEMPLATE;
      } else {
        templateId = templateTable.getTemplate(templateName).getId();
      }
      pathInfoResp.setPathList(treeModelMTree.getPathsSetOnTemplate(templateId, scope, false));
      status = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
    } catch (MetadataException e) {
      status = RpcUtils.getStatus(e.getErrorCode(), e.getMessage());
    }
    pathInfoResp.setStatus(status);
    return pathInfoResp;
  }
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