@Override public void close() { this.log.close(); }
private void handleRolloverFailure(Throwable exception) { log.warn("{}: Too many rollover failures; closing.", this.traceObjectId, exception); close(); }
private void handleWriteProcessorFailures(Throwable exception) { log.warn("{}: Too many write processor failures; closing.", this.traceObjectId, exception); close(); }
/** * Handles a general Write exception. */ private void handleWriteException(Throwable ex) { if (ex instanceof ObjectClosedException && !this.closed.get()) { log.warn("{}: Caught ObjectClosedException but not closed; closing now.", this.traceObjectId, ex); close(); } }
@Override public void disable() throws DurableDataLogException { // Get the current metadata, disable it, and then persist it back. synchronized (this.lock) { ensurePreconditions(); LogMetadata metadata = getLogMetadata(); Preconditions.checkState(metadata.isEnabled(), "BookKeeperLog is already disabled."); metadata = this.logMetadata.asDisabled(); persistMetadata(metadata, false); this.logMetadata = metadata; log.info("{}: Disabled (Epoch = {}, UpdateVersion = {}).", this.traceObjectId, metadata.getEpoch(), metadata.getUpdateVersion()); } // Close this instance of the BookKeeperLog. This ensures the proper cancellation of any ongoing writes. close(); }
close(); LoggerHelpers.traceLeave(log, this.traceObjectId, "processPendingWrites", traceId, cs); return false;