Class DelayedFlusher

java.lang.Object
io.atomix.raft.storage.log.DelayedFlusher
All Implemented Interfaces:
RaftLogFlusher, CloseableSilently, AutoCloseable

public final class DelayedFlusher extends Object implements RaftLogFlusher
An implementation of RaftLogFlusher which treats calls to flush(Journal) as signals that there is data to be flushed. When that happens, an asynchronous operation is scheduled with a predefined delay. If a flush was already scheduled, then the signal is ignored.

In other words, this implementation flushes at least every given period, if there is anything to flush.

NOTE: this class is not thread safe, and is expected to run from the same thread as the journal write path, e.g. the Raft thread.