public synchronized List<Pair<String, File>> sealTsFiles()
      throws IOException, WriteProcessException {
    if (isClosed) {
      return Collections.emptyList();
    }

    final List<Pair<String, File>> list = new ArrayList<>();
    if (!treeModeTsFileBuilder.isEmpty()) {
      list.addAll(treeModeTsFileBuilder.convertTabletToTsFileWithDBInfo());
    }
    if (!tableModeTsFileBuilder.isEmpty()) {
      list.addAll(tableModeTsFileBuilder.convertTabletToTsFileWithDBInfo());
    }
    return list;
  }
Converts a Tablet to a TSFile and returns the generated TSFile along with its corresponding
database name.

@return a list of pairs containing the database name and the generated TSFile
@throws IOException if an I/O error occurs during the conversion process
@throws WriteProcessException if an error occurs during the write process
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventTsFileBatch.java