Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CAF96200ABD for ; Sat, 14 May 2016 19:10:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C98B0160969; Sat, 14 May 2016 17:10:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1D4DE160868 for ; Sat, 14 May 2016 19:10:13 +0200 (CEST) Received: (qmail 62116 invoked by uid 500); 14 May 2016 17:10:13 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 62105 invoked by uid 99); 14 May 2016 17:10:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2016 17:10:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E33FC2C14F8 for ; Sat, 14 May 2016 17:10:12 +0000 (UTC) Date: Sat, 14 May 2016 17:10:12 +0000 (UTC) From: "Harinder Singh Bedi (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-1842) JobID.forName() creates JobID instances that break equality MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 14 May 2016 17:10:15 -0000 [ https://issues.apache.org/jira/browse/MAPREDUCE-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15283618#comment-15283618 ] Harinder Singh Bedi commented on MAPREDUCE-1842: ------------------------------------------------ This issue has effect the BLUR project as well. https://issues.apache.org/jira/browse/BLUR-449. If the plan to fix this is by changing the equals method then the BLUR issue will also be resolved. > 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.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org