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

    • getDirectory

      public String getDirectory(String groupName)
      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

      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 * 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 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
    • setDirectory

      public RaftStorageConfig setDirectory(String directory)
      Sets the partition data directory.
      Parameters:
      directory - the partition data directory
      Returns:
      the Raft partition group configuration
    • getPersistedSnapshotStoreFactory

      public ReceivableSnapshotStoreFactory 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

      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