#[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 more