@SuppressWarnings("squid:S3776")
  public void recoverCompaction() {
    List<List<String>> dataDirLists = new ArrayList<>();
    dataDirLists.add(TierManager.getInstance().getAllLocalSequenceFileFolders());
    dataDirLists.add(TierManager.getInstance().getAllLocalUnSequenceFileFolders());

    for (List<String> dataDirs : dataDirLists) {
      for (String dir : dataDirs) {
        File storageGroupDir =
            new File(
                dir + File.separator + logicalStorageGroupName + File.separator + dataRegionId);
        logger.info(
            "{} [Compaction][Recover] recover compaction in data region dir {}",
            logicalStorageGroupName,
            storageGroupDir.getAbsolutePath());
        if (!storageGroupDir.exists()) {
          return;
        }
        File[] timePartitionDirs = storageGroupDir.listFiles();
        if (timePartitionDirs == null) {
          return;
        }
        for (File timePartitionDir : timePartitionDirs) {
          if (!timePartitionDir.isDirectory()
              || !Pattern.compile("-?\\d+").matcher(timePartitionDir.getName()).matches()) {
            continue;
          }
          logger.info(
              "{} [Compaction][Recover] recover compaction in time partition dir {}",
              logicalStorageGroupName,
              timePartitionDir.getAbsolutePath());
          // including repair task
          recoverCompaction(CompactionTaskType.INNER_SEQ, timePartitionDir);
          recoverCompaction(CompactionTaskType.INNER_UNSEQ, timePartitionDir);
          recoverCompaction(CompactionTaskType.CROSS, timePartitionDir);
          recoverCompaction(CompactionTaskType.INSERTION, timePartitionDir);
          recoverCompaction(CompactionTaskType.SETTLE, timePartitionDir);

          // recover temporary files generated during .mods file settled
          recoverModSettleFile(timePartitionDir.toPath());
        }
      }
    }
  }
CompactionRecoverManager searches compaction log and call {@link CompactionRecoverTask} to
execute the recover process for all compaction task sequentially, including InnerCompactionTask
in sequence/unsequence space, CrossSpaceCompaction.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/recover/CompactionRecoverManager.java