MarcosZyk commented on code in PR #8721:
URL: https://github.com/apache/iotdb/pull/8721#discussion_r1061057693


##########
node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java:
##########
@@ -189,17 +195,26 @@ protected void getNext() throws Exception {
         continue;
       }
 
-      node = iterator.next();
+      nextTempNode = iterator.next();
 
       if (currentStateMatchInfo.hasFinalState()) {
-        shouldVisitSubtree = processFullMatchedNode(node);
+        if (acceptNode(nextTempNode)) {
+          nextMatchedNode = nextTempNode;
+        }
+        shouldVisitSubtree = processFullMatchedNode(nextTempNode);
       } else {
-        shouldVisitSubtree = processInternalMatchedNode(node);
+        shouldVisitSubtree = processInternalMatchedNode(nextTempNode);

Review Comment:
   Maybe we should set up the following abstract interfaces:
   1. ```acceptInternalMatchedNode``` and ```acceptFullMatchedNode```
   2. ```shouldVisitSubtreeOfInternalMatchedNode``` and 
```shouldVisitSubtreeOfFullMatchedNode```



##########
node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java:
##########
@@ -274,11 +292,12 @@ protected final N getParentOfNextMatchedNode() {
   // Get an iterator of all children.
   protected abstract Iterator<N> getChildrenIterator(N parent) throws 
Exception;
 
-  // Release a child with the given childName.
-  protected void releaseChild(N child) {}
+  // Release a child node.
+  protected void releaseNode(N node) {}
 
-  // Release an iterator of all children.
-  protected void releaseChildrenIterator(Iterator<N> childrenIterator) {}
+  // Release an iterator. It is not necessary to deal with all the elements in 
the iterator.
+  // Only the elements that have been fetched but not returned by next() need 
to be released.
+  protected void releaseNodeIterator(Iterator<N> nodeIterator) {}

Review Comment:
   seems no invokation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to