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)
| 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. |
| 188 | func 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 |
nothing calls this directly
no test coverage detected