|
40 | 40 | import org.apache.iotdb.db.storageengine.dataregion.compaction.execute.task.SettleCompactionTask; |
41 | 41 | import org.apache.iotdb.db.storageengine.dataregion.compaction.schedule.CompactionScheduleContext; |
42 | 42 | import org.apache.iotdb.db.storageengine.dataregion.compaction.selector.impl.SettleSelectorImpl; |
| 43 | +import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile; |
43 | 44 | import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource; |
44 | 45 | import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResourceStatus; |
45 | 46 |
|
46 | 47 | import org.apache.tsfile.common.conf.TSFileDescriptor; |
| 48 | +import org.apache.tsfile.common.constant.TsFileConstant; |
47 | 49 | import org.apache.tsfile.enums.TSDataType; |
48 | 50 | import org.apache.tsfile.exception.write.WriteProcessException; |
49 | 51 | import org.apache.tsfile.file.metadata.IDeviceID; |
@@ -407,6 +409,36 @@ public void settleWithOnlyPartialDirtyFilesByTTL() |
407 | 409 | validateTargetDatas(sourceDatas, Collections.emptyList()); |
408 | 410 | } |
409 | 411 |
|
| 412 | + @Test |
| 413 | + public void getModsFileAfterSettleCompaction() |
| 414 | + throws IOException, MetadataException, WriteProcessException { |
| 415 | + createFiles(6, 5, 10, 100, 0, 0, 0, 0, isAligned, true); |
| 416 | + tsFileManager.addAll(seqResources, true); |
| 417 | + tsFileManager.addAll(unseqResources, false); |
| 418 | + |
| 419 | + List<TsFileResource> partialDeletedFiles = new ArrayList<>(); |
| 420 | + partialDeletedFiles.addAll(seqResources); |
| 421 | + SettleCompactionTask task = |
| 422 | + new SettleCompactionTask( |
| 423 | + 0, |
| 424 | + tsFileManager, |
| 425 | + Collections.emptyList(), |
| 426 | + partialDeletedFiles, |
| 427 | + true, |
| 428 | + getPerformer(), |
| 429 | + 0); |
| 430 | + Assert.assertTrue(task.start()); |
| 431 | + List<TsFileResource> tsFileList = tsFileManager.getTsFileList(true); |
| 432 | + for (TsFileResource resource : tsFileList) { |
| 433 | + Assert.assertTrue( |
| 434 | + resource |
| 435 | + .getExclusiveModFile() |
| 436 | + .getFile() |
| 437 | + .getName() |
| 438 | + .endsWith(TsFileConstant.TSFILE_SUFFIX + ModificationFile.FILE_SUFFIX)); |
| 439 | + } |
| 440 | + } |
| 441 | + |
410 | 442 | @Test |
411 | 443 | public void settleWithMixedDirtyFilesByTTL() |
412 | 444 | throws IOException, MetadataException, WriteProcessException { |
|
0 commit comments