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 2019/09/30 09:42:00 UTC

[GitHub] [incubator-iotdb] jack870131 commented on a change in pull request #435: [IOTDB-174] Fix querying timeseries bug

jack870131 commented on a change in pull request #435: [IOTDB-174] Fix querying timeseries bug
URL: https://github.com/apache/incubator-iotdb/pull/435#discussion_r329491372
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
 ##########
 @@ -783,19 +783,23 @@ private void findStorageGroup(MNode node, String path, HashSet<String> res) {
    * @return a list contains all distinct devices
    */
   Set<String> getAllDevices() {
-    return new HashSet<>(getNodesList(3));
+    return new HashSet<>(getNodesList("root",2));
   }
 
   /**
    * Get all nodes at the given level in current Metadata Tree.
    *
    * @return a list contains all nodes at the given level
    */
-  List<String> getNodesList(int nodeLevel) {
+  List<String> getNodesList(String schemaPattern, int nodeLevel) {
     List<String> res = new ArrayList<>();
-    MNode rootNode;
-    if ((rootNode = getRoot()) != null) {
-      findNodes(rootNode, "root", res, nodeLevel);
+    String[] nodes = schemaPattern.split("\\.");
+    MNode node;
+    if ((node = getRoot()) != null) {
+      for (int i = 1; i < nodes.length; i++) {
+        node = node.getChild(nodes[i]);
 
 Review comment:
   @jt2594838 This used to simply return null to users. How about adding the SQLException to remind users? Or remain the same?

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


With regards,
Apache Git Services