private void recoverCompaction(CompactionTaskType type, File timePartitionDir) {
    File[] compactionLogs = CompactionLogger.findCompactionLogs(type, timePartitionDir);
    for (File compactionLog : compactionLogs) {
      switch (type) {
        case INNER_SEQ:
        case INNER_UNSEQ:
        case REPAIR:
          new CompactionRecoverTask(
                  logicalStorageGroupName, dataRegionId, tsFileManager, compactionLog, true)
              .doCompaction();
          break;
        case CROSS:
          new CompactionRecoverTask(
                  logicalStorageGroupName, dataRegionId, tsFileManager, compactionLog, false)
              .doCompaction();
          break;
        case INSERTION:
          new InsertionCrossSpaceCompactionTask(
                  logicalStorageGroupName, dataRegionId, tsFileManager, compactionLog)
              .recover();
          break;
        case SETTLE:
          new SettleCompactionTask(
                  logicalStorageGroupName, dataRegionId, tsFileManager, compactionLog)
              .recover();
          break;
        default:
          logger.warn("Unknown compaction task type {}", type);
          return;
      }
    }
  }
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