samperson1997 commented on a change in pull request #2992:
URL: https://github.com/apache/iotdb/pull/2992#discussion_r612523076



##########
File path: 
example/session/src/main/java/org/apache/iotdb/VectorSessionExample.java
##########
@@ -215,18 +215,42 @@ private static void insertTabletWithAlignedTimeseries()
 
     Tablet tablet = new Tablet(ROOT_SG1_D1, schemaList);
 
+    // Method 1 to add tablet data
+    long timestamp = System.currentTimeMillis();
+
+    for (long row = 0; row < 100; row++) {
+      int rowIndex = tablet.rowSize++;
+      tablet.addTimestamp(rowIndex, timestamp);
+      tablet.addValue(
+          schemaList.get(0).getValueMeasurementIdList().get(0), rowIndex, new 
Random().nextLong());
+      tablet.addValue(
+          schemaList.get(0).getValueMeasurementIdList().get(1), rowIndex, new 
Random().nextInt());
+
+      if (tablet.rowSize == tablet.getMaxRowNumber()) {
+        session.insertTablet(tablet, true);
+        tablet.reset();
+      }
+      timestamp++;
+    }
+
+    if (tablet.rowSize != 0) {
+      session.insertTablet(tablet);
+      tablet.reset();
+    }
+
+    // Method 2 to add tablet data

Review comment:
       Splitted

##########
File path: 
example/session/src/main/java/org/apache/iotdb/VectorSessionExample.java
##########
@@ -215,18 +215,42 @@ private static void insertTabletWithAlignedTimeseries()
 
     Tablet tablet = new Tablet(ROOT_SG1_D1, schemaList);
 
+    // Method 1 to add tablet data
+    long timestamp = System.currentTimeMillis();
+
+    for (long row = 0; row < 100; row++) {
+      int rowIndex = tablet.rowSize++;
+      tablet.addTimestamp(rowIndex, timestamp);
+      tablet.addValue(
+          schemaList.get(0).getValueMeasurementIdList().get(0), rowIndex, new 
Random().nextLong());
+      tablet.addValue(
+          schemaList.get(0).getValueMeasurementIdList().get(1), rowIndex, new 
Random().nextInt());
+
+      if (tablet.rowSize == tablet.getMaxRowNumber()) {
+        session.insertTablet(tablet, true);
+        tablet.reset();
+      }
+      timestamp++;
+    }
+
+    if (tablet.rowSize != 0) {
+      session.insertTablet(tablet);
+      tablet.reset();
+    }
+
+    // Method 2 to add tablet data

Review comment:
       Splited




-- 
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:
[email protected]


Reply via email to