You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2019/03/08 06:20:24 UTC

[incubator-iotdb] branch value_filter_query_optimization updated: fix some comment

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

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


The following commit(s) were added to refs/heads/value_filter_query_optimization by this push:
     new a447205  fix some comment
a447205 is described below

commit a447205ac0bd6a758c1a3062f9386934dd7f1a61
Author: CGF <cg...@foxmail.com>
AuthorDate: Fri Mar 8 14:20:10 2019 +0800

    fix some comment
---
 .../db/query/dataset/EngineDataSetWithTimeGenerator.java    |  1 +
 .../db/query/reader/mem/MemChunkReaderByTimestamp.java      | 13 +++++++------
 .../db/query/reader/mem/MemChunkReaderWithoutFilter.java    |  4 +++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
index a658eb0..e820d79 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
@@ -35,6 +35,7 @@ public class EngineDataSetWithTimeGenerator extends QueryDataSet {
 
   private EngineTimeGenerator timeGenerator;
   private List<EngineReaderByTimeStamp> readers;
+  //TODO add null filed
 
   /**
    * constructor of EngineDataSetWithTimeGenerator.
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
index 2770b32..82c4dcf 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
@@ -66,15 +66,16 @@ public class MemChunkReaderByTimestamp implements EngineReaderByTimeStamp, IRead
   }
 
   // TODO consider change timeValuePairIterator to List structure, and use binary search instead of
-  // sequential search
-  @Override
-  public Object getValueInTimestamp(long timestamp) throws IOException {
+  /**
+   * sequential search
+   */
+  @Override public Object getValueInTimestamp(long timestamp) throws IOException {
     while (hasNext()) {
       TimeValuePair timeValuePair = next();
-      long time = timeValuePair.getTimestamp();
-      if (time == timestamp) {
+      long currentMemTime = timeValuePair.getTimestamp();
+      if (currentMemTime == timestamp) {
         return timeValuePair.getValue().getValue();
-      } else if (time > timestamp) {
+      } else if (currentMemTime > timestamp) {
         hasCachedTimeValuePair = true;
         cachedTimeValuePair = timeValuePair;
         break;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
index bae7496..a232603 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
@@ -24,7 +24,9 @@ import org.apache.iotdb.db.query.reader.IReader;
 import org.apache.iotdb.db.utils.TimeValuePair;
 import org.apache.iotdb.tsfile.read.common.BatchData;
 
-// TODO merge MemChunkReaderWithoutFilter and MemChunkReaderWithFilter to one class
+/**
+ * TODO merge MemChunkReaderWithoutFilter and MemChunkReaderWithFilter to one class
+ */
 public class MemChunkReaderWithoutFilter implements IReader {
 
   private Iterator<TimeValuePair> timeValuePairIterator;