private void calculateRepairMethod() {
    if (this.sourceFile.getTsFileRepairStatus() != TsFileRepairStatus.NEED_TO_CHECK) {
      return;
    }
    RepairDataFileScanUtil repairDataFileScanUtil = new RepairDataFileScanUtil(sourceFile, true);
    repairDataFileScanUtil.scanTsFile(true);
    if (repairDataFileScanUtil.isBrokenFile()) {
      sourceFile.setTsFileRepairStatus(TsFileRepairStatus.CAN_NOT_REPAIR);
      return;
    }
    if (repairDataFileScanUtil.hasUnsortedDataOrWrongStatistics()) {
      sourceFile.setTsFileRepairStatus(TsFileRepairStatus.NEED_TO_REPAIR_BY_REWRITE);
      return;
    }
    if (sourceFile.isSeq()) {
      sourceFile.setTsFileRepairStatus(TsFileRepairStatus.NEED_TO_REPAIR_BY_MOVE);
      return;
    }
    sourceFile.setTsFileRepairStatus(TsFileRepairStatus.NORMAL);
  }
Repair the internal unsorted file by compaction and move it to unSequence space after compaction
whether the source TsFileResource is sequence or not.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/RepairUnsortedFileCompactionTask.java