Skip to main content

RepConfig

Struct RepConfig 

Source
pub struct RepConfig {
Show 17 fields pub group_name: String, pub node_name: String, pub node_host: String, pub node_port: u16, pub node_type: NodeType, pub election_timeout: Duration, pub heartbeat_interval: Duration, pub consistency_policy: ConsistencyPolicy, pub commit_durability: CommitDurability, pub env_home: Option<PathBuf>, pub quorum_policy: QuorumPolicy, pub phi_threshold: Option<f64>, pub phi_window_size: usize, pub initial_peers: Vec<RepNode>, pub election_phase_timeout: Duration, pub reconnect_config: ReconnectConfig, pub transport_kind: RepTransportKind,
}
Expand description

Configuration for a replication node.

Use the builder pattern to construct.

Fields§

§group_name: String

Name of the replication group.

§node_name: String

Name of this node within the group (must be unique).

§node_host: String

Hostname or IP address for this node.

§node_port: u16

Port for replication communication.

§node_type: NodeType

Type of this node.

§election_timeout: Duration

Timeout for elections.

§heartbeat_interval: Duration

Interval between heartbeat messages.

§consistency_policy: ConsistencyPolicy

Default consistency policy for read operations.

§commit_durability: CommitDurability

Default commit durability for replicated transactions.

The ack_timeout field on commit_durability governs the commit-side wait for replica acks; there is no separate per-RepConfig replica-ack timeout.

§env_home: Option<PathBuf>

Path to the local environment home directory (.ndb files).

When set, ReplicatedEnvironment registers a NetworkRestoreServer on the service dispatcher so that other nodes can restore from this node via the "RESTORE" service.

§quorum_policy: QuorumPolicy

Quorum policy for elections. Default: SimpleMajority.

§phi_threshold: Option<f64>

Phi accrual suspicion threshold.

None (default) uses a binary heartbeat timeout. Some(8.0) enables phi accrual detection with the paper’s recommended threshold (mistake rate ≈ 10⁻⁸).

§phi_window_size: usize

Sliding-window size for phi accrual inter-arrival samples.

Default 200 is adequate for LAN; use 1000 for WAN.

§initial_peers: Vec<RepNode>

Fully-described peers added to the replication group at startup.

Useful for pre-populating quoracle capacity/latency metadata.

§election_phase_timeout: Duration

Timeout per peer message exchange during Phase 1 and Phase 2 of an election. Default: 500 ms.

§reconnect_config: ReconnectConfig

Reconnection backoff configuration for replica partition recovery.

§transport_kind: RepTransportKind

Wire-level transport this node will use.

This field lets callers declare whether they intend to drive replication over TCP, TLS, QUIC, or the in-process crate::net::InMemoryTransport. See RepTransportKind for the variants. Defaults to RepTransportKind::Tcp for backward compatibility.

Implementations§

Source§

impl RepConfig

Source

pub fn builder( group_name: &str, node_name: &str, node_host: &str, ) -> RepConfigBuilder

Creates a builder for RepConfig.

Source

pub fn new( group_name: impl Into<String>, node_name: impl Into<String>, node_host: impl Into<String>, node_port: u16, ) -> RepConfig

Convenience constructor matching the original v1.4 shape.

Equivalent to builder(group, node, host).node_port(port).build(). Provided so doc snippets and short tests don’t need to write the full builder chain. “RepConfig::new example”).

Source

pub fn socket_address(&self) -> String

Returns the socket address string for this node.

Trait Implementations§

Source§

impl Clone for RepConfig

Source§

fn clone(&self) -> RepConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,