@Override
  public void close() {
    isClosed = true;
    // Force sync existing data in memory to disk.
    // first waiting serialize and sync tasks finished, then release all resources
    waitUntilFlushAllDeletionsOrTimeOut();
    if (persistThread != null) {
      persistThread.shutdownNow();
      try {
        if (!persistThread.awaitTermination(30, TimeUnit.SECONDS)) {
          LOGGER.warn("persistThread did not terminate within {}s", 30);
        }
      } catch (InterruptedException e) {
        LOGGER.warn("DAL Thread {} still doesn't exit after 30s", dataRegionId);
        Thread.currentThread().interrupt();
      }
    }
    // clean buffer
    MmapUtil.clean(serializeBuffer);
    serializeBuffer = null;
  }
The core idea of this buffer is to write deletion to the Page cache and fsync them to disk when
certain conditions are met. This design does not decouple serialization and writing, but provides
an easier way to maintain and understand.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/persist/PageCacheDeletionBuffer.java