Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CBE65107D3 for ; Mon, 8 Apr 2013 20:55:16 +0000 (UTC) Received: (qmail 34974 invoked by uid 500); 8 Apr 2013 20:55:16 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 34906 invoked by uid 500); 8 Apr 2013 20:55:16 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 34896 invoked by uid 99); 8 Apr 2013 20:55:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Apr 2013 20:55:16 +0000 Date: Mon, 8 Apr 2013 20:55:16 +0000 (UTC) From: "Jason Lowe (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MAPREDUCE-5136) TestJobImpl->testJobNoTasks fails .. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MAPREDUCE-5136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Lowe updated MAPREDUCE-5136: ---------------------------------- Assignee: Amir Sanjar Target Version/s: 2.0.5-beta Status: Patch Available (was: Open) When the patch is ready for review, please move the JIRA into the Patch Available state via the "Submit Patch" button. That triggers the QA bot to comment on the patch and also flags the JIRA as being in a ready-to-review state for committers. Also if you need to move JIRAs to other projects in the future, you can do this via the "Move" option under the "More Actions" drop-down menu. > TestJobImpl->testJobNoTasks fails .. > ------------------------------------ > > Key: MAPREDUCE-5136 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-5136 > Project: Hadoop Map/Reduce > Issue Type: Bug > Affects Versions: 2.0.3-alpha > Environment: Linux + IBM JAVA 6 > Reporter: Amir Sanjar > Assignee: Amir Sanjar > Attachments: MAPREDUCE-5136.patch > > > I am not sure if this is a testcase or a design issue. During execution of TestJobImpl->testJobNoTasks() there is an assertion made based on the order of key/value pairs stored in adjacency list. However adjacency list was created by Configuration->getValByRegex() as a HashMap (order is not guaranteed): > Testcase: > JobSubmittedEventHandler jseHandler = new JobSubmittedEventHandler("testId", > "testName", "testNodeName", "\"key2\"=\"value2\" \"key1\"=\"value1\" "); > .... > .... > try { > Assert.assertTrue(jseHandler.getAssertValue()); <=== > Configuration->getValByRegex(): > public Map getValByRegex(String regex) { > Pattern p = Pattern.compile(regex); > Map result = new HashMap(); <======= > > as we all know, HashMap makes absolutely no guarantees about the iteration order. It can (and will) even change completely when new elements are added. > Changing HashMap to LinkedHashMap fixes the ordering inconsistency, however with a small performance side effect. -- 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