| Modifier and Type | Method and Description |
|---|---|
RaftLog |
build() |
RaftLog.Builder |
withDirectory(File directory)
Sets the log directory, returning the builder for method chaining.
|
RaftLog.Builder |
withDirectory(String directory)
Sets the log directory, returning the builder for method chaining.
|
RaftLog.Builder |
withFlushOnCommit()
Enables flushing buffers to disk when entries are committed to a segment, returning the builder
for method chaining.
|
RaftLog.Builder |
withFlushOnCommit(boolean flushOnCommit)
Sets whether to flush buffers to disk when entries are committed to a segment, returning the builder
for method chaining.
|
RaftLog.Builder |
withMaxEntriesPerSegment(int maxEntriesPerSegment)
Sets the maximum number of allows entries per segment, returning the builder for method chaining.
|
RaftLog.Builder |
withMaxSegmentSize(int maxSegmentSize)
Sets the maximum segment size in bytes, returning the builder for method chaining.
|
RaftLog.Builder |
withName(String name)
Sets the storage name.
|
RaftLog.Builder |
withSerializer(io.atomix.serializer.Serializer serializer)
Sets the journal serializer, returning the builder for method chaining.
|
RaftLog.Builder |
withStorageLevel(io.atomix.storage.StorageLevel storageLevel)
Sets the log storage level, returning the builder for method chaining.
|
public RaftLog.Builder withName(String name)
name - The storage name.public RaftLog.Builder withStorageLevel(io.atomix.storage.StorageLevel storageLevel)
The storage level indicates how individual entries should be persisted in the journal.
storageLevel - The log storage level.public RaftLog.Builder withDirectory(String directory)
The log will write segment files into the provided directory.
directory - The log directory.NullPointerException - If the directory is nullpublic RaftLog.Builder withDirectory(File directory)
The log will write segment files into the provided directory.
directory - The log directory.NullPointerException - If the directory is nullpublic RaftLog.Builder withSerializer(io.atomix.serializer.Serializer serializer)
serializer - The journal serializer.public RaftLog.Builder withMaxSegmentSize(int maxSegmentSize)
The maximum segment size dictates when logs should roll over to new segments. As entries are written to a segment of the log, once the size of the segment surpasses the configured maximum segment size, the log will create a new segment and append new entries to that segment.
By default, the maximum segment size is 1024 * 1024 * 32.
maxSegmentSize - The maximum segment size in bytes.IllegalArgumentException - If the maxSegmentSize is not positivepublic RaftLog.Builder withMaxEntriesPerSegment(int maxEntriesPerSegment)
The maximum entry count dictates when logs should roll over to new segments. As entries are written to a segment of the log, if the entry count in that segment meets the configured maximum entry count, the log will create a new segment and append new entries to that segment.
By default, the maximum entries per segment is 1024 * 1024.
maxEntriesPerSegment - The maximum number of entries allowed per segment.IllegalArgumentException - If the maxEntriesPerSegment not greater than the default max entries per
segmentpublic RaftLog.Builder withFlushOnCommit()
When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time an entry is committed in a given segment.
public RaftLog.Builder withFlushOnCommit(boolean flushOnCommit)
When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time an entry is committed in a given segment.
flushOnCommit - Whether to flush buffers to disk when entries are committed to a segment.Copyright © 2013–2017. All rights reserved.