You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2019/12/09 07:48:26 UTC

[incubator-iotdb] branch f_batch_reader updated: add batch in dataset

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

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


The following commit(s) were added to refs/heads/f_batch_reader by this push:
     new 6cc93e2  add batch in dataset
6cc93e2 is described below

commit 6cc93e2665e1b3ad0311287736b8abe395c8141e
Author: qiaojialin <64...@qq.com>
AuthorDate: Mon Dec 9 15:48:06 2019 +0800

    add batch in dataset
---
 .../dataset/EngineDataSetWithoutValueFilter.java   | 39 +++++++++++++++++++---
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutValueFilter.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutValueFilter.java
index 2088e7a..364f229 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutValueFilter.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutValueFilter.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.query.dataset;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.List;
 import java.util.TreeSet;
 import org.apache.iotdb.db.query.reader.IPointReader;
@@ -27,22 +28,39 @@ import org.apache.iotdb.db.utils.TimeValuePair;
 import org.apache.iotdb.db.utils.TsPrimitiveType;
 import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
 import org.apache.iotdb.tsfile.read.common.Field;
 import org.apache.iotdb.tsfile.read.common.Path;
 import org.apache.iotdb.tsfile.read.common.RowRecord;
 import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.read.reader.IBatchReader;
 
 /**
  * TODO implement this class as TsFile DataSetWithoutTimeGenerator.
  */
 public class EngineDataSetWithoutValueFilter extends QueryDataSet {
 
-  private List<IPointReader> seriesReaderWithoutValueFilterList;
+  private List<IBatchReader> seriesReaderWithoutValueFilterList;
 
   private TimeValuePair[] cacheTimeValueList;
 
   private TreeSet<Long> timeHeap;
 
+
+  private List<List<BatchData>> batchDataInFilter;
+
+  private ByteBuffer timeBuffer;
+
+  /**
+   * each buffer contains values of one time series
+   */
+  private List<ByteBuffer> valueBuffers;
+
+  /**
+   * indicate whether the points in value buffer are null
+   */
+  private List<ByteBuffer> bitmapBuffer;
+
   /**
    * constructor of EngineDataSetWithoutValueFilter.
    *
@@ -52,7 +70,7 @@ public class EngineDataSetWithoutValueFilter extends QueryDataSet {
    * @throws IOException IOException
    */
   public EngineDataSetWithoutValueFilter(List<Path> paths, List<TSDataType> dataTypes,
-      List<IPointReader> readers)
+      List<IBatchReader> readers)
       throws IOException {
     super(paths, dataTypes);
     this.seriesReaderWithoutValueFilterList = readers;
@@ -64,7 +82,7 @@ public class EngineDataSetWithoutValueFilter extends QueryDataSet {
     cacheTimeValueList = new TimeValuePair[seriesReaderWithoutValueFilterList.size()];
 
     for (int i = 0; i < seriesReaderWithoutValueFilterList.size(); i++) {
-      IPointReader reader = seriesReaderWithoutValueFilterList.get(i);
+      IBatchReader reader = seriesReaderWithoutValueFilterList.get(i);
       if (reader.hasNext()) {
         TimeValuePair timeValuePair = reader.next();
         cacheTimeValueList[i] = timeValuePair;
@@ -73,6 +91,19 @@ public class EngineDataSetWithoutValueFilter extends QueryDataSet {
     }
   }
 
+
+  /**
+   *
+   * Yuan Tian !!!
+   *
+   * fill time buffer, value buffers and bitmap buffers
+   *
+   * @param batchReaders readers of each time series
+   */
+  private void fillBuffer(List<IBatchReader> batchReaders) {
+
+  }
+
   @Override
   protected boolean hasNextWithoutConstraint() {
     return !timeHeap.isEmpty();
@@ -85,7 +116,7 @@ public class EngineDataSetWithoutValueFilter extends QueryDataSet {
     RowRecord record = new RowRecord(minTime);
 
     for (int i = 0; i < seriesReaderWithoutValueFilterList.size(); i++) {
-      IPointReader reader = seriesReaderWithoutValueFilterList.get(i);
+      IBatchReader reader = seriesReaderWithoutValueFilterList.get(i);
       if (cacheTimeValueList[i] == null) {
         record.addField(new Field(null));
       } else {