Skip to main content

owned_partitions

Function owned_partitions 

Source
pub fn owned_partitions(
    total_partitions: i32,
    registry: &VnodeRegistry,
    self_id: NodeId,
) -> Vec<i32>
Expand description

The Kafka partitions (of a total_partitions-partition topic) this node owns under the registry’s current assignment.

Partition p maps to vnode p % vnode_count; it is owned iff that vnode’s owner is self_id. Returned ascending. Negative partition ids (never produced by Kafka metadata) are skipped defensively.