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/01/19 02:58:45 UTC
[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request
#753: Add iterators to TVList to prevent data copy
qiaojialin commented on a change in pull request #753: Add iterators to TVList to prevent data copy
URL: https://github.com/apache/incubator-iotdb/pull/753#discussion_r368261745
##########
File path: server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java
##########
@@ -195,19 +199,19 @@ public boolean isEmpty() {
}
@Override
- public ReadOnlyMemChunk query(String deviceId, String measurement, TSDataType dataType,
+ public TVList query(String deviceId, String measurement, TSDataType dataType,
Map<String, String> props, long timeLowerBound) {
- TimeValuePairSorter sorter;
if (!checkPath(deviceId, measurement)) {
return null;
- } else {
- long undeletedTime = findUndeletedTime(deviceId, measurement, timeLowerBound);
- IWritableMemChunk memChunk = memTableMap.get(deviceId).get(measurement);
- IWritableMemChunk chunkCopy = new WritableMemChunk(dataType, memChunk.getTVList().clone());
- chunkCopy.setTimeOffset(undeletedTime);
- sorter = chunkCopy;
}
- return new ReadOnlyMemChunk(measurement, dataType, sorter, props);
+ long undeletedTime = findUndeletedTime(deviceId, measurement, timeLowerBound);
+ IWritableMemChunk memChunk = memTableMap.get(deviceId).get(measurement);
+ TVList chunkCopy = memChunk.getTVList().clone();
+
+ chunkCopy.setVersion(getVersion());
Review comment:
put this to clone method of TVList
----------------------------------------------------------------
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