Skip to main content

homogeneous_member_quotas

Function homogeneous_member_quotas 

Source
pub fn homogeneous_member_quotas(
    minimum_quota: usize,
    extra_quotas: usize,
    owned: &[usize],
) -> Vec<HomogeneousMemberQuota>
Expand description

Every member’s quota in the homogeneous builder, in member order.

owned[i] is how many partitions of the subscribed topics member i holds in its current target assignment. The contract states Kafka’s balance-then-stickiness rule:

  • Balance: each member’s target is minimum_quota or minimum_quota + 1, and exactly extra_quotas members get the larger target, because no extra partition is left unclaimed after the last member.
  • Stickiness: each member keeps as much of its current ownership as its target allows, and receives only the difference.
  • The extra slots go by keeps_extra_quota, in member order.