NewBalanceStrategySticky returns a sticky balance strategy, which assigns partitions to members with an attempt to preserve earlier assignments while maintain a balanced partition distribution. Example with topic T with six partitions (0..5) and two members (M1, M2): M1: {T: [0, 2, 4]} M2: {T: [1
()
| 162 | // M2: {T: [1, 3]} |
| 163 | // M3: {T: [4, 5]} |
| 164 | func NewBalanceStrategySticky() BalanceStrategy { |
| 165 | return &stickyBalanceStrategy{} |
| 166 | } |
| 167 | |
| 168 | // Deprecated: use NewBalanceStrategySticky to avoid data race issue |
| 169 | var BalanceStrategySticky = NewBalanceStrategySticky() |
no outgoing calls