Skip to content

Commit

Permalink
Fix documentation for HashPartitioner
Browse files Browse the repository at this point in the history
Fixes #717.
  • Loading branch information
eapache committed Aug 9, 2016
1 parent 9bb4a68 commit 8eb9752
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions partitioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ type hashPartitioner struct {
hasher hash.Hash32
}

// NewHashPartitioner returns a Partitioner which behaves as follows. If the message's key is nil, or fails to
// encode, then a random partition is chosen. Otherwise the FNV-1a hash of the encoded bytes of the message key
// is used, modulus the number of partitions. This ensures that messages with the same key always end up on the
// NewHashPartitioner returns a Partitioner which behaves as follows. If the message's key is nil then a
// random partition is chosen. Otherwise the FNV-1a hash of the encoded bytes of the message key is used,
// modulus the number of partitions. This ensures that messages with the same key always end up on the
// same partition.
func NewHashPartitioner(topic string) Partitioner {
p := new(hashPartitioner)
Expand Down

0 comments on commit 8eb9752

Please sign in to comment.