offsetWriter.cancelFlush(); offsetWriter.cancelFlush(); offsetWriter.cancelFlush();
/** * Handle completion of a write. Returns true if this callback is for the current flush * operation, false if it's for an old operation that should now be ignored. */ private synchronized boolean handleFinishWrite(long flushId, Throwable error, Void result) { // Callbacks need to be handled carefully since the flush operation may have already timed // out and been cancelled. if (flushId != currentFlushId) return false; if (error != null) { cancelFlush(); } else { currentFlushId++; toFlush = null; } return true; } }
private synchronized void finishFailedFlush() { offsetWriter.cancelFlush(); outstandingMessages.putAll(outstandingMessagesBacklog); outstandingMessagesBacklog.clear(); flushing = false; }