You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/07/17 11:51:16 UTC
[iotdb] 01/01: remove shutdown exception
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch fix_close_log
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit fa9a2cd07d7e96b646debcc9b38246b08e2994e2
Author: qiaojialin <64...@qq.com>
AuthorDate: Sun Jul 17 19:51:01 2022 +0800
remove shutdown exception
---
.../org/apache/iotdb/tsfile/read/TsFileSequenceReader.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
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 75c01fdbd6..5c67a545f0 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
@@ -68,6 +68,7 @@ import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.nio.ByteBuffer;
+import java.nio.channels.ClosedByInterruptException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -1034,6 +1035,8 @@ public class TsFileSequenceReader implements AutoCloseable {
public ChunkHeader readChunkHeader(byte chunkType) throws IOException {
try {
return ChunkHeader.deserializeFrom(tsFileInput.wrapAsInputStream(), chunkType);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading chunk header of {}", file, t);
throw t;
@@ -1049,6 +1052,8 @@ public class TsFileSequenceReader implements AutoCloseable {
private ChunkHeader readChunkHeader(long position, int chunkHeaderSize) throws IOException {
try {
return ChunkHeader.deserializeFrom(tsFileInput, position, chunkHeaderSize);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading chunk header of {}", file, t);
throw t;
@@ -1065,6 +1070,8 @@ public class TsFileSequenceReader implements AutoCloseable {
private ByteBuffer readChunk(long position, int dataSize) throws IOException {
try {
return readData(position, dataSize);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading chunk of {}", file, t);
throw t;
@@ -1085,6 +1092,8 @@ public class TsFileSequenceReader implements AutoCloseable {
readChunk(
metaData.getOffsetOfChunkHeader() + header.getSerializedSize(), header.getDataSize());
return new Chunk(header, buffer, metaData.getDeleteIntervalList(), metaData.getStatistics());
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading chunk of {}", file, t);
throw t;
@@ -1116,6 +1125,8 @@ public class TsFileSequenceReader implements AutoCloseable {
public PageHeader readPageHeader(TSDataType type, boolean hasStatistic) throws IOException {
try {
return PageHeader.deserializeFrom(tsFileInput.wrapAsInputStream(), type, hasStatistic);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading page header of {}", file, t);
throw t;
@@ -1234,6 +1245,8 @@ public class TsFileSequenceReader implements AutoCloseable {
protected ByteBuffer readData(long start, long end) throws IOException {
try {
return readData(start, (int) (end - start));
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (Throwable t) {
logger.error("Exception happened while reading data of {}", file, t);
throw t;