public void preCreateTable(final PartialPath database, final TsTable table)
      throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(database).getAsMNode();
    final IConfigMNode node = databaseNode.getChild(table.getTableName());
    if (node == null) {
      final ConfigTableNode tableNode =
          (ConfigTableNode)
              databaseNode.addChild(
                  table.getTableName(), new ConfigTableNode(databaseNode, table.getTableName()));
      tableNode.setTable(table);
      tableNode.setStatus(TableNodeStatus.PRE_CREATE);
    } else if (node instanceof ConfigTableNode) {
      throw new TableAlreadyExistsException(
          database.getFullPath().substring(ROOT.length() + 1), table.getTableName());
    } else {
      throw new PathAlreadyExistException(database.concatNode(table.getTableName()).getFullPath());
    }
  }
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