private void checkTemplateOnSubtree(final IConfigMNode node) throws MetadataException {
    IConfigMNode child;
    IMNodeIterator<IConfigMNode> iterator = store.getChildrenIterator(node);
    while (iterator.hasNext()) {
      child = iterator.next();

      // Skip table model databases
      if (child.isDatabase() && child.getDatabaseSchema().isIsTableModel()) {
        continue;
      }
      if (child.getSchemaTemplateId() != NON_TEMPLATE) {
        throw new MetadataException("Template already exists on " + child.getFullPath());
      }
      checkTemplateOnSubtree(child);
    }
  }
check whether there is template on given path and the subTree has template return true,
otherwise false
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java