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

Function NewReferenceHashPartitioner

partitioner.go:188–195  ·  view source on GitHub ↗

NewReferenceHashPartitioner is like NewHashPartitioner except that it handles absolute values in the same way as the reference Java implementation. NewHashPartitioner was supposed to do that but it had a mistake and now there are people depending on both behaviors. This will all go away on the next

(topic string)

Source from the content-addressed store, hash-verified

186// that but it had a mistake and now there are people depending on both behaviors. This will
187// all go away on the next major version bump.
188func NewReferenceHashPartitioner(topic string) Partitioner {
189 p := new(hashPartitioner)
190 p.random = NewRandomPartitioner(topic)
191 p.hasher = fnv.New32a()
192 p.referenceAbs = true
193 p.hashUnsigned = false
194 return p
195}
196
197// NewConsistentCRCHashPartitioner is like NewHashPartitioner execpt that it uses the *unsigned* crc32 hash
198// of the encoded bytes of the message key modulus the number of partitions. This is compatible with

Callers

nothing calls this directly

Calls 1

NewRandomPartitionerFunction · 0.85

Tested by

no test coverage detected