NewCooperativeActiveStickyBalancer creates a balancer that combines Kafka's cooperative sticky balancing with partition ring awareness. It works by: 1. Using the partition ring to determine which partitions are "active" (i.e. should be processed) 2. Filtering out inactive partitions from member ass
(partitionRing ring.PartitionRingReader)
| 32 | // rebalancing when the set of active partitions changes. This ensures optimal partition distribution |
| 33 | // as the active partition set evolves. |
| 34 | func NewCooperativeActiveStickyBalancer(partitionRing ring.PartitionRingReader) kgo.GroupBalancer { |
| 35 | return &cooperativeActiveStickyBalancer{ |
| 36 | GroupBalancer: kgo.CooperativeStickyBalancer(), |
| 37 | partitionRing: partitionRing, |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func (*cooperativeActiveStickyBalancer) ProtocolName() string { |
| 42 | return "cooperative-active-sticky" |
no outgoing calls
no test coverage detected