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 2021/01/28 08:25:20 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #2576: [IOTDB-1091] SDT improvement store last point

jixuan1989 commented on a change in pull request #2576:
URL: https://github.com/apache/iotdb/pull/2576#discussion_r565899826



##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkWriterImpl.java
##########
@@ -174,26 +174,26 @@ private void checkSdtEncoding() {
   @Override
   public void write(long time, long value) {
     if (!isSdtEncoding || sdtEncoder.encodeLong(time, value)) {
-      if (isSdtEncoding) {
-        //store last read time and value
-        time = sdtEncoder.getTime();
-        value = sdtEncoder.getLongValue();
-      }
+      pageWriter.write(isSdtEncoding ? sdtEncoder.getTime() : time,
+          isSdtEncoding ? sdtEncoder.getLongValue() : value);
+    }
+    // store last point for sdtEncoding
+    if (isSdtEncoding && isLastPoint) {

Review comment:
       if (! isSdtEncoding || isLastPoint) {
     pageWriter.write(time, value);
   } else if (sdtEncoder.encodeLong(time, value)) {
    pageWriter.write(sdtEncoder.getTime(), sdtEncoder.getLongValue());
   } 




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