@Override
  @SuppressWarnings("java:S2142")
  public void run() {
    try {
      if (!checkConditionsToStartRepairTask()) {
        return;
      }
      LOGGER.info("[RepairScheduler] Wait compaction schedule task finish");
      CompactionScheduleTaskManager.getInstance().stopCompactionScheduleTasks();
      try {
        LOGGER.info("[RepairScheduler] Wait all running compaction task finish");
        CompactionTaskManager.getInstance().waitAllCompactionFinish();
        startTimePartitionScanTasks();
        LOGGER.info("[RepairScheduler] Repair task finished");
      } finally {
        CompactionScheduleTaskManager.getInstance().startScheduleTasks();
      }
    } catch (InterruptedException ignored) {
      // ignored the InterruptedException and let the task exit
    } catch (Exception e) {
      LOGGER.error("[RepairScheduler] Meet error when execute repair schedule task", e);
    } finally {
      try {
        repairLogger.close();
      } catch (Exception e) {
        LOGGER.error(
            "[RepairScheduler] Failed to close repair logger {}",
            repairLogger.getRepairLogFilePath(),
            e);
      }
      CompactionScheduleTaskManager.getRepairTaskManagerInstance().markRepairTaskFinish();
    }
  }
Used for create a new repair schedule task
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/repair/UnsortedFileRepairTaskScheduler.java