pub struct ClusterState {
pub self_node: String,
pub members: BTreeMap<String, Member>,
}Expand description
Immutable current membership snapshot.
Fields§
§self_node: StringLocal node id for the node that produced this view.
members: BTreeMap<String, Member>Members keyed by logical node id.
Implementations§
Source§impl ClusterState
impl ClusterState
Sourcepub fn up_members(&self) -> Vec<&Member>
pub fn up_members(&self) -> Vec<&Member>
Return all members currently in Up state and reachable.
Sourcepub fn placement_coordinator(&self) -> Option<&Member>
pub fn placement_coordinator(&self) -> Option<&Member>
Return the deterministic placement coordinator for this membership view.
Datum v0.10 mirrors Akka’s “oldest member” coordinator convention without adding a consensus protocol. C1 does not assign Akka-style up numbers, so the ordering key is the propagated member incarnation, then node id. Every node computes the same answer from the same C1 view. Under a partition and timeout downing, different views can transiently produce different coordinators; quorum or lease fencing is a v0.11+ follow-up.
Sourcepub fn is_placement_coordinator(&self, node_id: &str) -> bool
pub fn is_placement_coordinator(&self, node_id: &str) -> bool
Return true when node_id is the coordinator in this view.
Trait Implementations§
Source§impl Clone for ClusterState
impl Clone for ClusterState
Source§fn clone(&self) -> ClusterState
fn clone(&self) -> ClusterState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClusterState
impl Debug for ClusterState
impl Eq for ClusterState
Source§impl PartialEq for ClusterState
impl PartialEq for ClusterState
impl StructuralPartialEq for ClusterState
Auto Trait Implementations§
impl Freeze for ClusterState
impl RefUnwindSafe for ClusterState
impl Send for ClusterState
impl Sync for ClusterState
impl Unpin for ClusterState
impl UnsafeUnpin for ClusterState
impl UnwindSafe for ClusterState
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage