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

Function NewManualPartitioner

partitioner.go:82–84  ·  view source on GitHub ↗

NewManualPartitioner returns a Partitioner which uses the partition manually set in the provided ProducerMessage's Partition field as the partition to produce to.

(topic string)

Source from the content-addressed store, hash-verified

80// NewManualPartitioner returns a Partitioner which uses the partition manually set in the provided
81// ProducerMessage's Partition field as the partition to produce to.
82func NewManualPartitioner(topic string) Partitioner {
83 return new(manualPartitioner)
84}
85
86func (p *manualPartitioner) Partition(message *ProducerMessage, numPartitions int32) (int32, error) {
87 return message.Partition, nil

Callers 1

TestManualPartitionerFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestManualPartitionerFunction · 0.68