MCPcopy
hub / github.com/segmentio/kafka-go / LeastBytes

Struct LeastBytes

balancer.go:76–79  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

74// balancing relies on the fact that each producer using a LeastBytes balancer
75// should produce well balanced messages.
76type LeastBytes struct {
77 mutex sync.Mutex
78 counters []leastBytesCounter
79}
80
81type leastBytesCounter struct {
82 partition int

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected