#[non_exhaustive]pub enum ClusterEvent {
PeerUp {
peer_id: PeerId,
dc: String,
ts: SystemTime,
},
PeerDown {
peer_id: PeerId,
dc: String,
phi: f64,
ts: SystemTime,
},
GossipRoundComplete {
duration: Duration,
peers_seen: usize,
ts: SystemTime,
},
AaeExchangeStarted {
with_peer: PeerId,
partition: TokenRange,
ts: SystemTime,
},
AaeExchangeCompleted {
with_peer: PeerId,
partition: TokenRange,
repaired: u64,
ts: SystemTime,
},
RestartObserved {
peer_id: PeerId,
ts: SystemTime,
},
RingChanged {
tag: String,
ts: SystemTime,
},
}Expand description
Structured cluster-event payload published on the
EventManager broadcast.
Variants are non-exhaustive at the type level; consumers must always include a wildcard arm so future additions remain non-breaking.
§Examples
use std::time::SystemTime;
use dynomite::events::ClusterEvent;
let e = ClusterEvent::PeerUp { peer_id: 1, dc: "dc1".into(), ts: SystemTime::now() };
match e {
ClusterEvent::PeerUp { peer_id, .. } => assert_eq!(peer_id, 1),
_ => panic!("unexpected"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PeerUp
A peer transitioned to a routable state.
Fields
ts: SystemTimeWall-clock timestamp at which the engine observed the transition.
PeerDown
A peer transitioned to an unroutable state because the failure detector crossed its phi threshold.
Fields
ts: SystemTimeWall-clock timestamp at which the engine observed the transition.
GossipRoundComplete
One periodic gossip pass finished.
Fields
ts: SystemTimeWall-clock timestamp at which the round finished.
AaeExchangeStarted
An anti-entropy exchange started against a peer.
Fields
partition: TokenRangeToken range the exchange covers.
ts: SystemTimeWall-clock timestamp at which the exchange started.
AaeExchangeCompleted
An anti-entropy exchange finished against a peer.
Fields
partition: TokenRangeToken range the exchange covered.
ts: SystemTimeWall-clock timestamp at which the exchange finished.
RestartObserved
A peer was observed restarting (its incarnation changed or its peering session was re-established after a clean shutdown).
Fields
ts: SystemTimeWall-clock timestamp at which the restart was observed.
RingChanged
The token ring topology changed: a peer was added, removed, or its tokens were reassigned.
Fields
tag: StringFree-form tag describing the trigger (e.g.
"seed-discovery", "reconfigure", "shutdown").
ts: SystemTimeWall-clock timestamp at which the change was applied.
Trait Implementations§
Source§impl Clone for ClusterEvent
impl Clone for ClusterEvent
Source§fn clone(&self) -> ClusterEvent
fn clone(&self) -> ClusterEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClusterEvent
impl RefUnwindSafe for ClusterEvent
impl Send for ClusterEvent
impl Sync for ClusterEvent
impl Unpin for ClusterEvent
impl UnsafeUnpin for ClusterEvent
impl UnwindSafe for ClusterEvent
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.