You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/11/08 07:54:21 UTC

[iotdb] branch new_vector updated: [IOTDB-1672] Separate AlignedInsertPlan from current InsertPlan (#4333)

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

haonan pushed a commit to branch new_vector
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/new_vector by this push:
     new 75f3f54  [IOTDB-1672] Separate AlignedInsertPlan from current InsertPlan (#4333)
75f3f54 is described below

commit 75f3f545ad73eed0b522642e66999729442be386
Author: SilverNarcissus <15...@smail.nju.edu.cn>
AuthorDate: Mon Nov 8 15:53:53 2021 +0800

    [IOTDB-1672] Separate AlignedInsertPlan from current InsertPlan (#4333)
---
 .../apache/iotdb/tsfile/write/record/Tablet.java   | 51 +++-------------------
 1 file changed, 7 insertions(+), 44 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
index 0a621ee..f36f55d 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
@@ -23,8 +23,6 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.utils.Binary;
 import org.apache.iotdb.tsfile.utils.BitMap;
 import org.apache.iotdb.tsfile.write.schema.IMeasurementSchema;
-import org.apache.iotdb.tsfile.write.schema.UnaryMeasurementSchema;
-import org.apache.iotdb.tsfile.write.schema.VectorMeasurementSchema;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -127,13 +125,7 @@ public class Tablet {
   public void addValue(String measurementId, int rowIndex, Object value) {
     int indexOfSchema = measurementIndex.get(measurementId);
     IMeasurementSchema measurementSchema = schemas.get(indexOfSchema);
-    if (measurementSchema.getType().equals(TSDataType.VECTOR)) {
-      int indexInVector = measurementSchema.getSubMeasurementIndex(measurementId);
-      TSDataType dataType = measurementSchema.getSubMeasurementsTSDataTypeList().get(indexInVector);
-      addValueOfDataType(dataType, rowIndex, indexInVector, value);
-    } else {
-      addValueOfDataType(measurementSchema.getType(), rowIndex, indexOfSchema, value);
-    }
+    addValueOfDataType(measurementSchema.getType(), rowIndex, indexOfSchema, value);
   }
 
   private void addValueOfDataType(
@@ -218,38 +210,18 @@ public class Tablet {
     timestamps = new long[maxRowNumber];
 
     // calculate total value column size
-    int valueColumnsSize = 0;
-    for (IMeasurementSchema schema : schemas) {
-      if (schema instanceof VectorMeasurementSchema) {
-        valueColumnsSize += schema.getSubMeasurementsList().size();
-      } else {
-        valueColumnsSize++;
-      }
-    }
+    int valueColumnsSize = schemas.size();
 
     // value column
     values = new Object[valueColumnsSize];
     int columnIndex = 0;
     for (IMeasurementSchema schema : schemas) {
       TSDataType dataType = schema.getType();
-      if (dataType.equals(TSDataType.VECTOR)) {
-        columnIndex = buildVectorColumns((VectorMeasurementSchema) schema, columnIndex);
-      } else {
-        values[columnIndex] = createValueColumnOfDataType(dataType);
-        columnIndex++;
-      }
+      values[columnIndex] = createValueColumnOfDataType(dataType);
+      columnIndex++;
     }
   }
 
-  private int buildVectorColumns(VectorMeasurementSchema schema, int idx) {
-    for (int i = 0; i < schema.getSubMeasurementsList().size(); i++) {
-      TSDataType dataType = schema.getSubMeasurementsTSDataTypeList().get(i);
-      values[idx] = createValueColumnOfDataType(dataType);
-      idx++;
-    }
-    return idx;
-  }
-
   private Object createValueColumnOfDataType(TSDataType dataType) {
 
     Object valueColumn;
@@ -286,18 +258,9 @@ public class Tablet {
   public int getTotalValueOccupation() {
     int valueOccupation = 0;
     int columnIndex = 0;
-    for (int i = 0; i < schemas.size(); i++) {
-      IMeasurementSchema schema = schemas.get(i);
-      if (schema instanceof UnaryMeasurementSchema) {
-        valueOccupation += calOccupationOfOneColumn(schema.getType(), columnIndex);
-        columnIndex++;
-      } else {
-        for (int j = 0; j < schema.getSubMeasurementsTSDataTypeList().size(); j++) {
-          TSDataType dataType = schema.getSubMeasurementsTSDataTypeList().get(j);
-          valueOccupation += calOccupationOfOneColumn(dataType, columnIndex);
-          columnIndex++;
-        }
-      }
+    for (IMeasurementSchema schema : schemas) {
+      valueOccupation += calOccupationOfOneColumn(schema.getType(), columnIndex);
+      columnIndex++;
     }
     // add bitmap size if the tablet has bitMaps
     if (bitMaps != null) {