You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Harinder Singh Bedi (JIRA)" <ji...@apache.org> on 2017/12/27 07:34:00 UTC
[jira] [Issue Comment Deleted] (MAPREDUCE-1842) JobID.forName()
creates JobID instances that break equality
[ https://issues.apache.org/jira/browse/MAPREDUCE-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Harinder Singh Bedi updated MAPREDUCE-1842:
-------------------------------------------
Comment: was deleted
(was: My bad the BLUR issue was with org.apache.hadoop.mapreduce.TaskAttemptID. This was similar.)
> JobID.forName() creates JobID instances that break equality
> -----------------------------------------------------------
>
> Key: MAPREDUCE-1842
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-1842
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: job submission
> Affects Versions: 0.20.2
> Reporter: Age Mooij
>
> We have some code that uses serialization to store org.apache.hadoop.mapreduce.JobID instances (among other things). Since org.apache.hadoop.mapreduce.JobID is not serializable, we store the String representation and use org.apache.hadoop.mapreduce.JobID.forName(String) to read it back.
> Unfortunately the instance created by that method is not equal to the same id as created by the constructor. Here's a unit test for the problem:
> @Test
> public void forNameCopyShouldProduceInstanceEqualToOriginal() {
> JobID jobId1 = new JobID("original", 1);
> JobID jobId2 = JobID.forName(jobId1.toString());
> assertEquals(jobId1, jobId2);
> }
> forName(String) produces a backwards compatible instance from the old mapred package but the equals method shared by them both uses this.getClass() == that.getClass() and that causes the incompatible instances.
> I know this backwards compatible stuff is important but could you please fix this ? The simplest fix would be to change the implementation of equals() or override it in the backwards compatibillity version of JobID in the old mapred package
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org