[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-02 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569553#comment-13569553
 ] 

Hudson commented on HADOOP-9124:


Integrated in Hadoop-Mapreduce-trunk #1332 (See 
[https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1332/])
HADOOP-9124. SortedMapWritable violates contract of Map interface for 
equals() and hashCode(). Contributed by Surenkumar Nihalani (Revision 1441475)

 Result = SUCCESS
tomwhite : 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1441475
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha, 0.23.7
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-02 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569536#comment-13569536
 ] 

Hudson commented on HADOOP-9124:


Integrated in Hadoop-Hdfs-trunk #1304 (See 
[https://builds.apache.org/job/Hadoop-Hdfs-trunk/1304/])
HADOOP-9124. SortedMapWritable violates contract of Map interface for 
equals() and hashCode(). Contributed by Surenkumar Nihalani (Revision 1441475)

 Result = SUCCESS
tomwhite : 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1441475
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha, 0.23.7
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-02 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569520#comment-13569520
 ] 

Hudson commented on HADOOP-9124:


Integrated in Hadoop-Hdfs-0.23-Build #513 (See 
[https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/513/])
HADOOP-9124. SortedMapWritable violates contract of Map interface for 
equals() and hashCode(). (Surenkumar Nihalani via tgraves) (Revision 1441575)

 Result = SUCCESS
tgraves : 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1441575
Files : 
* 
/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* 
/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java
* 
/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha, 0.23.7
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-02 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569501#comment-13569501
 ] 

Hudson commented on HADOOP-9124:


Integrated in Hadoop-Yarn-trunk #115 (See 
[https://builds.apache.org/job/Hadoop-Yarn-trunk/115/])
HADOOP-9124. SortedMapWritable violates contract of Map interface for 
equals() and hashCode(). Contributed by Surenkumar Nihalani (Revision 1441475)

 Result = SUCCESS
tomwhite : 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1441475
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha, 0.23.7
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-01 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569015#comment-13569015
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

[~snihalani], now that the patch is committed to trunk and branch-0.23, I think 
it would be best not to change it.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha, 0.23.7
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-01 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568916#comment-13568916
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

There is a very small issue: 
My latest attachment had this: 
{code}
+// entrySets are now same
+failureReason = "Two SortedMapWritables with same entry sets formed in 
different order have different hashcode";
+assertEquals(failureReason, mapA.hashCode(), mapB.hashCode());
+failureReason = "Two SortedMapWritables with same entry sets formed in 
different order are no longer equal";
+assertEquals(failureReason, mapA, mapB);
+assertEquals(failureReason, mapB, mapA);
{code}

while Karthik and Tom, your latest attachments have this,
{code}

+// entrySets are now same
+failureReason = "Two SortedMapWritables with same entry sets formed in 
different order are now different";
+assertEquals(failureReason, mapA.hashCode(), mapB.hashCode());
+assertTrue(failureReason, mapA.equals(mapB));
+assertTrue(failureReason, mapB.equals(mapA));
{code}
I don't know how branches end up merging, but, since [~kkambatl] mentioned it 
during code review, so, I thought it was worth to point out.


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 1.1.1, 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha
>
> Attachments: hadoop-9124-branch1.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-02-01 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568795#comment-13568795
 ] 

Hudson commented on HADOOP-9124:


Integrated in Hadoop-trunk-Commit #3310 (See 
[https://builds.apache.org/job/Hadoop-trunk-Commit/3310/])
HADOOP-9124. SortedMapWritable violates contract of Map interface for 
equals() and hashCode(). Contributed by Surenkumar Nihalani (Revision 1441475)

 Result = SUCCESS
tomwhite : 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1441475
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java
* 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java


> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Fix For: 2.0.3-alpha
>
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-31 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13567803#comment-13567803
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

+1

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-31 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13567739#comment-13567739
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12567368/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2125//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2125//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Assignee: Surenkumar Nihalani
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-29 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565421#comment-13565421
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12566975/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2113//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2113//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-29 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565398#comment-13565398
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12566969/HADOOP-9124.patch
  against trunk revision .

{color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2112//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-29 Thread Tom White (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565369#comment-13565369
 ] 

Tom White commented on HADOOP-9124:
---

What about my comment above about mirroring the change from HADOOP-7153?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-28 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564799#comment-13564799
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

I didn't know about branches in any of the HowToContribute wiki pages. Where 
can I read up on them?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-28 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564726#comment-13564726
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

[~snihalani], looks like this applies to branch-1 as well. 

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-28 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564484#comment-13564484
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Thanks for the clarification, Tom. Suren - the patch looks good to me. Thanks.

+1

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-28 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564473#comment-13564473
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12566787/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2103//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/2103//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-28 Thread Tom White (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564177#comment-13564177
 ] 

