Class RaftStorageConfig

java.lang.Object
io.atomix.raft.partition.RaftStorageConfig

public class RaftStorageConfig extends Object
Raft storage configuration.
  • Constructor Details

    • RaftStorageConfig

      public RaftStorageConfig()
  • Method Details

    • getSegmentSize

      public long getSegmentSize()
      Returns the Raft log segment size.
      Returns:
      the Raft log segment size
    • setSegmentSize

      public RaftStorageConfig setSegmentSize(long segmentSizeBytes)
      Sets the Raft log segment size.
      Parameters:
      segmentSizeBytes - the Raft log segment size
      Returns:
      the partition group configuration
    • flusherFactory

      public RaftLogFlusher.Factory flusherFactory()
      Returns the RaftLogFlusher.Factory to create a new flushing strategy for the RaftLog when *
      invalid reference
      io.atomix.raft.storage.RaftStorage#openLog(ThreadContext)
      is called.
      Returns:
      the flusher factory for this storage
    • setFlusherFactory

      public RaftStorageConfig setFlusherFactory(RaftLogFlusher.Factory flusherFactory)
      Sets the RaftLogFlusher.Factory to create a new flushing strategy for the RaftLog when
      invalid reference
      io.atomix.raft.storage.RaftStorage#openLog(ThreadContext)
      is called.
      Parameters:
      flusherFactory - factory to create the flushing strategy for the RaftLog
      Returns:
      the Raft partition group configuration
    • getFreeDiskSpace

      public long getFreeDiskSpace()
      Returns the minimum free disk space buffer to leave when allocating a new segment
      Returns:
      free disk buffer
    • setFreeDiskSpace

      public RaftStorageConfig setFreeDiskSpace(long freeDiskSpace)
      Sets the minimum free disk space buffer
      Parameters:
      freeDiskSpace -
      Returns:
    • getJournalIndexDensity

      public int getJournalIndexDensity()
    • setJournalIndexDensity

      public RaftStorageConfig setJournalIndexDensity(int journalIndexDensity)
    • 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 to segmentSize at creation before any writes happen.
      Parameters:
      preallocateSegmentFiles - true to preallocate files, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object