[ 
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)

Reply via email to