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

Hemanth Yamijala commented on HADOOP-4879:
------------------------------------------

I have one concern with the implementation of Counter.equals. Basically, should 
the value of a Counter count in the equality check ? IMO, it seems like the 
value does not define the identity of the object, and hence it must not be 
checked in equals. For instance, if we add a counter to a Collection, and then 
increment it's value, and then try to retrieve it from the collection, it may 
not work because the value is changed, right ?

Originally, I'd requested Amar to have contentEquals only in test methods 
because that's all where it was needed. For some reason though it was moved to 
the main code as well.

> TestJobTrackerRestart fails on trunk
> ------------------------------------
>
>                 Key: HADOOP-4879
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4879
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: mapred, test
>    Affects Versions: 0.20.0
>            Reporter: Arun C Murthy
>            Assignee: Owen O'Malley
>            Priority: Blocker
>             Fix For: 0.20.0
>
>         Attachments: h4879.patch, h4879.patch, HADOOP-4879-v1.patch
>
>
> HADOOP-1230 changed the definition of TaskReport.equals:
> {noformat}
> @@ -172,7 +172,7 @@
>        return false;
>      if(o.getClass().equals(TaskReport.class)) {
>        TaskReport report = (TaskReport) o;
> -      return counters.contentEquals(report.getCounters())
> +      return counters.equals(report.getCounters())
> {noformat}
> This results in:
> {noformat}
> Testcase: testJobTrackerRestart took 473.926 sec
>   FAILED
> Task reports for same attempt has changed
> junit.framework.AssertionFailedError: Task reports for same attempt has 
> changed
>   at 
> org.apache.hadoop.mapred.TestJobTrackerRestart.testTaskReports(TestJobTrackerRestart.java:514)
>   at 
> org.apache.hadoop.mapred.TestJobTrackerRestart.testTaskEventsAndReportsWithRecovery(TestJobTrackerRestart.java:447)
>   at 
> org.apache.hadoop.mapred.TestJobTrackerRestart.testJobTrackerRestart(TestJobTrackerRestart.java:599)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to