You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/08/29 03:49:34 UTC

[GitHub] [incubator-iotdb] neuyilan commented on a change in pull request #1658: IOTDB-839:Make Tablet api more friendly

neuyilan commented on a change in pull request #1658:
URL: https://github.com/apache/incubator-iotdb/pull/1658#discussion_r479602860



##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -247,15 +247,11 @@ private static void insertTablet() throws IoTDBConnectionException, StatementExe
 
     Tablet tablet = new Tablet("root.sg1.d1", schemaList, 100);
 
-    long[] timestamps = tablet.timestamps;
-    Object[] values = tablet.values;
-
     for (long time = 0; time < 100; time++) {
-      int row = tablet.rowSize++;
-      timestamps[row] = time;
-      for (int i = 0; i < 3; i++) {
-        long[] sensor = (long[]) values[i];
-        sensor[row] = i;
+      int rowIndex = tablet.rowSize++;
+      tablet.addTimestamp(rowIndex, time);
+      for (int s = 0; s < 3; s++) {

Review comment:
       I think it's better to separate the rowIndex, the time column, and the value column, which would clearer to users.




----------------------------------------------------------------
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:
users@infra.apache.org