You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/02/21 05:53:52 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #2677: [IOTDB-1135] count timeseries prefix path bug

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:
users@infra.apache.org