Esempio n. 1
0
  @Override
  public final void close() {
    if (open) {
      if (partitionCleaner != null) {
        partitionCleaner.halt();
        partitionCleaner = null;
      }
      try {
        if (isCommitOnClose()) {
          commit();
          purgeUnusedTempPartitions(txLog);
        }
        super.close();
        if (writeLock != null) {
          LockManager.release(writeLock);
          writeLock = null;
        }

        if (discardTxtRaf != null) {
          try {
            discardSink.close();
            discardTxtRaf.close();
          } catch (IOException e) {
            LOGGER.warn("Failed to close discard file");
          }
        }
      } catch (JournalException e) {
        throw new JournalRuntimeException(e);
      }
    }
  }
Esempio n. 2
0
 public void purgeTempPartitions() {
   partitionCleaner.purge();
 }