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:51:38 UTC

[jira] Created: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

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


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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org>.
     [ 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

        

[jira] Commented: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998972#comment-12998972 ] 

Todd Lipcon commented on HADOOP-7151:
-------------------------------------

+1

> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-7151:
--------------------------------

    Assignee: Dmitriy V. Ryaboy
      Status: Patch Available  (was: Open)

> 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
>            Assignee: 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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-7151:
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.23.0
     Hadoop Flags: [Reviewed]
           Status: Resolved  (was: Patch Available)

Committed to trunk, thanks Dmitriy!

> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Commented: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999227#comment-12999227 ] 

Hudson commented on HADOOP-7151:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #511 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/511/])
    HADOOP-7151. Document need for stable hashCode() in WritableComparable. Contributed by Dmitriy V. Ryaboy.


> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org>.
     [ 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

let's try that again..

> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Commented: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000758#comment-13000758 ] 

Hudson commented on HADOOP-7151:
--------------------------------

Integrated in Hadoop-Common-trunk #616 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/616/])
    HADOOP-7151. Document need for stable hashCode() in WritableComparable. Contributed by Dmitriy V. Ryaboy.


> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Commented: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998113#comment-12998113 ] 

Hadoop QA commented on HADOOP-7151:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12471457/HADOOP-7151.patch
  against trunk revision 1071364.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    -1 patch.  The patch command could not apply the patch.

Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/293//console

This message is automatically generated.

> 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
>            Assignee: 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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-7151:
--------------------------------

    Status: Open  (was: Patch Available)

Can you regen the patch against trunk?

> 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
>            Assignee: 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

        

[jira] Updated: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitriy V. Ryaboy updated HADOOP-7151:
--------------------------------------

    Status: Patch Available  (was: Open)

> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>         Attachments: HADOOP-7151.patch, 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

        

[jira] Commented: (HADOOP-7151) Document need for stable hashCode() in WritableComparable

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998731#comment-12998731 ] 

Hadoop QA commented on HADOOP-7151:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12471806/HADOOP-7151.patch
  against trunk revision 1074005.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/296//testReport/
Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/296//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/296//console

This message is automatically generated.

> 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
>            Assignee: Dmitriy V. Ryaboy
>            Priority: Minor
>         Attachments: HADOOP-7151.patch, 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