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 MemorySize getSegmentSize()
      Returns the Raft log segment size.
      Returns:
      the Raft log segment size
    • setSegmentSize

      public RaftStorageConfig setSegmentSize(MemorySize segmentSize)
      Sets the Raft log segment size.
      Parameters:
      segmentSize - the Raft log segment size
      Returns:
      the partition group configuration
    • shouldFlushExplicitly

      public boolean shouldFlushExplicitly()
      Returns whether to flush logs to disk to guarantee correctness. If true, followers will flush on every append, and the leader will flush on commit.
      Returns:
      whether to flush logs to disk
    • setFlushExplicitly

      public RaftStorageConfig setFlushExplicitly(boolean flushExplicitly)
      Sets whether to flush logs to disk to guarantee correctness. If true, followers will flush on every append, and the leader will flush on commit.
      Parameters:
      flushExplicitly - whether to flush logs to disk
      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)