private void prepareTargetFile() throws IOException {
    TsFileResource seqSourceFile = seqFiles.get(0);
    TsFileResource targetFile = targetFiles.get(0);
    Files.createLink(targetFile.getTsFile().toPath(), seqSourceFile.getTsFile().toPath());
    ITimeIndex timeIndex = seqSourceFile.getTimeIndex();
    if (timeIndex instanceof ArrayDeviceTimeIndex) {
      targetFile.setTimeIndex(timeIndex);
    } else {
      targetFile.setTimeIndex(CompactionUtils.buildDeviceTimeIndex(seqSourceFile));
    }
    if (seqSourceFile.anyModFileExists()) {
      Files.createLink(
          seqSourceFile.getCompactionModFile().getFile().toPath(),
          seqSourceFile.getExclusiveModFile().getFile().toPath());
    }
  }
Used for fixing files which contains internal unsorted data
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/RepairUnsortedFileCompactionPerformer.java