LeastBytes is a Balancer implementation that routes messages to the partition that has received the least amount of data. Note that no coordination is done between multiple producers, having good balancing relies on the fact that each producer using a LeastBytes balancer should produce well balance
| 74 | // balancing relies on the fact that each producer using a LeastBytes balancer |
| 75 | // should produce well balanced messages. |
| 76 | type LeastBytes struct { |
| 77 | mutex sync.Mutex |
| 78 | counters []leastBytesCounter |
| 79 | } |
| 80 | |
| 81 | type leastBytesCounter struct { |
| 82 | partition int |
nothing calls this directly
no outgoing calls
no test coverage detected