public Optional<Pair<TsTable, TableNodeStatus>> getTableAndStatusIfExists(
      final PartialPath database, final String tableName) throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(database).getAsMNode();
    if (!databaseNode.hasChild(tableName)) {
      return Optional.empty();
    }
    final ConfigTableNode tableNode = (ConfigTableNode) databaseNode.getChild(tableName);
    return Optional.of(new Pair<>(tableNode.getTable(), tableNode.getStatus()));
  }
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