public static class SegmentedJournal.Builder<E> extends Object implements io.atomix.utils.Builder<SegmentedJournal<E>>
| Modifier and Type | Method and Description |
|---|---|
SegmentedJournal<E> |
build()
Builds the journal.
|
SegmentedJournal.Builder<E> |
withDirectory(File directory)
Sets the log directory, returning the builder for method chaining.
|
SegmentedJournal.Builder<E> |
withDirectory(String directory)
Sets the log directory, returning the builder for method chaining.
|
SegmentedJournal.Builder<E> |
withMaxEntriesPerSegment(int maxEntriesPerSegment)
Sets the maximum number of allows entries per segment, returning the builder for method chaining.
|
SegmentedJournal.Builder<E> |
withMaxSegmentSize(int maxSegmentSize)
Sets the maximum segment size in bytes, returning the builder for method chaining.
|
SegmentedJournal.Builder<E> |
withName(String name)
Sets the storage name.
|
SegmentedJournal.Builder<E> |
withSerializer(io.atomix.utils.serializer.Serializer serializer)
Sets the journal serializer, returning the builder for method chaining.
|
SegmentedJournal.Builder<E> |
withStorageLevel(StorageLevel storageLevel)
Sets the log storage level, returning the builder for method chaining.
|
public SegmentedJournal.Builder<E> withName(String name)
name - The storage name.public SegmentedJournal.Builder<E> withStorageLevel(StorageLevel storageLevel)
The storage level indicates how individual entries should be persisted in the journal.
storageLevel - The log storage level.public SegmentedJournal.Builder<E> withDirectory(String directory)
The log will write segment files into the provided directory.
directory - The log directory.NullPointerException - If the directory is nullpublic SegmentedJournal.Builder<E> withDirectory(File directory)
The log will write segment files into the provided directory.
directory - The log directory.NullPointerException - If the directory is nullpublic SegmentedJournal.Builder<E> withSerializer(io.atomix.utils.serializer.Serializer serializer)
serializer - The journal serializer.public SegmentedJournal.Builder<E> 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 SegmentedJournal.Builder<E> 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 SegmentedJournal<E> build()
build in interface io.atomix.utils.Builder<SegmentedJournal<E>>Copyright © 2013–2018. All rights reserved.