MCPcopy
hub / github.com/IBM/sarama / WithCustomHashFunction

Function WithCustomHashFunction

partitioner.go:67–71  ·  view source on GitHub ↗

WithCustomHashFunction lets you specify what hash function to use for the partitioning

(hasher func() hash.Hash32)

Source from the content-addressed store, hash-verified

65
66// WithCustomHashFunction lets you specify what hash function to use for the partitioning
67func WithCustomHashFunction(hasher func() hash.Hash32) HashPartitionerOption {
68 return func(hp *hashPartitioner) {
69 hp.hasher = hasher()
70 }
71}
72
73// WithCustomFallbackPartitioner lets you specify what HashPartitioner should be used in case a Distribution Key is empty
74func WithCustomFallbackPartitioner(randomHP Partitioner) HashPartitionerOption {

Calls

no outgoing calls