@Override
  protected Iterator<N> getChildrenIterator(N parent, Iterator<String> childrenName)
      throws Exception {

    return new IMNodeIterator<N>() {
      private N next = null;
      private boolean skipTemplateChildren = false;

      @Override
      public boolean hasNext() {
        if (next == null) {
          while (next == null && childrenName.hasNext()) {
            try {
              next = getChild(parent, childrenName.next(), skipTemplateChildren);
            } catch (Throwable e) {
              logger.warn(e.getMessage(), e);
              throw new RuntimeException(e);
            }
          }
        }
        return next != null;
      }

      @Override
      public N next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        N result = next;
        next = null;
        return result;
      }

      @Override
      public void skipTemplateChildren() {
        skipTemplateChildren = true;
      }

      @Override
      public void close() {
        if (next != null) {
          releaseNode(next);
          next = null;
        }
      }
    };
  }
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