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

Method Balance

balancer.go:25–25  ·  view source on GitHub ↗

Balance receives a message and a set of available partitions and returns the partition number that the message should be routed to. An application should refrain from using a balancer to manage multiple sets of partitions (from different topics for examples), use one balancer instance for each part

(msg Message, partitions ...int)

Source from the content-addressed store, hash-verified

23 // instance for each partition set, so the balancer can detect when the
24 // partitions change and assume that the kafka topic has been rebalanced.
25 Balance(msg Message, partitions ...int) (partition int)
26}
27
28// BalancerFunc is an implementation of the Balancer interface that makes it

Callers 5

BalanceMethod · 0.65
BalanceMethod · 0.65
BalanceMethod · 0.65
BalanceMethod · 0.65
WriteMessagesMethod · 0.65

Implementers 8

RoundRobinbalancer.go
LeastBytesbalancer.go
Hashbalancer.go
ReferenceHashbalancer.go
randomBalancerbalancer.go
CRC32Balancerbalancer.go
Murmur2Balancerbalancer.go
staticBalancerwriter_test.go

Calls

no outgoing calls

Tested by

no test coverage detected