public void settleOneTsFileAndMod(
      TsFileResource resourceToBeSettled, List<TsFileResource> settledResources)
      throws WriteProcessException, IllegalPathException, IOException {
    if (!resourceToBeSettled.isClosed()) {
      logger.warn(
          "The tsFile {} should be sealed when rewritting.", resourceToBeSettled.getTsFilePath());
      return;
    }
    // if no deletions to this tsfile, then return.
    if (!resourceToBeSettled.anyModFileExists()) {
      return;
    }
    try (TsFileSplitByPartitionTool tsFileRewriteTool =
        new TsFileSplitByPartitionTool(resourceToBeSettled)) {
      tsFileRewriteTool.parseAndRewriteFile(settledResources);
    }
  }
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