private N getChild(N parent, String childName, boolean skipTemplateChildren)
      throws MetadataException {
    N child = null;
    if (parent.isAboveDatabase()) {
      child = parent.getChild(childName);
    } else {
      if (templateMap != null
          && !skipTemplateChildren
          && !templateMap.isEmpty() // This task will cover some timeseries represented by template
          && (parent.isDevice()
              && parent.getAsDeviceMNode().getSchemaTemplateId()
                  != NON_TEMPLATE) // The device is using template
          && !(skipPreDeletedSchema
              && parent
                  .getAsDeviceMNode()
                  .isPreDeactivateSelfOrTemplate())) { // the template should not skip
        int templateId = parent.getAsDeviceMNode().getSchemaTemplateId();
        Template template = templateMap.get(templateId);
        // If null, it means the template on this device is not covered in this query, refer to the
        // mpp analyzing stage
        if (template != null && nodeFactory != null) {
          child = MNodeUtils.getChild(templateMap.get(templateId), childName, nodeFactory);
        }
      }
    }
    if (child == null) {
      child = store.getChild(parent, childName);
      if (Objects.nonNull(child)
          && skipPreDeletedSchema
          && child.isMeasurement()
          && child.getAsMeasurementMNode().isPreDeleted()) {
        child = null;
      }
    }
    return child;
  }
The interface to start the traversal. The node process should be defined before traversal by
overriding or implement concerned methods.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/traverser/Traverser.java