Interface ConfigParams
-
- All Known Implementing Classes:
DefaultConfigParamsImpl
public interface ConfigParams
Configuration Parameter interface for configuring the Raft consensus systemAny component using this implementation might want to provide an implementation of this interface to configure
A default implementation will be used if none is provided.
- Author:
- Kamal Rameshan
-
-
Field Summary
Fields Modifier and Type Field Description static int
MEGABYTE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getCandidateElectionTimeoutDivisor()
Returns the number by which a candidate should divide the election timeout it has calculated.String
getCustomRaftPolicyImplementationClass()
Returns the custom RaftPolicy class name.long
getElectionTimeoutFactor()
Returns the multiplication factor to be used to determine the shard election timeout.scala.concurrent.duration.FiniteDuration
getElectionTimeOutInterval()
Returns the interval after which a new election should be triggered if no leader is available.int
getElectionTimeVariance()
Returns the maximum election time variance.int
getFileBackedStreamingThreshold()
Returns the threshold in terms of number of bytes when streaming data before it should switch from storing in memory to buffering to a file.scala.concurrent.duration.FiniteDuration
getHeartBeatInterval()
Returns the interval at which a heart beat message should be sent to remote followers.long
getIsolatedCheckIntervalInMillis()
Returns the interval in which the leader needs to check if its isolated.int
getJournalRecoveryLogBatchSize()
Returns the maximum number of journal log entries to batch on recovery before applying.@NonNull PeerAddressResolver
getPeerAddressResolver()
Returns the PeerAddressResolver.@NonNull RaftPolicy
getRaftPolicy()
Returns the RaftPolicy used to determine certain Raft behaviors.long
getSnapshotBatchCount()
Returns the minimum number of entries to be present in the in-memory Raft log for a snapshot to be taken.int
getSnapshotChunkSize()
Returns the maximum size (in bytes) for the snapshot chunk sent from a Leader.int
getSnapshotDataThresholdPercentage()
Returns the percentage of total memory used in the in-memory Raft log before a snapshot should be taken.long
getSyncIndexThreshold()
Returns the threshold in terms of number journal entries that we can lag behind a leader until we raise a 'not synced' transition.@NonNull String
getTempFileDirectory()
Returns the directory in which to create temp files.
-
-
-
Field Detail
-
MEGABYTE
static final int MEGABYTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSnapshotBatchCount
long getSnapshotBatchCount()
Returns the minimum number of entries to be present in the in-memory Raft log for a snapshot to be taken.- Returns:
- the minimum number of entries.
-
getSnapshotDataThresholdPercentage
int getSnapshotDataThresholdPercentage()
Returns the percentage of total memory used in the in-memory Raft log before a snapshot should be taken.- Returns:
- the percentage.
-
getHeartBeatInterval
scala.concurrent.duration.FiniteDuration getHeartBeatInterval()
Returns the interval at which a heart beat message should be sent to remote followers.- Returns:
- the interval as a FiniteDuration.
-
getElectionTimeOutInterval
scala.concurrent.duration.FiniteDuration getElectionTimeOutInterval()
Returns the interval after which a new election should be triggered if no leader is available.- Returns:
- the interval as a FiniteDuration.
-
getCandidateElectionTimeoutDivisor
long getCandidateElectionTimeoutDivisor()
Returns the number by which a candidate should divide the election timeout it has calculated. This serves to speed up retries when elections result in a stalemate.- Returns:
- the interval as a FiniteDuration.
-
getElectionTimeVariance
int getElectionTimeVariance()
Returns the maximum election time variance. The election is scheduled using both the election timeout and variance.- Returns:
- the election time variance.
-
getSnapshotChunkSize
int getSnapshotChunkSize()
Returns the maximum size (in bytes) for the snapshot chunk sent from a Leader.- Returns:
- the maximum size (in bytes).
-
getJournalRecoveryLogBatchSize
int getJournalRecoveryLogBatchSize()
Returns the maximum number of journal log entries to batch on recovery before applying.- Returns:
- the maximum number of journal log entries.
-
getIsolatedCheckIntervalInMillis
long getIsolatedCheckIntervalInMillis()
Returns the interval in which the leader needs to check if its isolated.- Returns:
- the interval in ms.
-
getElectionTimeoutFactor
long getElectionTimeoutFactor()
Returns the multiplication factor to be used to determine the shard election timeout. The election timeout is determined by multiplying the election timeout factor with the heart beat duration.- Returns:
- the election timeout factor.
-
getRaftPolicy
@NonNull RaftPolicy getRaftPolicy()
Returns the RaftPolicy used to determine certain Raft behaviors.- Returns:
- an instance of RaftPolicy, if set, or an instance of the DefaultRaftPolicy.
-
getPeerAddressResolver
@NonNull PeerAddressResolver getPeerAddressResolver()
Returns the PeerAddressResolver.- Returns:
- the PeerAddressResolver instance.
-
getCustomRaftPolicyImplementationClass
String getCustomRaftPolicyImplementationClass()
Returns the custom RaftPolicy class name.- Returns:
- the RaftPolicy class name or null if none set.
-
getTempFileDirectory
@NonNull String getTempFileDirectory()
Returns the directory in which to create temp files.- Returns:
- the directory in which to create temp files.
-
getFileBackedStreamingThreshold
int getFileBackedStreamingThreshold()
Returns the threshold in terms of number of bytes when streaming data before it should switch from storing in memory to buffering to a file.- Returns:
- the threshold in terms of number of bytes.
-
getSyncIndexThreshold
long getSyncIndexThreshold()
Returns the threshold in terms of number journal entries that we can lag behind a leader until we raise a 'not synced' transition.- Returns:
- the threshold in terms of number of journal entries.
-
-