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/03/30 02:32:11 UTC

[iotdb] branch exception_device created (now 8fc95a9)

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

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


      at 8fc95a9  Throw exeception when device to be queried is not in tsFileMetaData

This branch includes the following new commits:

     new 8fc95a9  Throw exeception when device to be queried is not in tsFileMetaData

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: Throw exeception when device to be queried is not in tsFileMetaData

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

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

commit 8fc95a990fdfd7438afdf54cd626e7fdcf213fa5
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Tue Mar 30 10:31:29 2021 +0800

    Throw exeception when device to be queried is not in tsFileMetaData
---
 .../main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
index bb4a8f01..bc63d93 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
@@ -329,7 +329,7 @@ public class TsFileSequenceReader implements AutoCloseable {
     Pair<MetadataIndexEntry, Long> metadataIndexPair =
         getMetadataAndEndOffset(deviceMetadataIndexNode, path.getDevice(), true, true);
     if (metadataIndexPair == null) {
-      return null;
+      throw new IOException("Device {" + path.getDevice() + "} is not in tsFileMetaData");
     }
     ByteBuffer buffer = readData(metadataIndexPair.left.getOffset(), metadataIndexPair.right);
     MetadataIndexNode metadataIndexNode = deviceMetadataIndexNode;