Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88F4C908B for ; Wed, 3 Oct 2012 02:36:45 +0000 (UTC) Received: (qmail 65420 invoked by uid 500); 3 Oct 2012 02:36:45 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 65376 invoked by uid 500); 3 Oct 2012 02:36:45 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 65368 invoked by uid 99); 3 Oct 2012 02:36:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 02:36:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 02:36:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CC3E523888EA for ; Wed, 3 Oct 2012 02:36:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1393261 - in /hadoop/common/branches/branch-1.1: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobTracker.java src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java Date: Wed, 03 Oct 2012 02:36:00 -0000 To: common-commits@hadoop.apache.org From: sseth@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121003023600.CC3E523888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sseth Date: Wed Oct 3 02:35:59 2012 New Revision: 1393261 URL: http://svn.apache.org/viewvc?rev=1393261&view=rev Log: merge MAPREDUCE-4698 from branch-1. Fix failing unit test - TestJobHistoryConfig. Optionally initialize the jobtracker on a JobTracker.startTracker. (Contributed by Gopal V) Modified: hadoop/common/branches/branch-1.1/CHANGES.txt hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/JobTracker.java hadoop/common/branches/branch-1.1/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java Modified: hadoop/common/branches/branch-1.1/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/CHANGES.txt?rev=1393261&r1=1393260&r2=1393261&view=diff ============================================================================== --- hadoop/common/branches/branch-1.1/CHANGES.txt (original) +++ hadoop/common/branches/branch-1.1/CHANGES.txt Wed Oct 3 02:35:59 2012 @@ -407,6 +407,9 @@ Release 1.1.0 - 2012.09.28 getting, renewing, and cancelling the underlying token. Systems with weak crypto (kssl) configured will continue to use https. (omalley) + MAPREDUCE-4698. Fix failing unit test - TestJobHistoryConfig. Optionally + initialize the jobtracker on a JobTracker.startTracker. (Gopal V via sseth) + Release 1.0.4 - Unreleased NEW FEATURES Modified: hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/JobTracker.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1393261&r1=1393260&r2=1393261&view=diff ============================================================================== --- hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original) +++ hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/JobTracker.java Wed Oct 3 02:35:59 2012 @@ -296,9 +296,14 @@ public class JobTracker implements MRCon InterruptedException { return startTracker(conf, generateNewIdentifier()); } - + public static JobTracker startTracker(JobConf conf, String identifier) throws IOException, InterruptedException { + return startTracker(conf, identifier, false); + } + + public static JobTracker startTracker(JobConf conf, String identifier, boolean initialize) + throws IOException, InterruptedException { DefaultMetricsSystem.initialize("JobTracker"); JobTracker result = null; while (true) { @@ -325,6 +330,12 @@ public class JobTracker implements MRCon if (result != null) { JobEndNotifier.startNotifier(); MBeans.register("JobTracker", "JobTrackerInfo", result); + if(initialize == true) { + result.setSafeModeInternal(SafeModeAction.SAFEMODE_ENTER); + result.initializeFilesystem(); + result.setSafeModeInternal(SafeModeAction.SAFEMODE_LEAVE); + result.initialize(); + } } return result; } Modified: hadoop/common/branches/branch-1.1/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java?rev=1393261&r1=1393260&r2=1393261&view=diff ============================================================================== --- hadoop/common/branches/branch-1.1/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java (original) +++ hadoop/common/branches/branch-1.1/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java Wed Oct 3 02:35:59 2012 @@ -17,8 +17,10 @@ */ package org.apache.hadoop.mapred; +import java.util.Date; import java.io.IOException; import java.io.PrintWriter; +import java.text.SimpleDateFormat; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.io.LongWritable; @@ -113,7 +115,8 @@ public class TestJobHistoryConfig extend conf.setQueueName("default"); String TEST_ROOT_DIR = new Path(System.getProperty("test.build.data", "/tmp")).toString().replace(' ', '+'); - JobTracker jt = JobTracker.startTracker(conf); + String uniqid = new SimpleDateFormat("yyyyMMddHHmm").format(new Date()); + JobTracker jt = JobTracker.startTracker(conf, uniqid, true); assertTrue(jt != null); JobInProgress jip = new JobInProgress(new JobID("jt", 1), new JobConf(conf), jt); @@ -132,8 +135,9 @@ public class TestJobHistoryConfig extend private boolean canStartJobTracker(JobConf conf) throws InterruptedException, IOException { JobTracker jt = null; + String uniqid = new SimpleDateFormat("yyyyMMddHHmm").format(new Date()); try { - jt = JobTracker.startTracker(conf); + jt = JobTracker.startTracker(conf, uniqid, true); Log.info("Started JobTracker"); } catch (IOException e) { Log.info("Can not Start JobTracker", e.getLocalizedMessage());