pub enum ClusterCommand {
AddNode {
node_id: NodeId,
raft_id: u64,
addr: String,
is_primary: bool,
},
RemoveNode {
node_id: NodeId,
},
AssignSlots {
node_id: NodeId,
slots: Vec<SlotRange>,
},
RemoveSlots {
node_id: NodeId,
slots: Vec<SlotRange>,
},
PromoteReplica {
replica_id: NodeId,
},
BeginMigration {
slot: u16,
from: NodeId,
to: NodeId,
},
CompleteMigration {
slot: u16,
new_owner: NodeId,
},
}Expand description
Commands that modify cluster configuration.
These are replicated through Raft to ensure all nodes agree on the cluster topology.
Variants§
AddNode
Add a new node to the cluster.
RemoveNode
Remove a node from the cluster.
AssignSlots
Assign slots to a node.
RemoveSlots
Remove specific slots from a node.
PromoteReplica
Promote a replica to primary (during failover).
BeginMigration
Mark a slot as migrating.
CompleteMigration
Complete a slot migration.
Trait Implementations§
Source§impl Clone for ClusterCommand
impl Clone for ClusterCommand
Source§fn clone(&self) -> ClusterCommand
fn clone(&self) -> ClusterCommand
Returns a duplicate of the value. Read more
1.0.0 · 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 ClusterCommand
impl Debug for ClusterCommand
Source§impl<'de> Deserialize<'de> for ClusterCommand
impl<'de> Deserialize<'de> for ClusterCommand
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ClusterCommand
impl PartialEq for ClusterCommand
Source§impl Serialize for ClusterCommand
impl Serialize for ClusterCommand
impl Eq for ClusterCommand
impl StructuralPartialEq for ClusterCommand
Auto Trait Implementations§
impl Freeze for ClusterCommand
impl RefUnwindSafe for ClusterCommand
impl Send for ClusterCommand
impl Sync for ClusterCommand
impl Unpin for ClusterCommand
impl UnsafeUnpin for ClusterCommand
impl UnwindSafe for ClusterCommand
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