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/07/04 14:45:11 UTC

[GitHub] [incubator-iotdb] jixuan1989 commented on a change in pull request #217: New Storage Engine

jixuan1989 commented on a change in pull request #217: New Storage Engine
URL: https://github.com/apache/incubator-iotdb/pull/217#discussion_r300429051
 
 

 ##########
 File path: iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java
 ##########
 @@ -104,30 +137,49 @@ public boolean isEmpty() {
   @Override
   public ReadOnlyMemChunk query(String deviceId, String measurement, TSDataType dataType,
       Map<String, String> props) {
-    return new ReadOnlyMemChunk(dataType, getSeriesData(deviceId, measurement, dataType), props);
+    TimeValuePairSorter sorter;
+    if (!checkPath(deviceId, measurement)) {
+      return null;
+    } else {
+      long undeletedTime = findUndeletedTime(deviceId, measurement);
+      IWritableMemChunk memChunk = memTableMap.get(deviceId).get(measurement);
+      IWritableMemChunk chunkCopy = new WritableMemChunk(dataType, memChunk.getTVList().clone());
+      chunkCopy.setTimeOffset(undeletedTime);
+      sorter = chunkCopy;
+    }
+    return new ReadOnlyMemChunk(dataType, sorter, props);
 
 Review comment:
   so  you copy a chunk twice? (chunkCopy and ReadOnlyMemChunk.getSorted...)

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