This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f80172  Revert "[IOTDB-520] Result of IBatchReader should not cross 
partition" (#860)
6f80172 is described below

commit 6f80172730dad18a2338e047843b1e412ed2b272
Author: Zesong Sun <[email protected]>
AuthorDate: Sun Mar 1 10:49:56 2020 +0800

    Revert "[IOTDB-520] Result of IBatchReader should not cross partition" 
(#860)
    
    * Revert "[IOTDB-520] Result of IBatchReader should not cross partition 
(#845)"
---
 .../SystemDesign/5-DataQuery/2-SeriesReader.md     |  2 +-
 .../reader/universal/PriorityMergeReader.java      | 26 ++++------------------
 .../iotdb/db/integration/IoTDBSeriesReaderIT.java  |  2 +-
 3 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/docs/Documentation-CHN/SystemDesign/5-DataQuery/2-SeriesReader.md 
b/docs/Documentation-CHN/SystemDesign/5-DataQuery/2-SeriesReader.md
index 54b0f38..12b221b 100644
--- a/docs/Documentation-CHN/SystemDesign/5-DataQuery/2-SeriesReader.md
+++ b/docs/Documentation-CHN/SystemDesign/5-DataQuery/2-SeriesReader.md
@@ -411,4 +411,4 @@ return false;
 
 #### canUseCurrentPageStatistics()
 
-先调用`SeriesReader`的`currentPageStatistics()`方法,获得当前page的统计信息,再调用`SeriesReader`的`isPageOverlapped()`方法判断当前page是否重叠,如果当前page不重叠,且其统计信息满足过滤条件,则返回`true`,否则返回`false`。
\ No newline at end of file
+先调用`SeriesReader`的`currentPageStatistics()`方法,获得当前page的统计信息,再调用`SeriesReader`的`isPageOverlapped()`方法判断当前page是否重叠,如果当前page不重叠,且其统计信息满足过滤条件,则返回`true`,否则返回`false`。
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/reader/universal/PriorityMergeReader.java
 
b/server/src/main/java/org/apache/iotdb/db/query/reader/universal/PriorityMergeReader.java
index e67bd77..6901250 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/reader/universal/PriorityMergeReader.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/reader/universal/PriorityMergeReader.java
@@ -18,13 +18,12 @@
  */
 package org.apache.iotdb.db.query.reader.universal;
 
+import org.apache.iotdb.tsfile.read.reader.IPointReader;
+import org.apache.iotdb.tsfile.read.TimeValuePair;
+
 import java.io.IOException;
 import java.util.List;
 import java.util.PriorityQueue;
-import org.apache.iotdb.db.conf.IoTDBConfig;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.tsfile.read.TimeValuePair;
-import org.apache.iotdb.tsfile.read.reader.IPointReader;
 
 /**
  * This class implements {@link IPointReader} for data sources with different 
priorities.
@@ -34,8 +33,6 @@ public class PriorityMergeReader implements IPointReader {
   // largest end time of all added readers
   private long currentLargestEndTime;
 
-  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
-
   PriorityQueue<Element> heap = new PriorityQueue<>((o1, o2) -> {
     int timeCompare = Long.compare(o1.timeValuePair.getTimestamp(),
         o2.timeValuePair.getTimestamp());
@@ -61,24 +58,9 @@ public class PriorityMergeReader implements IPointReader {
   }
 
   public void addReader(IPointReader reader, long priority, long endTime) 
throws IOException {
-    long partitionInterval = config.getPartitionInterval();
-    switch (config.getTimestampPrecision()) {
-      case "ns":
-        partitionInterval *= 1000_000_000L;
-        break;
-      case "us":
-        partitionInterval *= 1000_000L;
-        break;
-      default:
-        partitionInterval *= 1000;
-        break;
-    }
     if (reader.hasNextTimeValuePair()) {
       heap.add(new Element(reader, reader.nextTimeValuePair(), priority));
-      long partition = reader.currentTimeValuePair().getTimestamp() / 
partitionInterval;
-      // set end time before current partition ends
-      currentLargestEndTime = Math.min((partition + 1) * partitionInterval - 1,
-          Math.max(currentLargestEndTime, endTime));
+      currentLargestEndTime = Math.max(currentLargestEndTime, endTime);
     } else {
       reader.close();
     }
diff --git 
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java 
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
index a90de85..9d16ee0 100644
--- 
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
+++ 
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
@@ -79,7 +79,7 @@ public class IoTDBSeriesReaderIT {
     tsFileConfig.setPageSizeInByte(1024 * 1024 * 150);
     tsFileConfig.setGroupSizeInByte(1024 * 1024 * 150);
     IoTDBDescriptor.getInstance().getConfig().setMemtableSizeThreshold(1024 * 
16);
-
+    
     // test result of IBatchReader should not cross partition
     IoTDBDescriptor.getInstance().getConfig().setPartitionInterval(2);
 

Reply via email to