Package io.atomix.raft.storage.log
Interface RaftLogFlusher.Factory
- Enclosing interface:
RaftLogFlusher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Factory methods to create a new
RaftLogFlusher. This is unfortunately required due to
the blackbox instantiation of the RaftContext.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RaftLogFlusher.DirectFlusherShared, thread-safe, reusableRaftLogFlusher.DirectFlusherinstance.static final RaftLogFlusher.NoopFlusherShared, thread-safe, reusableRaftLogFlusher.NoopFlusherinstance. -
Method Summary
Modifier and TypeMethodDescriptioncreateFlusher(ThreadContextFactory threadFactory) Creates a newRaftLogFlusherwhich should use the given thread context for synchronization.static RaftLogFlusher.DirectFlusherdirect(ThreadContextFactory ignored) Preset factory method which returns a sharedRaftLogFlusher.DirectFlusherinstance.static RaftLogFlusher.NoopFlushernoop(ThreadContextFactory ignored) Preset factory method which returns a sharedRaftLogFlusher.NoopFlusherinstance.
-
Field Details
-
DIRECT
Shared, thread-safe, reusableRaftLogFlusher.DirectFlusherinstance. -
NOOP
Shared, thread-safe, reusableRaftLogFlusher.NoopFlusherinstance.
-
-
Method Details
-
createFlusher
Creates a newRaftLogFlusherwhich should use the given thread context for synchronization. If anyThreadContextare created, they should be closed by the flusher.- Parameters:
threadFactory- the thread context factory for asynchronous operations- Returns:
- a configured Flusher
-
direct
Preset factory method which returns a sharedRaftLogFlusher.DirectFlusherinstance. -
noop
Preset factory method which returns a sharedRaftLogFlusher.NoopFlusherinstance.
-