You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Bharat Viswanadham (JIRA)" <ji...@apache.org> on 2016/08/25 19:14:22 UTC
[jira] [Updated] (KAFKA-4087) DefaultParitioner Implementation
Issue
[ https://issues.apache.org/jira/browse/KAFKA-4087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bharat Viswanadham updated KAFKA-4087:
--------------------------------------
Affects Version/s: 0.10.0.1
> DefaultParitioner Implementation Issue
> --------------------------------------
>
> Key: KAFKA-4087
> URL: https://issues.apache.org/jira/browse/KAFKA-4087
> Project: Kafka
> Issue Type: Bug
> Components: producer
> Affects Versions: 0.9.0.1, 0.10.0.1
> Reporter: Bharat Viswanadham
> Assignee: Bharat Viswanadham
> Labels: partitioners, producer
>
> In DefaultPartitioner implementation, when key is null
> if (availablePartitions.size() > 0) {
> int part = Utils.toPositive(nextValue) % availablePartitions.size();
> return availablePartitions.get(part).partition();
> }
> Where as when key is not null
> return Utils.toPositive(Utils.murmur2(keyBytes)) % numPartitions;
> We are returning partition by using total number of partitions.
> Should n't we do the same as by considering only available partitions?
> https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/internals/DefaultPartitioner.java#L67
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)