public static void findFilesToBeRecovered() {
    if (FSFactoryProducer.getFSFactory().getFile(SettleLog.getSettleLogPath()).exists()) {
      try (BufferedReader settleLogReader =
          new BufferedReader(
              new FileReader(
                  FSFactoryProducer.getFSFactory().getFile(SettleLog.getSettleLogPath())))) {
        String line = null;
        while ((line = settleLogReader.readLine()) != null && !"".equals(line)) {
          String oldFilePath = line.split(SettleLog.COMMA_SEPERATOR)[0];
          int settleCheckStatus = Integer.parseInt(line.split(SettleLog.COMMA_SEPERATOR)[1]);
          if (settleCheckStatus == SettleCheckStatus.SETTLE_SUCCESS.getCheckStatus()) {
            getInstance().recoverSettleFileMap.remove(oldFilePath);
            continue;
          }
          getInstance().recoverSettleFileMap.put(oldFilePath, settleCheckStatus);
        }
      } catch (IOException e) {
        logger.error(
            "meet error when reading settle log, log path:{}", SettleLog.getSettleLogPath(), e);
      } finally {
        File f = FSFactoryProducer.getFSFactory().getFile(SettleLog.getSettleLogPath());
        try {
          if (f.exists()) {
            Files.delete(f.toPath());
          }
        } catch (IOException e) {
          logger.error("failed to delete settle log, log path:{}", SettleLog.getSettleLogPath());
        }
      }
    }
  }
The size of settledResources will be 0 in one of the following conditions: (1) old TsFile is
not closed (2) old ModFile is not existed (3) all data in the old tsfile is being deleted after
settling
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/settle/TsFileAndModSettleTool.java