You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org> on 2011/02/19 05:55:38 UTC
[jira] Updated: (HADOOP-7151) Document need for stable hashCode()
in WritableComparable
[ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dmitriy V. Ryaboy updated HADOOP-7151:
--------------------------------------
Attachment: HADOOP-7151.patch
Attached is a javadoc-only patch.
> Document need for stable hashCode() in WritableComparable
> ---------------------------------------------------------
>
> Key: HADOOP-7151
> URL: https://issues.apache.org/jira/browse/HADOOP-7151
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Dmitriy V. Ryaboy
> Priority: Minor
> Attachments: HADOOP-7151.patch
>
>
> When a Writable is used as a key, HashPartitioner implicitly assumes that hashCode() will return the same value across different instances of the JVM. This is not a guaranteed behavior in Java, and Object's default hashCode() does not in fact do this, which can lead to subtle bugs. This requirement should be explicitly called out.
> In addition the sample MyWritable in the javadoc for WritableComparable does not implement hashCode() and thus has a bug. That should be fixed.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira