public void preDeleteTable(
      final PartialPath database, final String tableName, final boolean isView)
      throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(database).getAsMNode();
    if (!databaseNode.hasChild(tableName)) {
      throw new TableNotExistsException(
          database.getFullPath().substring(ROOT.length() + 1), tableName);
    }
    final ConfigTableNode tableNode = (ConfigTableNode) databaseNode.getChild(tableName);
    final Optional<Pair<TSStatus, TsTable>> check =
        ClusterSchemaManager.checkTable4View(
            database.getTailNode(),
            ((ConfigTableNode) databaseNode.getChild(tableName)).getTable(),
            isView);
    if (check.isPresent()) {
      throw new SemanticException(
          check.get().getLeft().getMessage(), check.get().getLeft().getCode());
    }
    if (tableNode.getStatus().equals(TableNodeStatus.PRE_CREATE)) {
      throw new IllegalStateException();
    }
    tableNode.setStatus(TableNodeStatus.PRE_DELETE);
  }
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