public void recover() throws DataRegionException, IOException {
    super.recoverWithWriter();

    if (hasCrashed()) {
      writer.endFile();
      try {
        reconstructResourceFile();
      } catch (IOException e) {
        throw new DataRegionException(
            "Failed recover the resource file: "
                + tsFileResource.getTsFilePath()
                + TsFileResource.RESOURCE_SUFFIX
                + e);
      }
    }
  }
Recover sealed TsFile, including load .resource file (reconstruct when necessary) and truncate
the file to remaining corrected data.

@throws DataRegionException when failing to recover.
@throws IOException when failing to end file.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/SealedTsFileRecoverPerformer.java