pub struct RaftConfig {
pub replication: ReplicationConfig,
pub election: ElectionConfig,
pub membership: MembershipConfig,
pub commit_handler: CommitHandlerConfig,
pub snapshot: SnapshotConfig,
pub persistence: PersistenceConfig,
pub learner_catchup_threshold: u64,
pub general_raft_timeout_duration_in_ms: u64,
pub snapshot_rpc_timeout_ms: u64,
pub auto_join: AutoJoinConfig,
}
Expand description
Configuration parameters for the Raft consensus algorithm implementation
Fields§
§replication: ReplicationConfig
Configuration settings related to log replication Includes parameters like replication batch size and network retry behavior
election: ElectionConfig
Configuration settings for leader election mechanism Controls timeouts and randomization factors for election timing
membership: MembershipConfig
Configuration settings for cluster membership changes Handles joint consensus transitions and cluster reconfiguration rules
commit_handler: CommitHandlerConfig
Configuration settings for commit application handling Controls how committed log entries are applied to the state machine
snapshot: SnapshotConfig
Configuration settings for snapshot feature
persistence: PersistenceConfig
Configuration settings for log persistence behavior Controls how and when log entries are persisted to stable storage
learner_catchup_threshold: u64
Maximum allowed log entry gap between leader and learner nodes Learners with larger gaps than this value will trigger catch-up replication Default value is set via default_learner_catchup_threshold() function
general_raft_timeout_duration_in_ms: u64
Base timeout duration (in milliseconds) for general Raft operations Used as fallback timeout when operation-specific timeouts are not set Default value is set via default_general_timeout() function
snapshot_rpc_timeout_ms: u64
Timeout for snapshot RPC operations (milliseconds)
auto_join: AutoJoinConfig
Configuration settings for new node auto join feature
Implementations§
Trait Implementations§
Source§impl Clone for RaftConfig
impl Clone for RaftConfig
Source§fn clone(&self) -> RaftConfig
fn clone(&self) -> RaftConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RaftConfig
impl Debug for RaftConfig
Source§impl Default for RaftConfig
impl Default for RaftConfig
Source§impl<'de> Deserialize<'de> for RaftConfig
impl<'de> Deserialize<'de> for RaftConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RaftConfig
impl RefUnwindSafe for RaftConfig
impl Send for RaftConfig
impl Sync for RaftConfig
impl Unpin for RaftConfig
impl UnwindSafe for RaftConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request