From 9e5f824a03faf5c84d8e3f3a524d1e1e63a76cb9 Mon Sep 17 00:00:00 2001 From: Jialin Qiao Date: Wed, 22 Jul 2020 12:12:34 +0800 Subject: [PATCH] Add doc for MeasurementSchema in Tablet (#1534) * fix tablet doc --- .../java/org/apache/iotdb/SessionExample.java | 18 ++++++++++-------- .../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 a6cc09fad2..038b62a65c 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, StatementExecutionException { - // 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 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, StatementExecutionException { - // 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 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 1ead641efb..d159f632c2 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 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 schemas, int maxRowNumber) { -- GitLab