pub struct ClusterConfig {Show 14 fields
pub node_id: String,
pub roles: Vec<String>,
pub bind_addr: SocketAddr,
pub advertise_addr: SocketAddr,
pub agent_addr: Option<SocketAddr>,
pub seed_nodes: Vec<SocketAddr>,
pub gossip_interval: Duration,
pub probe_timeout: Duration,
pub suspect_timeout: Duration,
pub downing_timeout: Duration,
pub remove_down_after: Duration,
pub max_packet_size: usize,
pub event_buffer: usize,
pub request_timeout: Duration,
}Expand description
Configuration for one Datum cluster member.
Fields§
§node_id: StringStable logical node id used by Datum control-plane APIs.
roles: Vec<String>Akka-style role labels advertised in membership gossip.
bind_addr: SocketAddrLocal UDP address used for membership gossip.
advertise_addr: SocketAddrAddress peers should use to contact this node. If the port is 0, the
bound UDP port is substituted at startup.
agent_addr: Option<SocketAddr>DCP agent address peers should use for node-to-node control sessions.
ClusterAgent fills this from the bound DCP listener when it starts the
agent and membership together. Bare membership nodes may leave it empty.
seed_nodes: Vec<SocketAddr>Seed node UDP addresses. The seed identity is resolved by foca from the first announce reply, so only addresses are required here.
gossip_interval: DurationFoca probe period and periodic gossip cadence.
probe_timeout: DurationDirect probe round-trip timeout before foca asks indirect probes.
suspect_timeout: DurationFoca suspect-to-down timeout. Keep this longer than the downing timeout
when TimeoutDowning should make the public downing decision first.
downing_timeout: DurationDefault timeout used by crate::TimeoutDowning.
remove_down_after: DurationHow long foca remembers down identities before accepting the exact same identity again. New incarnations can rejoin before this expires.
max_packet_size: usizeMaximum UDP packet size foca will produce and consume.
event_buffer: usizeBounded event-feed capacity for crate::MemberEvent subscribers.
request_timeout: DurationTimeout for leave() and abort() oneshot replies.
Implementations§
Source§impl ClusterConfig
impl ClusterConfig
Sourcepub fn new(node_id: impl Into<String>) -> Self
pub fn new(node_id: impl Into<String>) -> Self
Create a config with loopback defaults and no seed nodes.
Sourcepub fn with_roles(
self,
roles: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_roles( self, roles: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Return a copy using the supplied roles.
Sourcepub fn with_seed_nodes(
self,
seed_nodes: impl IntoIterator<Item = SocketAddr>,
) -> Self
pub fn with_seed_nodes( self, seed_nodes: impl IntoIterator<Item = SocketAddr>, ) -> Self
Return a copy using the supplied seed-node addresses.
Trait Implementations§
Source§impl Clone for ClusterConfig
impl Clone for ClusterConfig
Source§fn clone(&self) -> ClusterConfig
fn clone(&self) -> ClusterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more