Package io.atomix.raft.partition
Class RaftStorageConfig
java.lang.Object
io.atomix.raft.partition.RaftStorageConfig
Raft storage configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theRaftLogFlusher.Factoryto create a new flushing strategy for theRaftLogwhen *io.atomix.raft.storage.RaftStorage#openLog(ThreadContext)is called.getDirectory(String groupName) Returns the partition data directory.longReturns the minimum free disk space buffer to leave when allocating a new segmentintReturns the current snapshot store factory.longReturns the Raft log segment size.booleansetDirectory(String directory) Sets the partition data directory.setFlusherFactory(RaftLogFlusher.Factory flusherFactory) Sets theRaftLogFlusher.Factoryto create a new flushing strategy for theRaftLogwhenio.atomix.raft.storage.RaftStorage#openLog(ThreadContext)is called.setFreeDiskSpace(long freeDiskSpace) Sets the minimum free disk space buffersetJournalIndexDensity(int journalIndexDensity) setPersistedSnapshotStoreFactory(ReceivableSnapshotStoreFactory persistedSnapshotStoreFactory) Sets the snapshot store factory.voidsetPreallocateSegmentFiles(boolean preallocateSegmentFiles) Sets whether segment files are pre-allocated at creation.setSegmentSize(long segmentSizeBytes) Sets the Raft log segment size.toString()
-
Constructor Details
-
RaftStorageConfig
public RaftStorageConfig()
-
-
Method Details
-
getDirectory
Returns the partition data directory.- Parameters:
groupName- the partition group name- Returns:
- the partition data directory
-
getSegmentSize
public long getSegmentSize()Returns the Raft log segment size.- Returns:
- the Raft log segment size
-
setSegmentSize
Sets the Raft log segment size.- Parameters:
segmentSizeBytes- the Raft log segment size- Returns:
- the partition group configuration
-
flusherFactory
Returns theRaftLogFlusher.Factoryto create a new flushing strategy for theRaftLogwhen *io.atomix.raft.storage.RaftStorage#openLog(ThreadContext)is called.- Returns:
- the flusher factory for this storage
-
setFlusherFactory
Sets theRaftLogFlusher.Factoryto create a new flushing strategy for theRaftLogwhenio.atomix.raft.storage.RaftStorage#openLog(ThreadContext)is called.- Parameters:
flusherFactory- factory to create the flushing strategy for theRaftLog- Returns:
- the Raft partition group configuration
-
setDirectory
Sets the partition data directory.- Parameters:
directory- the partition data directory- Returns:
- the Raft partition group configuration
-
getPersistedSnapshotStoreFactory
Returns the current snapshot store factory.- Returns:
- the snapshot store factory
-
setPersistedSnapshotStoreFactory
public RaftStorageConfig setPersistedSnapshotStoreFactory(ReceivableSnapshotStoreFactory persistedSnapshotStoreFactory) Sets the snapshot store factory.- Parameters:
persistedSnapshotStoreFactory- the new snapshot store factory- Returns:
- the Raft storage configuration
-
getFreeDiskSpace
public long getFreeDiskSpace()Returns the minimum free disk space buffer to leave when allocating a new segment- Returns:
- free disk buffer
-
setFreeDiskSpace
Sets the minimum free disk space buffer- Parameters:
freeDiskSpace-- Returns:
-
getJournalIndexDensity
public int getJournalIndexDensity() -
setJournalIndexDensity
-
isPreallocateSegmentFiles
public boolean isPreallocateSegmentFiles()- Returns:
- true to preallocate segment files, false otherwise
-
setPreallocateSegmentFiles
public void setPreallocateSegmentFiles(boolean preallocateSegmentFiles) Sets whether segment files are pre-allocated at creation. If true, segment files are pre-allocated tosegmentSizeat creation before any writes happen.- Parameters:
preallocateSegmentFiles- true to preallocate files, false otherwise
-
toString
-