public static void main(String[] args) {
    Map<String, TsFileResource> oldTsFileResources = new HashMap<>();
    findFilesToBeRecovered();
    for (Map.Entry<String, Integer> entry : getInstance().recoverSettleFileMap.entrySet()) {
      String path = entry.getKey();
      TsFileResource resource = new TsFileResource(new File(path));
      resource.setStatus(TsFileResourceStatus.NORMAL);
      oldTsFileResources.put(resource.getTsFile().getName(), resource);
    }
    List<File> tsFiles = checkArgs(args);
    for (File file : tsFiles) {
      if (!oldTsFileResources.containsKey(file.getName())
          && (new File(file + TsFileResource.RESOURCE_SUFFIX).exists())) {
        TsFileResource resource = new TsFileResource(file);
        resource.setStatus(TsFileResourceStatus.NORMAL);
        oldTsFileResources.put(file.getName(), resource);
      }
    }
    logger.info(
        "Totally find {} tsFiles to be settled, including {} tsFiles to be recovered.",
        oldTsFileResources.size(),
        getInstance().recoverSettleFileMap.size());
    settleTsFilesAndMods(oldTsFileResources);
  }
Offline Settle tool, which is used to settle TsFile and its corresponding mods file to a new
TsFile.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/settle/TsFileAndModSettleTool.java