In the class kafka.producer.DefaultPartitionner the ligne key.hashCode % 
numPartitions may return a negative value. this is not a good thing knowing 
that partittion is (always) > 0. In this case an invalide partition id is 
thrown in the producer.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: KAFKA-248
                 URL: https://issues.apache.org/jira/browse/KAFKA-248
             Project: Kafka
          Issue Type: Bug
          Components: core
    Affects Versions: 0.6
         Environment: linux/java6
            Reporter: Bertrand Perrin


In the class kafka.producer.DefaultPartitionner the ligne key.hashCode % 
numPartitions may return a negative value. this is not a good thing knowing 
that partittion is (always) > 0. In this case an invalide partition id is 
thrown in the producer.

a patch could be :  key.hashCode.abs  % numPartitions

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to