You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by su...@apache.org on 2021/05/13 04:19:39 UTC

[iotdb] branch metadata_bug created (now 0be795a)

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

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


      at 0be795a  [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector

This branch includes the following new commits:

     new 044d99b  [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector
     new 0be795a  [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector

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.


[iotdb] 01/02: [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector

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

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

commit 044d99bacfe6ef07cef74f7518611e7bc9002b05
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Thu May 13 12:12:35 2021 +0800

    [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector
---
 .../src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java b/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java
index 2755777..a51953b 100644
--- a/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java
+++ b/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java
@@ -20,6 +20,7 @@ package org.apache.iotdb.tsfile;
 
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
 import org.apache.iotdb.tsfile.encoding.decoder.Decoder;
 import org.apache.iotdb.tsfile.file.MetaMarker;
 import org.apache.iotdb.tsfile.file.header.ChunkGroupHeader;
@@ -67,7 +68,11 @@ public class TsFileSequenceRead {
       while ((marker = reader.readMarker()) != MetaMarker.SEPARATOR) {
         switch (marker) {
           case MetaMarker.CHUNK_HEADER:
+          case (byte) (MetaMarker.CHUNK_HEADER | TsFileConstant.TIME_COLUMN_MASK):
+          case (byte) (MetaMarker.CHUNK_HEADER | TsFileConstant.VALUE_COLUMN_MASK):
           case MetaMarker.ONLY_ONE_PAGE_CHUNK_HEADER:
+          case (byte) (MetaMarker.ONLY_ONE_PAGE_CHUNK_HEADER | TsFileConstant.TIME_COLUMN_MASK):
+          case (byte) (MetaMarker.ONLY_ONE_PAGE_CHUNK_HEADER | TsFileConstant.VALUE_COLUMN_MASK):
             System.out.println("\t[Chunk]");
             System.out.println("\tchunk type: " + marker);
             System.out.println("\tposition: " + reader.position());

[iotdb] 02/02: [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector

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

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

commit 0be795a64dba865d445d255ec1d9d62358387c65
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Thu May 13 12:12:41 2021 +0800

    [IOTDB-1378] MetadataIndexTree constructs error when existing more than one chunks in vector
---
 .../java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
index 9fe7453..fb43fe4 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
@@ -262,7 +262,8 @@ public class TsFileIOWriter {
           Path series = new Path(chunkGroupMetadata.getDevice(), chunkMetadata.getMeasurementUid());
           chunkMetadataListMap.computeIfAbsent(series, k -> new ArrayList<>()).add(chunkMetadata);
           idx++;
-          Map<Path, List<IChunkMetadata>> chunkMetadataListMapInVector = new TreeMap<>();
+          Map<Path, List<IChunkMetadata>> chunkMetadataListMapInVector =
+              vectorToPathsMap.computeIfAbsent(series, key -> new TreeMap<>());
 
           // value columns of a vector series
           while (idx < chunkMetadatas.size() && chunkMetadatas.get(idx).isValueColumn()) {
@@ -274,7 +275,6 @@ public class TsFileIOWriter {
                 .add(chunkMetadata);
             idx++;
           }
-          vectorToPathsMap.put(series, chunkMetadataListMapInVector);
         }
       }
     }