private void initRepairDataTask(
      List<DataRegion> dataRegions, boolean isRecoverStorageEngine, File logFileDir) {
    // 1. init repair logger
    try {
      repairLogger = new RepairLogger(logFileDir, isRecoverStorageEngine);
    } catch (Exception e) {
      try {
        LOGGER.error("[RepairScheduler] Failed to create repair logger", e);
        repairLogger.close();
      } catch (IOException closeException) {
        LOGGER.error("[RepairScheduler] Failed to close repair logger", closeException);
      }
      return;
    }
    // 2. parse log file and get the repair task start time
    File logFile = repairLogger.getLogFile();
    RepairTaskRecoverLogParser recoverLogParser = new RepairTaskRecoverLogParser(logFile);
    if (repairLogger.isNeedRecoverFromLogFile()) {
      try {
        recoverLogParser.parse();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    // if the start time is not recorded in log file, the return value is System.currentTimeMillis()
    this.repairTaskTime = recoverLogParser.getRepairDataTaskStartTime();
    // 3. collect the time partition info of data regions
    collectTimePartitions(dataRegions);
    // 4. recover the repair progress
    if (repairLogger.isNeedRecoverFromLogFile()) {
      try {
        recoverRepairProgress(recoverLogParser);
      } catch (Exception e) {
        LOGGER.error(
            "[RepairScheduler] Failed to parse repair log file {}", logFile.getAbsolutePath(), e);
        return;
      }
    }
    try {
      repairLogger.recordRepairTaskStartTimeIfLogFileEmpty(repairTaskTime);
    } catch (IOException e) {
      LOGGER.error(
          "[RepairScheduler] Failed to record repair task start time in log file {}",
          logFile.getAbsolutePath(),
          e);
      return;
    }
    repairProgress = new RepairProgress(allTimePartitionFiles.size());
    initSuccess = true;
    isRecoverStoppedTask = repairLogger.isPreviousTaskStopped();
  }
Used for create a new repair schedule task
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/repair/UnsortedFileRepairTaskScheduler.java