public List<Pair<TsTable, TableNodeStatus>> getAllTablesUnderSpecificDatabase(
      final PartialPath databasePath) throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(databasePath).getAsMNode();
    return databaseNode.getChildren().values().stream()
        .filter(ConfigTableNode.class::isInstance)
        .map(
            child ->
                new Pair<>(
                    ((ConfigTableNode) child).getTable(), ((ConfigTableNode) child).getStatus()))
        .collect(Collectors.toList());
  }
This method returns the templateId set on paths if the path set matches or is a prefix of input
path pattern.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java