Package io.atomix.raft.storage.log
Class DelayedFlusher
java.lang.Object
io.atomix.raft.storage.log.DelayedFlusher
- All Implemented Interfaces:
RaftLogFlusher,CloseableSilently,AutoCloseable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.atomix.raft.storage.log.RaftLogFlusher
RaftLogFlusher.DirectFlusher, RaftLogFlusher.Factory, RaftLogFlusher.NoopFlusher -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.atomix.raft.storage.log.RaftLogFlusher
isDirect
-
Constructor Details
-
DelayedFlusher
-
-
Method Details
-
flush
Description copied from interface:RaftLogFlusherSignals that there is data to be flushed in the journal. The implementation may or may not immediately flush this.- Specified by:
flushin interfaceRaftLogFlusher- Parameters:
journal- the journal to flush
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableSilently- Specified by:
closein interfaceRaftLogFlusher
-
toString
-