Class RaftPartitionConfig

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

public class RaftPartitionConfig extends Object
Configurations for a single partition.
  • Constructor Details

    • RaftPartitionConfig

      public RaftPartitionConfig()
  • Method Details

    • getElectionTimeout

      public Duration getElectionTimeout()
      Returns the Raft leader election timeout.
      Returns:
      the Raft leader election timeout
    • setElectionTimeout

      public RaftPartitionConfig setElectionTimeout(Duration electionTimeout)
      Sets the leader election timeout.
      Parameters:
      electionTimeout - the leader election timeout
      Returns:
      the Raft partition group configuration
    • getHeartbeatInterval

      public Duration getHeartbeatInterval()
      Returns the heartbeat interval.
      Returns:
      the heartbeat interval
    • setHeartbeatInterval

      public RaftPartitionConfig setHeartbeatInterval(Duration heartbeatInterval)
      Sets the heartbeat interval.
      Parameters:
      heartbeatInterval - the heartbeat interval
      Returns:
      the Raft partition group configuration
    • getMaxAppendsPerFollower

      public int getMaxAppendsPerFollower()
    • setMaxAppendsPerFollower

      public void setMaxAppendsPerFollower(int maxAppendsPerFollower)
    • getMaxAppendBatchSize

      public int getMaxAppendBatchSize()
    • setMaxAppendBatchSize

      public void setMaxAppendBatchSize(int maxAppendBatchSize)
    • isPriorityElectionEnabled

      public boolean isPriorityElectionEnabled()
    • setPriorityElectionEnabled

      public void setPriorityElectionEnabled(boolean enable)
    • getRequestTimeout

      public Duration getRequestTimeout()
    • setRequestTimeout

      public void setRequestTimeout(Duration requestTimeout)
      Sets the timeout for every requests send between the replicas.
      Parameters:
      requestTimeout - the request timeout
    • getMinStepDownFailureCount

      public int getMinStepDownFailureCount()
    • setMinStepDownFailureCount

      public void setMinStepDownFailureCount(int minStepDownFailureCount)
      If the leader is not able to reach the quorum, the leader may step down. This is triggered after minStepDownFailureCount number of requests fails to get a response from the quorum of followers as well as if the last response was received before maxQuorumResponseTime.
      Parameters:
      minStepDownFailureCount - The number of failures after which a leader considers stepping down.
    • getMaxQuorumResponseTimeout

      public Duration getMaxQuorumResponseTimeout()
    • setMaxQuorumResponseTimeout

      public void setMaxQuorumResponseTimeout(Duration maxQuorumResponseTimeout)
      If the leader is not able to reach the quorum, the leader may step down. This is triggered after minStepDownFailureCount number of requests fails to get a response from the quorum of followers as well as if the last response was received before maxQuorumResponseTime.

      When this value is zero, it uses a default value of electionTimeout * 2

      Parameters:
      maxQuorumResponseTimeout - the quorum response time out to trigger leader step down
    • getPartitionDistributor

      public PartitionDistributor getPartitionDistributor()
    • setPartitionDistributor

      public void setPartitionDistributor(PartitionDistributor partitionDistributor)
    • getPreferSnapshotReplicationThreshold

      public int getPreferSnapshotReplicationThreshold()
    • setPreferSnapshotReplicationThreshold

      public void setPreferSnapshotReplicationThreshold(int preferSnapshotReplicationThreshold)
    • toString

      public String toString()
      Overrides:
      toString in class Object