pub enum MetadataCommand {
Show 15 variants
CreateTopic {
config: TopicConfig,
partition_assignments: Vec<Vec<NodeId>>,
},
DeleteTopic {
name: String,
},
UpdateTopicConfig {
name: String,
config: HashMap<String, String>,
},
AddPartitions {
topic: String,
new_assignments: Vec<Vec<NodeId>>,
},
UpdatePartitionLeader {
partition: PartitionId,
leader: NodeId,
epoch: u64,
},
UpdatePartitionIsr {
partition: PartitionId,
isr: Vec<NodeId>,
leader_epoch: u64,
},
ReassignPartition {
partition: PartitionId,
replicas: Vec<NodeId>,
},
RegisterNode {
info: NodeInfo,
},
DeregisterNode {
node_id: NodeId,
},
UpdateNode {
node_id: NodeId,
info: NodeInfo,
},
UpdateClusterConfig {
config: HashMap<String, String>,
},
UpdateConsumerGroup {
group: ConsumerGroup,
},
DeleteConsumerGroup {
group_id: GroupId,
},
Noop,
Batch(Vec<MetadataCommand>),
}Expand description
Raft log entry types for metadata operations
Variants§
CreateTopic
Create a new topic
DeleteTopic
Delete a topic
UpdateTopicConfig
Update topic configuration
AddPartitions
Add partitions to existing topic
UpdatePartitionLeader
Update partition leader
UpdatePartitionIsr
Update partition ISR (includes leader epoch for fencing)
Fields
partition: PartitionIdReassignPartition
Reassign partition replicas
RegisterNode
Register a new node
DeregisterNode
Deregister a node
UpdateNode
Update node metadata
UpdateClusterConfig
Update cluster-wide configuration
UpdateConsumerGroup
Update consumer group state (full snapshot)
Fields
group: ConsumerGroupDeleteConsumerGroup
Delete consumer group
Noop
No-op (for heartbeats/leader election)
Batch(Vec<MetadataCommand>)
Batch of commands applied in a single Raft consensus round.
Semantics: best-effort — each command is applied independently. Some commands may succeed while others fail. The batch is atomic at the Raft log level (single entry, single fsync), but individual commands can return errors without rolling back prior successes.
Used by propose_batch for higher throughput.
Trait Implementations§
Source§impl Clone for MetadataCommand
impl Clone for MetadataCommand
Source§fn clone(&self) -> MetadataCommand
fn clone(&self) -> MetadataCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetadataCommand
impl Debug for MetadataCommand
Source§impl<'de> Deserialize<'de> for MetadataCommand
impl<'de> Deserialize<'de> for MetadataCommand
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>,
Source§impl PartialEq for MetadataCommand
impl PartialEq for MetadataCommand
Source§impl Serialize for MetadataCommand
impl Serialize for MetadataCommand
impl Eq for MetadataCommand
impl StructuralPartialEq for MetadataCommand
Auto Trait Implementations§
impl Freeze for MetadataCommand
impl RefUnwindSafe for MetadataCommand
impl Send for MetadataCommand
impl Sync for MetadataCommand
impl Unpin for MetadataCommand
impl UnsafeUnpin for MetadataCommand
impl UnwindSafe for MetadataCommand
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.