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 2020/07/22 02:19:18 UTC

[incubator-iotdb] 01/01: fix insert tablet doc

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

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

commit e12e6acba88bcfe8b716c1be0fb426b88c6b48c4
Author: qiaojialin <64...@qq.com>
AuthorDate: Wed Jul 22 10:18:49 2020 +0800

    fix insert tablet doc
---
 .../src/main/java/org/apache/iotdb/SessionExample.java | 18 ++++++++++--------
 .../org/apache/iotdb/tsfile/write/record/Tablet.java   |  5 +++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index 36b30c6..770513f 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -238,11 +238,12 @@ public class SessionExample {
    * Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
    */
   private static void insertTablet() throws IoTDBConnectionException, BatchExecutionException {
-    // The schema of sensors of one device
+    // The schema of measurements of one device
+    // only measurementId and data type in MeasurementSchema take effects in Tablet
     List<MeasurementSchema> schemaList = new ArrayList<>();
-    schemaList.add(new MeasurementSchema("s1", TSDataType.INT64, TSEncoding.RLE));
-    schemaList.add(new MeasurementSchema("s2", TSDataType.INT64, TSEncoding.RLE));
-    schemaList.add(new MeasurementSchema("s3", TSDataType.INT64, TSEncoding.RLE));
+    schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
+    schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
+    schemaList.add(new MeasurementSchema("s3", TSDataType.INT64));
 
     Tablet tablet = new Tablet("root.sg1.d1", schemaList, 100);
 
@@ -269,11 +270,12 @@ public class SessionExample {
   }
 
   private static void insertTablets() throws IoTDBConnectionException, BatchExecutionException {
-    // The schema of sensors of one device
+    // The schema of measurements of one device
+    // only measurementId and data type in MeasurementSchema take effects in Tablet
     List<MeasurementSchema> schemaList = new ArrayList<>();
-    schemaList.add(new MeasurementSchema("s1", TSDataType.INT64, TSEncoding.RLE));
-    schemaList.add(new MeasurementSchema("s2", TSDataType.INT64, TSEncoding.RLE));
-    schemaList.add(new MeasurementSchema("s3", TSDataType.INT64, TSEncoding.RLE));
+    schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
+    schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
+    schemaList.add(new MeasurementSchema("s3", TSDataType.INT64));
 
     Tablet tablet1 = new Tablet("root.sg1.d1", schemaList, 100);
     Tablet tablet2 = new Tablet("root.sg1.d2", schemaList, 100);
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 1ead641..d159f63 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
@@ -74,7 +74,8 @@ public class Tablet {
    * constructor (all Tablet should be the same size).
    *
    * @param deviceId   the name of the device specified to be written in
-   * @param timeseries the list of measurement schemas for creating the tablet
+   * @param timeseries the list of measurement schemas for creating the tablet,
+   *                   only measurementId and type take effects
    */
   public Tablet(String deviceId, List<MeasurementSchema> timeseries) {
     this(deviceId, timeseries, DEFAULT_SIZE);
@@ -87,7 +88,7 @@ public class Tablet {
    *
    * @param deviceId     the name of the device specified to be written in
    * @param schemas   the list of measurement schemas for creating the row
-   *                     batch
+   *                  batch, only measurementId and type take effects
    * @param maxRowNumber the maximum number of rows for this tablet
    */
   public Tablet(String deviceId, List<MeasurementSchema> schemas, int maxRowNumber) {