[ https://issues.apache.org/jira/browse/KAFKA-1988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14339751#comment-14339751 ]
Jun Rao commented on KAFKA-1988: -------------------------------- Actually, we can probably keep the same logic in determining the partition from key in Partitioner. We can move the current code in abs() into Partitioner, and give it a new name like toPositive(). Then we can replace Utils.abs() with toPositive() it in the following code in Partitioner. // hash the key to choose a partition return Utils.abs(Utils.murmur2(key)) % numPartitions; This way, we will preserve the key distribution of existing users of the new producer. Tong, Do you want to submit a new patch based on that? > org.apache.kafka.common.utils.Utils.abs method returns wrong value for > negative numbers. > ---------------------------------------------------------------------------------------- > > Key: KAFKA-1988 > URL: https://issues.apache.org/jira/browse/KAFKA-1988 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.8.2.0 > Reporter: Tong Li > Assignee: Tong Li > Priority: Blocker > Fix For: 0.8.2.1 > > Attachments: KAFKA-1988.patch > > > org.apache.kafka.common.utils.Utils.abs method returns wrong value for > negative numbers. The method only returns intended value for positive > numbers. All negative numbers except the Integer.Min_Value will be returned > an unsigned integer. -- This message was sent by Atlassian JIRA (v6.3.4#6332)