Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Murmur2Partition ¶
func MurmurHash2 ¶
The original MurmurHash2 32-bit algorithm by Austin Appleby. Taken from https://github.com/aviddiviner/go-murmur by David Irvine Adapted to match the behavior of the Java Kafka Client
func NewMurmur2Partitioner ¶
func NewMurmur2Partitioner(topic string) sarama.Partitioner
NewMurmur2Partitioner creates a partitioner
Types ¶
type Murmur2Partitioner ¶
type Murmur2Partitioner struct {
// contains filtered or unexported fields
}
Murmur2Partitioner is a matching implemention for the current (10.1) kafka partitioner. It will generate the same partition ID's a the default Kafka client and hence can be as a replacement with correct inter op
func (*Murmur2Partitioner) Partition ¶
func (p *Murmur2Partitioner) Partition(message *sarama.ProducerMessage, numPartitions int32) (int32, error)
Called by Samza to get the partition for a message. Will return a random partition if the message key is nil
func (*Murmur2Partitioner) RequiresConsistency ¶
func (p *Murmur2Partitioner) RequiresConsistency() bool
RequiresConsistency is always true for this implemention
Click to show internal directories.
Click to hide internal directories.