Package io.atomix.raft.partition
Class RaftPartitionConfig
java.lang.Object
io.atomix.raft.partition.RaftPartitionConfig
Configurations for a single partition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Raft leader election timeout.Returns the heartbeat interval.intintintintintbooleanvoidsetConfigurationChangeTimeout(Duration configurationChangeTimeout) setElectionTimeout(Duration electionTimeout) Sets the leader election timeout.voidsetEntryValidator(EntryValidator entryValidator) setHeartbeatInterval(Duration heartbeatInterval) Sets the heartbeat interval.voidsetMaxAppendBatchSize(int maxAppendBatchSize) voidsetMaxAppendsPerFollower(int maxAppendsPerFollower) voidsetMaxQuorumResponseTimeout(Duration maxQuorumResponseTimeout) If the leader is not able to reach the quorum, the leader may step down.voidsetMinStepDownFailureCount(int minStepDownFailureCount) If the leader is not able to reach the quorum, the leader may step down.voidsetPreferSnapshotReplicationThreshold(int preferSnapshotReplicationThreshold) voidsetPriorityElectionEnabled(boolean enable) voidsetRequestTimeout(Duration requestTimeout) Sets the timeout for every requests send between the replicas.voidsetSnapshotChunkSize(int snapshotChunkSize) voidsetSnapshotRequestTimeout(Duration snapshotRequestTimeout) Sets the timeout for every snapshot request sent by raft leaders to the followers.voidsetStorageConfig(RaftStorageConfig storageConfig) toString()
-
Constructor Details
-
RaftPartitionConfig
public RaftPartitionConfig()
-
-
Method Details
-
getElectionTimeout
Returns the Raft leader election timeout.- Returns:
- the Raft leader election timeout
-
setElectionTimeout
Sets the leader election timeout.- Parameters:
electionTimeout- the leader election timeout- Returns:
- the Raft partition group configuration
-
getHeartbeatInterval
Returns the heartbeat interval.- Returns:
- the heartbeat interval
-
setHeartbeatInterval
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
-
setRequestTimeout
Sets the timeout for every requests send between the replicas.- Parameters:
requestTimeout- the request timeout
-
getSnapshotRequestTimeout
-
setSnapshotRequestTimeout
Sets the timeout for every snapshot request sent by raft leaders to the followers.- Parameters:
snapshotRequestTimeout- the request timeout
-
getSnapshotChunkSize
public int getSnapshotChunkSize() -
setSnapshotChunkSize
public void setSnapshotChunkSize(int snapshotChunkSize) -
getConfigurationChangeTimeout
-
setConfigurationChangeTimeout
-
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
-
setMaxQuorumResponseTimeout
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
-
getPreferSnapshotReplicationThreshold
public int getPreferSnapshotReplicationThreshold() -
setPreferSnapshotReplicationThreshold
public void setPreferSnapshotReplicationThreshold(int preferSnapshotReplicationThreshold) -
getStorageConfig
-
setStorageConfig
-
getEntryValidator
-
setEntryValidator
-
toString
-