Interface RaftLogFlusher

All Superinterfaces:
AutoCloseable, CloseableSilently
All Known Implementing Classes:
DelayedFlusher, RaftLogFlusher.DirectFlusher, RaftLogFlusher.NoopFlusher
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RaftLogFlusher extends CloseableSilently
Configurable flush strategy for the RaftLog. You can use its implementations to improve performance at the cost of safety.

The default strategy is RaftLogFlusher.DirectFlusher, which is the safest but slowest option.

The RaftLogFlusher.NoopFlusher is the fastest but most dangerous option, as it will defer flushing to the operating system. It's then possible to run into data corruption or data loss issues. Please refer to the documentation regarding this.

DelayedFlusher can be configured to provide a trade-off between performance and safety. This will cause flushes to be performed in a delayed fashion. See its documentation for more. You should pick this if RaftLogFlusher.DirectFlusher does not provide the desired performance, but you still wish a lower likelihood of corruption issues than with RaftLogFlusher.NoopFlusher. The recommended configuration would be to find the smallest possible delay with which you achieve your performance goals.