public List<TsTable> getAllUsingTablesUnderSpecificDatabase(final PartialPath databasePath)
      throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(databasePath).getAsMNode();
    return databaseNode.getChildren().values().stream()
        .filter(
            child ->
                child instanceof ConfigTableNode
                    && ((ConfigTableNode) child).getStatus().equals(TableNodeStatus.USING))
        .map(child -> ((ConfigTableNode) child).getTable())
        .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