Tom White commented on HADOOP-9124:
---

{quote}
So, different *MapWritables have added Writables in different order won't lead 
to same class-id mappings. Also, After a mapping is removed, there is no 
reference counting to remove the class-id mapping that is no longer needed. 
Hence, we should not check classToIdMap & idToClassMap
{quote}

I agree. According to 
[http://docs.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)]

bq. two maps {{m1}} and {{m2}} represent the same mappings if 
{{m1.entrySet().equals(m2.entrySet())}}

So only the values of the entry set should be used for the basis for testing 
equality. 

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-26 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13563721#comment-13563721
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

[~kkambatl] & [~tomwhite], What do you think?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-25 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562961#comment-13562961
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

I was looking at the {{equals(Object o)}} implementation of {{AbstractMap}} 
here. It iterates through and checks if each Key and Value mapping is in the 
map to checked.
Now, each Key and Value would rely on instanceof to check if the class is 
there. So, I believe we should be good.

I was looking at {{AbstractMapWritable}}, the class id is just an auto 
incremented byte. So, different {{*MapWritables}} have added {{Writables}} in 
different order won't lead to same class-id mappings. Also, After a mapping is 
removed, there is no reference counting to remove the class-id mapping that is 
no longer needed. Hence, we should not check {{classToIdMap}} & {{idToClassMap}}

Let me know if I missed any edge case or anything.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-25 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562874#comment-13562874
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

As I understand, both {{SortedMapWritable}} and {{MapWritable}} keep track of 
the classes being used as keys and values to facilitate writing/reading to/from 
streams (disk).

If we are comparing mapA and mapB, I am not certain if the bytes written to 
disk through {{#write()}} need to be identical. If they are supposed to be, 
then we need to compare {{classToIdMap}} and {{idToClassMap}}. [~tomwhite], 
what do you think?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-25 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562652#comment-13562652
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

[~tomwhite], I agree about that test. That case is neither likely to happen nor 
useful. 

[~kkambatl], I am not sure of the purpose of {{classToIdMap}} and 
{{idToClassMap}} . Can you elaborate?

I'll update and upload the patch once Karthik's point is clear.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2013-01-24 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562258#comment-13562258
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

On second thought, I think {{#equals()}} should verify if 
{{classToIdMap.keySet()}} and {{idToClassMap.values()}} should match for the 
two objects being compared. No?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-25 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13539389#comment-13539389
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

Hey Karthik,

I would love to work together. I am continuing the discussion on HADOOP-9154. 
There is no point on getting this in first if HADOOP-9154 already addresses it. 

Thanks,
Suren.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-24 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13539320#comment-13539320
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Hi Suren,

In HADOOP-9154, I propose moving implementation of {{Map}} methods from 
{{(Sorted)MapWritable}} to {{AbstractMapWritable}}. The preliminary patch 
addresses this issue as well. Do you want to work together on that patch to add 
the required tests and get it in.

I am also very much open to getting this in first, and finishing the other JIRA.

Thanks
Karthik

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-21 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538430#comment-13538430
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

+1

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-21 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538421#comment-13538421
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12562134/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1921//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1921//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537606#comment-13537606
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12562018/HADOOP-9124.patch
  against trunk revision .

{color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1916//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537595#comment-13537595
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Yes. The timeout should be high enough that we don't hit on expected runs of 
the test even on slow systems, and low enough to bail out early if there is 
something terribly wrong going on with the test.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537578#comment-13537578
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

So, the sole purpose of timeout is to have a timeout/sanity? there is not much 
logic behind the timeout value, right? 
It's just enough that method completes?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537415#comment-13537415
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Thanks Suren - the fifth point seems to have already been addressed.

Few more nits (hopefully the last :) ):
# We can be a little conservative on the test timeouts - they shouldn't timeout 
just because we run them on a slow/loaded machine. Do you think 200 ms is 
conservative enough? If not, we can may be bump it up to 1s.
# The indentation seems to be off on a few lines.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537310#comment-13537310
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12561963/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1915//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1915//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch, 
> HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-20 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537202#comment-13537202
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Thanks Suren for the updated patch. It looks mostly good, but for some nits.

# It is nicer to import only used methods in Assert and not Assert.*
# Tests should have timeouts
# The failure reasons for equals and hashcode should be different - should a 
test fail, the message should be clear enough.
# assertFalse(condition) can be used in places with assertTrue(!condition)
# Though basic null checks might not be required; if we are checking for mapA 
not null, we should check for mapB also to be not null



> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-18 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534824#comment-13534824
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:green}+1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12561462/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 1 new 
or modified test files.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1909//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1909//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-18 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534812#comment-13534812
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12561459/HADOOP-9124.patch
  against trunk revision .

{color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1908//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-18 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534807#comment-13534807
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

Request for code review.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch, HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-17 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534690#comment-13534690
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Suren, Having all the tests corresponding to SortedMapWritable in 
TestSortedMapWritable is more convenient, easy to find.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-17 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534669#comment-13534669
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

Hey Karthik,

sure. I'll add code that will test equals and hashCode.

Do I add testcases in 
hadoop-trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java
 or I create another test file?

sorry for noob question. This is my first contribution.



> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-17 Thread Karthik Kambatla (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534633#comment-13534633
 ] 

Karthik Kambatla commented on HADOOP-9124:
--

Hi Surenkumar,

Thanks for working on this. The patch looks good - it would be great to have an 
associated unit test too.



> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-17 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534604#comment-13534604
 ] 

Hadoop QA commented on HADOOP-9124:
---

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12561403/HADOOP-9124.patch
  against trunk revision .

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:red}-1 tests included{color}.  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.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 eclipse:eclipse{color}.  The patch built with 
eclipse:eclipse.

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 1.3.9) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 core tests{color}.  The patch passed unit tests in 
hadoop-common-project/hadoop-common.

{color:green}+1 contrib tests{color}.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1905//testReport/
Console output: 
https://builds.apache.org/job/PreCommit-HADOOP-Build/1905//console

This message is automatically generated.

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
> Attachments: HADOOP-9124.patch
>
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HADOOP-9124) SortedMapWritable violates contract of Map interface for equals() and hashCode()

2012-12-17 Thread Surenkumar Nihalani (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534503#comment-13534503
 ] 

Surenkumar Nihalani commented on HADOOP-9124:
-

SortedMapWritable uses a TreeMap internally. TreeMap inherits the needed 
implementation of equals() and hashCode() from AbstractMap. I am planning to 
write corresponding wrapper methods. Is there a better way to implement this?

> SortedMapWritable violates contract of Map interface for equals() and 
> hashCode()
> 
>
> Key: HADOOP-9124
> URL: https://issues.apache.org/jira/browse/HADOOP-9124
> Project: Hadoop Common
>  Issue Type: Bug
>  Components: io
>Affects Versions: 2.0.2-alpha
>Reporter: Patrick Hunt
>Priority: Minor
>
> This issue is similar to HADOOP-7153. It was found when using MRUnit - see 
> MRUNIT-158, specifically 
> https://issues.apache.org/jira/browse/MRUNIT-158?focusedCommentId=13501985&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13501985
> --
> o.a.h.io.SortedMapWritable implements the java.util.Map interface, however it 
> does not define an implementation of the equals() or hashCode() methods; 
> instead the default implementations in java.lang.Object are used.
> This violates the contract of the Map interface which defines different 
> behaviour for equals() and hashCode() than Object does. More information 
> here: 
> http://download.oracle.com/javase/6/docs/api/java/util/Map.html#equals(java.lang.Object)
> The practical consequence is that SortedMapWritables containing equal entries 
> cannot be compared properly. We were bitten by this when trying to write an 
> MRUnit test for a Mapper that outputs MapWritables; the MRUnit driver cannot 
> test the equality of the expected and actual MapWritable objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira