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 2020/06/10 10:53:17 UTC

[GitHub] [incubator-iotdb] Alima777 commented on a change in pull request #1341: [ISSUE-1281] Show timeseries with heat sort

Alima777 commented on a change in pull request #1341:
URL: https://github.com/apache/incubator-iotdb/pull/1341#discussion_r438019587



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -798,6 +800,18 @@ public int getNodesCountInGivenLevel(String prefixPath, int level) throws Metada
           }
         }
       }
+
+      // if ordered by heat, we sort all the timeseries by the descending order of the last insert timestamp
+      if (plan.isOrderByHeat()) {
+        allMatchedNodes = allMatchedNodes.stream().sorted(
+            Comparator.comparingLong(MTree::getLastTimeStamp).reversed()
+                .thenComparing(MNode::getFullPath)).collect(toList());

Review comment:
       @qiaojialin Hi, in my opinion, order by path is better than disorder relatively.

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
##########
@@ -624,6 +631,34 @@ private int getCountInGivenLevel(MNode node, int targetLevel) {
     return cnt;
   }
 
+  /**
+   * Get all time series schema under the given path order by insert frequency
+   *
+   * <p>result: [name, alias, storage group, dataType, encoding, compression, offset]

Review comment:
       Hi, you forgot the lastTimestamp column here~




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