@Test
  public void testInnerRecoverWithCompleteTargetFileUsingFilePathAndChangingDataDirs()
      throws Exception {
    try {
      List<TsFileResource> sourceFiles = getSourceFiles();
      List<String> sourceFileNames = new ArrayList<>();
      sourceFiles.forEach(f -> sourceFileNames.add(f.getTsFile().getName()));
      TsFileResource targetResource =
          TsFileNameGenerator.getInnerCompactionTargetFileResource(sourceFiles, true);
      SimpleCompactionLogger compactionLogger = new SimpleCompactionLogger(new File(logFilePath));
      compactionLogger.logSourceFiles(sourceFiles);
      compactionLogger.logTargetFile(targetResource);
      compactionLogger.close();
      performer.setSourceFiles(sourceFiles);
      performer.setTargetFiles(Collections.singletonList(targetResource));
      performer.setSummary(new FastCompactionTaskSummary());
      performer.perform();
      CompactionUtils.moveTargetFile(
          Collections.singletonList(targetResource),
          CompactionTaskType.INNER_SEQ,
          COMPACTION_TEST_SG);
      FileUtils.moveDirectory(
          new File(TestConstant.BASE_OUTPUT_PATH + File.separator + "data"),
          new File(TestConstant.BASE_OUTPUT_PATH + File.separator + "data1"));
      setDataDirs(new String[][] {{TestConstant.BASE_OUTPUT_PATH + File.separator + "data1"}});
      InnerSpaceCompactionTask recoverTask =
          new InnerSpaceCompactionTask(
              COMPACTION_TEST_SG, "0", tsFileManager, new File(logFilePath));
      recoverTask.recover();
      // all the source files should exist
      for (String sourceFileName : sourceFileNames) {
        Assert.assertTrue(
            new File(
                    TestConstant.BASE_OUTPUT_PATH
                        + File.separator
                        + "data1"
                        + File.separator
                        + "sequence"
                        + File.separator
                        + COMPACTION_TEST_SG
                        + File.separator
                        + "0"
                        + File.separator
                        + "0",
                    sourceFileName)
                .exists());
      }
      File targetFileAfterMoved =
          new File(
              TestConstant.BASE_OUTPUT_PATH
                  + File.separator
                  + "data1"
                  + File.separator
                  + "sequence"
                  + File.separator
                  + COMPACTION_TEST_SG
                  + File.separator
                  + "0"
                  + File.separator
                  + "0",
              targetResource
                  .getTsFile()
                  .getName()
                  .replace(
                      IoTDBConstant.INNER_COMPACTION_TMP_FILE_SUFFIX,
                      TsFileConstant.TSFILE_SUFFIX));
      Assert.assertFalse(targetFileAfterMoved.exists());
    } finally {
      FileUtils.deleteDirectory(new File(TestConstant.BASE_OUTPUT_PATH + File.separator + "data1"));
    }
  }
Test a compaction task is finished, and the data dirs of the system is change. The compaction
log use file path to record files.

@throws Exception
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/recover/SizeTieredCompactionRecoverTest.java