@Override
  public boolean hasNext() {
    if (throwable == null && nextMatchedNode == null) {
      try {
        getNext();
      } catch (Throwable e) {
        logger.warn(e.getMessage(), e);
        setFailure(e);
      }
    }
    return throwable == null && nextMatchedNode != null;
  }
This method must be invoked before iteration
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java