You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2021/02/15 03:30:50 UTC

[iotdb] branch spotless updated (942de25 -> 45b6dd1)

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

jincheng pushed a change to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


 discard 942de25  Apply spotless and Resolve your conflict
 discard 91fbde0  IOTDB-1152 optimize regular data size in traversing
     new b592343  IOTDB-1152 optimize regular data size in traversing
     new 45b6dd1  Apply spotless

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (942de25)
            \
             N -- N -- N   refs/heads/spotless (45b6dd1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../level/LevelCompactionTsFileManagement.java     | 18 ---------
 .../engine/compaction/utils/CompactionUtils.java   | 44 ----------------------
 .../engine/storagegroup/StorageGroupProcessor.java |  8 ----
 .../org/apache/iotdb/db/service/MQTTService.java   |  7 ----
 .../db/engine/compaction/CompactionChunkTest.java  |  8 ----
 .../compaction/LevelCompactionRecoverTest.java     | 20 ----------
 .../iotdb/tsfile/common/conf/TSFileDescriptor.java |  4 --
 7 files changed, 109 deletions(-)


[iotdb] 02/02: Apply spotless

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jincheng pushed a commit to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 45b6dd19c40c15d3c0fdc82faa5313f00c3b364a
Author: sunjincheng121 <su...@gmail.com>
AuthorDate: Mon Feb 15 11:29:32 2021 +0800

    Apply spotless
---
 .../tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java  | 2 +-
 .../tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
index 8baf651..8b091ab 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
@@ -104,7 +104,7 @@ public class RegularDataEncoderIntegerTest {
     byte[] page = out.toByteArray();
     buffer = ByteBuffer.wrap(page);
     int i = 0;
-    while(regularDataDecoder.hasNext(buffer)) {
+    while (regularDataDecoder.hasNext(buffer)) {
       assertEquals(originalData[i++], regularDataDecoder.readInt(buffer));
     }
   }
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
index 34efa48..5e7748b 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
@@ -145,7 +145,7 @@ public class RegularDataEncoderLongTest {
     byte[] page = out.toByteArray();
     buffer = ByteBuffer.wrap(page);
     int i = 0;
-    while(regularDataDecoder.hasNext(buffer)) {
+    while (regularDataDecoder.hasNext(buffer)) {
       assertEquals(originalData[i++], regularDataDecoder.readLong(buffer));
     }
   }


[iotdb] 01/02: IOTDB-1152 optimize regular data size in traversing

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jincheng pushed a commit to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b5923438e50c01a4a92b390454693bdbdf1f079c
Author: wangchao316 <57...@qq.com>
AuthorDate: Tue Feb 9 22:04:18 2021 +0800

    IOTDB-1152 optimize regular data size in traversing
---
 .../iotdb/tsfile/encoding/encoder/RegularDataEncoder.java   |  8 ++++++--
 .../decoder/regular/RegularDataEncoderIntegerTest.java      | 13 +++++++++++++
 .../decoder/regular/RegularDataEncoderLongTest.java         | 13 +++++++++++++
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
index 492e8eb..19502a8 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
@@ -49,6 +49,8 @@ public abstract class RegularDataEncoder extends Encoder {
 
   protected int writeIndex = -1;
 
+  protected int dataTotal;
+
   /**
    * constructor of RegularDataEncoder.
    *
@@ -183,6 +185,7 @@ public abstract class RegularDataEncoder extends Encoder {
       }
       firstValue = data[0];
       if (isMissingPoint) {
+        dataTotal = writeIndex;
         newBlockSize = ((data[writeIndex - 1] - data[0]) / minDeltaBase) + 1;
         writeIndex = newBlockSize;
       }
@@ -218,7 +221,7 @@ public abstract class RegularDataEncoder extends Encoder {
       bitmap = new BitSet(newBlockSize);
       bitmap.flip(0, newBlockSize);
       int offset = 0;
-      for (int i = 1; i < missingPointData.length; i++) {
+      for (int i = 1; i < dataTotal; i++) {
         int delta = missingPointData[i] - missingPointData[i - 1];
         if (delta != minDeltaBase) {
           int missingPointNum = (int) (delta / minDeltaBase) - 1;
@@ -309,6 +312,7 @@ public abstract class RegularDataEncoder extends Encoder {
       }
       firstValue = data[0];
       if (isMissingPoint) {
+        dataTotal = writeIndex;
         newBlockSize = (int) (((data[writeIndex - 1] - data[0]) / minDeltaBase) + 1);
         writeIndex = newBlockSize;
       }
@@ -344,7 +348,7 @@ public abstract class RegularDataEncoder extends Encoder {
       bitmap = new BitSet(newBlockSize);
       bitmap.flip(0, newBlockSize);
       int offset = 0;
-      for (int i = 1; i < missingPointData.length; i++) {
+      for (int i = 1; i < dataTotal; i++) {
         long delta = missingPointData[i] - missingPointData[i - 1];
         if (delta != minDeltaBase) {
           int missingPointNum = (int) (delta / minDeltaBase) - 1;
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
index be08915..8baf651 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
@@ -96,6 +96,19 @@ public class RegularDataEncoderIntegerTest {
     shouldReadAndWrite(data, ROW_NUM);
   }
 
+  @Test
+  public void testMissingPointsDataSize() throws IOException {
+    int[] originalData = new int[] {1000, 1100, 1200, 1300, 1500, 2000};
+    out = new ByteArrayOutputStream();
+    writeData(originalData, 6);
+    byte[] page = out.toByteArray();
+    buffer = ByteBuffer.wrap(page);
+    int i = 0;
+    while(regularDataDecoder.hasNext(buffer)) {
+      assertEquals(originalData[i++], regularDataDecoder.readInt(buffer));
+    }
+  }
+
   private int[] getMissingPointData(int dataSize, int missingPointInterval) {
     ROW_NUM = dataSize;
 
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
index aaec9a3..34efa48 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
@@ -137,6 +137,19 @@ public class RegularDataEncoderLongTest {
     shouldReadAndWrite(data, ROW_NUM);
   }
 
+  @Test
+  public void testMissingPointsDataSize() throws IOException {
+    long[] originalData = new long[] {1000, 1100, 1200, 1300, 1500, 2000};
+    out = new ByteArrayOutputStream();
+    writeData(originalData, 6);
+    byte[] page = out.toByteArray();
+    buffer = ByteBuffer.wrap(page);
+    int i = 0;
+    while(regularDataDecoder.hasNext(buffer)) {
+      assertEquals(originalData[i++], regularDataDecoder.readLong(buffer));
+    }
+  }
+
   private long[] getMissingPointData(List<String> originalData, int missingPointInterval) {
     List<String> dates = originalData;