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 03:26:55 UTC
[incubator-iotdb] branch rel/0.10 updated: fix insert tablet doc
(#1535)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch rel/0.10
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/rel/0.10 by this push:
new cbaf6f2 fix insert tablet doc (#1535)
cbaf6f2 is described below
commit cbaf6f2bb24f639fcbe9dafda0435ba6c13e21d9
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Wed Jul 22 11:26:44 2020 +0800
fix insert tablet doc (#1535)
---
.../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) {