-------------------------------------------------------------------- BalanceStrategy is used to balance topics and partitions across members of a consumer group
| 45 | // BalanceStrategy is used to balance topics and partitions |
| 46 | // across members of a consumer group |
| 47 | type BalanceStrategy interface { |
| 48 | // Name uniquely identifies the strategy. |
| 49 | Name() string |
| 50 | |
| 51 | // Plan accepts a map of `memberID -> metadata` and a map of `topic -> partitions` |
| 52 | // and returns a distribution plan. |
| 53 | Plan(members map[string]ConsumerGroupMemberMetadata, topics map[string][]int32) (BalanceStrategyPlan, error) |
| 54 | |
| 55 | // AssignmentData returns the serialized assignment data for the specified |
| 56 | // memberID |
| 57 | AssignmentData(memberID string, topics map[string][]int32, generationID int32) ([]byte, error) |
| 58 | } |
| 59 | |
| 60 | // SubscriptionUserDataBalanceStrategy is an optional extension of |
| 61 | // BalanceStrategy that lets a strategy inject per-cycle metadata into the |
no outgoing calls
no test coverage detected