File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -487,9 +487,16 @@ func KafkaHasher(hashFn func([]byte) uint32) PartitionerHasher {
487
487
}
488
488
}
489
489
490
- // Deprecated: SaramaHasher is not compatible with Sarama's default partitioner
491
- // and only remains to avoid re-keying records for existing users of this API. See
492
- // [SaramaCompatHasher] for a correct partitioner.
490
+ // SaramaHasher is a historical misnamed partitioner. This library's original
491
+ // implementation of the SaramaHasher was incorrect, if you want an exact
492
+ // match for the Sarama partitioner, use the [SaramaCompatHasher].
493
+ //
494
+ // This partitioner remains because as it turns out, other ecosystems provide
495
+ // a similar partitioner and this partitioner is useful for compatibility.
496
+ //
497
+ // In particular, using this function with a crc32.ChecksumIEEE hasher makes
498
+ // this partitioner match librdkafka's consistent partitioner, or the
499
+ // zendesk/ruby-kafka partitioner.
493
500
func SaramaHasher (hashFn func ([]byte ) uint32 ) PartitionerHasher {
494
501
return func (key []byte , n int ) int {
495
502
p := int (hashFn (key )) % n
You can’t perform that action at this time.
0 commit comments