jixuan1989 commented on a change in pull request #2677:
URL: https://github.com/apache/iotdb/pull/2677#discussion_r579755728



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
##########
@@ -856,11 +858,46 @@ int getAllTimeseriesCount(PartialPath prefixPath) throws 
MetadataException {
     if (nodes.length == 0 || !nodes[0].equals(root.getName())) {
       throw new IllegalPathException(prefixPath.getFullPath());
     }
+    Holder<Integer> countHolder = new Holder<>(0);
     try {
-      return getCount(root, nodes, 1);
+      getCount(root, nodes, 1, countHolder, false);
     } catch (PathNotExistException e) {
       throw new PathNotExistException(prefixPath.getFullPath());
     }
+    return countHolder.getValue();
+  }
+
+  /** Traverse the MTree to get the count of timeseries. */
+  private void getCount(
+      MNode node, String[] nodes, int idx, Holder<Integer> countHolder, 
boolean wildcard)

Review comment:
       Holder can be avoided just define the function as `private int getCount`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to