Skip to content

Commit

Permalink
reduce stack message of last time check exception for read chunk comp…
Browse files Browse the repository at this point in the history
…action performer (#11927)
  • Loading branch information
shuwenwei authored Jan 23, 2024
1 parent 9e05b26 commit 69202a9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.iotdb.db.storageengine.dataregion.compaction.schedule.constant.CompactionType;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
import org.apache.iotdb.db.storageengine.rescon.memory.SystemInfo;
import org.apache.iotdb.tsfile.exception.write.PageException;
import org.apache.iotdb.tsfile.file.metadata.AlignedChunkMetadata;
import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
Expand Down Expand Up @@ -62,7 +63,8 @@ public ReadChunkCompactionPerformer() {}

@Override
public void perform()
throws IOException, MetadataException, InterruptedException, StorageEngineException {
throws IOException, MetadataException, InterruptedException, StorageEngineException,
PageException {
// size for file writer is 5% of per compaction task memory budget
long sizeForFileWriter =
(long)
Expand Down Expand Up @@ -121,7 +123,7 @@ private void compactAlignedSeries(
TsFileResource targetResource,
CompactionTsFileWriter writer,
MultiTsFileDeviceIterator deviceIterator)
throws IOException, InterruptedException, IllegalPathException {
throws IOException, InterruptedException, IllegalPathException, PageException {
checkThreadInterrupted();
LinkedList<Pair<TsFileSequenceReader, List<AlignedChunkMetadata>>> readerAndChunkMetadataList =
deviceIterator.getReaderAndChunkMetadataForCurrentAlignedSeries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void collectValueColumnSchemaList() throws IOException {
}
}

public void execute() throws IOException {
public void execute() throws IOException, PageException {
while (!readerAndChunkMetadataList.isEmpty()) {
Pair<TsFileSequenceReader, List<AlignedChunkMetadata>> readerListPair =
readerAndChunkMetadataList.removeFirst();
Expand All @@ -162,12 +162,7 @@ public void execute() throws IOException {
((CompactionTsFileReader) reader).markStartOfAlignedSeries();
}
for (AlignedChunkMetadata alignedChunkMetadata : alignedChunkMetadataList) {
try {
compactWithAlignedChunk(reader, alignedChunkMetadata);
} catch (Exception e) {
throw new RuntimeException(
"Meet errors when compact aligned series of device: " + device, e);
}
compactWithAlignedChunk(reader, alignedChunkMetadata);
}
if (reader instanceof CompactionTsFileReader) {
((CompactionTsFileReader) reader).markEndOfAlignedSeries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.iotdb.db.storageengine.dataregion.tsfile.generator.TsFileNameGenerator;
import org.apache.iotdb.db.storageengine.dataregion.utils.TsFileResourceUtils;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.apache.iotdb.tsfile.exception.write.PageException;
import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
Expand Down Expand Up @@ -84,7 +85,8 @@ public void tearDown() throws IOException, StorageEngineException {

@Test
public void testSimpleCompactionByFlushChunk()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -129,7 +131,8 @@ public void testSimpleCompactionByFlushChunk()

@Test
public void testSimpleCompactionWithNullColumnByFlushChunk()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -174,7 +177,8 @@ public void testSimpleCompactionWithNullColumnByFlushChunk()

@Test
public void testSimpleCompactionWithAllDeletedColumnByFlushChunk()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -224,7 +228,8 @@ public void testSimpleCompactionWithAllDeletedColumnByFlushChunk()

@Test
public void testSimpleCompactionWithNotExistColumnByFlushChunk()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -274,7 +279,8 @@ public void testSimpleCompactionWithNotExistColumnByFlushChunk()

@Test
public void testSimpleCompactionWithPartialDeletedColumnByFlushChunk()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -375,7 +381,8 @@ public void testSimpleCompactionWithAllDeletedPageByFlushPage() throws Exception

@Test
public void testSimpleCompactionWithPartialDeletedPageByWritePoint()
throws IOException, MetadataException, StorageEngineException, InterruptedException {
throws IOException, MetadataException, StorageEngineException, InterruptedException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -426,7 +433,8 @@ public void testSimpleCompactionWithPartialDeletedPageByWritePoint()

@Test
public void testSimpleCompactionByFlushPage()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -471,7 +479,8 @@ public void testSimpleCompactionByFlushPage()

@Test
public void testSimpleCompactionByWritePoint()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down Expand Up @@ -516,7 +525,8 @@ public void testSimpleCompactionByWritePoint()

@Test
public void testCompactionWithDifferentCompressionTypeOrEncoding()
throws IOException, StorageEngineException, InterruptedException, MetadataException {
throws IOException, StorageEngineException, InterruptedException, MetadataException,
PageException {
TsFileResource seqResource1 =
generateSingleAlignedSeriesFile(
"d0",
Expand Down

0 comments on commit 69202a9

Please sign in to comment.