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/11/22 04:46:41 UTC

[GitHub] [iotdb] JackieTien97 commented on a change in pull request #2087: [IOTDB-890] SDT implementation

JackieTien97 commented on a change in pull request #2087:
URL: https://github.com/apache/iotdb/pull/2087#discussion_r528281256



##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkWriterImpl.java
##########
@@ -97,18 +109,93 @@ public ChunkWriterImpl(MeasurementSchema schema) {
     this.pageWriter = new PageWriter(measurementSchema);
     this.pageWriter.setTimeEncoder(measurementSchema.getTimeEncoder());
     this.pageWriter.setValueEncoder(measurementSchema.getValueEncoder());
+
+    //check if the measurement schema uses SDT
+    checkSdtEncoding();
+  }
+
+  public ChunkWriterImpl(MeasurementSchema schema, boolean isMerging) {
+    this(schema);
+    this.isMerging = isMerging;
+  }
+
+  private void checkSdtEncoding() {
+    if (measurementSchema.getProps() != null && !isMerging) {
+      for (Map.Entry<String, String> entry : measurementSchema.getProps().entrySet()) {

Review comment:
       No need to iterate the map, and also there is no guarantee that "loss" property will be got before other sdt parameters.
   
   You can directly use map.contains and map.get() to get whatever property you want.




----------------------------------------------------------------
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