You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/03/05 06:54:38 UTC

[iotdb] branch SketchTool created (now 753e7a6)

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

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


      at 753e7a6  fix the sketch tool in new tsfile format

This branch includes the following new commits:

     new 753e7a6  fix the sketch tool in new tsfile format

The 1 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.



[iotdb] 01/01: fix the sketch tool in new tsfile format

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

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

commit 753e7a622dbce6b6b140ed5953d98cc011df3683
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Fri Mar 5 14:52:18 2021 +0800

    fix the sketch tool in new tsfile format
---
 server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java  | 4 ++--
 .../java/org/apache/iotdb/tsfile/read/reader/LocalTsFileInput.java    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java b/server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java
index 35cb5ae..085cd74 100644
--- a/server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java
+++ b/server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java
@@ -116,12 +116,12 @@ public class TsFileSketchTool {
                     + String.format("%20s", "")
                     + " \t"
                     + chunkMetadata.getStatistics());
-            printlnBoth(pw, String.format("%20s", "") + "|\t\t[marker] 1");
+            printlnBoth(pw, String.format("%20s", "") + "|\t\t[marker] " + chunk.getHeader().getChunkType());
             nextChunkGroupHeaderPos =
                 chunkMetadata.getOffsetOfChunkHeader()
                     + chunk.getHeader().getSerializedSize()
                     + chunk.getHeader().getDataSize()
-                    - 1;
+                    + 17; // skip the PlanIndex
           }
 
           printlnBoth(pw, str1 + "\t[Chunk Group] of " + chunkGroupMetadata.getDevice() + " ends");
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/LocalTsFileInput.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/LocalTsFileInput.java
index 26bd2cf..eb68160 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/LocalTsFileInput.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/LocalTsFileInput.java
@@ -144,6 +144,7 @@ public class LocalTsFileInput implements TsFileInput {
     int varIntLength = ReadWriteForEncodingUtils.varIntSize(strLength);
     byte[] bytes = new byte[strLength];
     channel.read(strBuffer, offset + varIntLength);
+    strBuffer.flip();
     strBuffer.get(bytes, 0, strLength);
     return new String(bytes, 0, strLength);
   }