Return-Path: X-Original-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A2C7FE8B for ; Thu, 4 Apr 2013 17:03:46 +0000 (UTC) Received: (qmail 86694 invoked by uid 500); 4 Apr 2013 17:03:45 -0000 Delivered-To: apmail-hadoop-mapreduce-commits-archive@hadoop.apache.org Received: (qmail 86616 invoked by uid 500); 4 Apr 2013 17:03:45 -0000 Mailing-List: contact mapreduce-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-dev@hadoop.apache.org Delivered-To: mailing list mapreduce-commits@hadoop.apache.org Received: (qmail 86581 invoked by uid 99); 4 Apr 2013 17:03:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 17:03:44 +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; Thu, 04 Apr 2013 17:03:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CA45123889FA; Thu, 4 Apr 2013 17:03:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1464637 - in /hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ Date: Thu, 04 Apr 2013 17:03:22 -0000 To: mapreduce-commits@hadoop.apache.org From: hitesh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130404170322.CA45123889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hitesh Date: Thu Apr 4 17:03:22 2013 New Revision: 1464637 URL: http://svn.apache.org/r1464637 Log: MAPREDUCE-5083. MiniMRCluster should use a random component when creating an actual cluster. Contributed by Siddharth Seth. Modified: hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/CHANGES.txt hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java Modified: hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/CHANGES.txt?rev=1464637&r1=1464636&r2=1464637&view=diff ============================================================================== --- hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/CHANGES.txt (original) +++ hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/CHANGES.txt Thu Apr 4 17:03:22 2013 @@ -19,6 +19,9 @@ Release 2.0.4-beta - UNRELEASED fix failures in renewal of HistoryServer's delegations tokens. (Siddharth Seth via vinodkv) + MAPREDUCE-5083. MiniMRCluster should use a random component when creating an + actual cluster (Siddharth Seth via hitesh) + Release 2.0.3-alpha - 2013-02-06 INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java?rev=1464637&r1=1464636&r2=1464637&view=diff ============================================================================== --- hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java (original) +++ hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java Thu Apr 4 17:03:22 2013 @@ -38,6 +38,12 @@ public class MiniMRClientClusterFactory public static MiniMRClientCluster create(Class caller, int noOfNMs, Configuration conf) throws IOException { + return create(caller, caller.getName(), noOfNMs, conf); + } + + public static MiniMRClientCluster create(Class caller, String identifier, + int noOfNMs, + Configuration conf) throws IOException { if (conf == null) { conf = new Configuration(); @@ -45,7 +51,7 @@ public class MiniMRClientClusterFactory FileSystem fs = FileSystem.get(conf); - Path testRootDir = new Path("target", caller.getName() + "-tmpDir") + Path testRootDir = new Path("target", identifier + "-tmpDir") .makeQualified(fs); Path appJar = new Path(testRootDir, "MRAppJar.jar"); @@ -65,10 +71,10 @@ public class MiniMRClientClusterFactory fs.setPermission(remoteCallerJar, new FsPermission("744")); job.addFileToClassPath(remoteCallerJar); - MiniMRYarnCluster miniMRYarnCluster = new MiniMRYarnCluster(caller - .getName(), noOfNMs); + MiniMRYarnCluster miniMRYarnCluster = + new MiniMRYarnCluster(identifier, noOfNMs); job.getConfiguration().set("minimrclientcluster.caller.name", - caller.getName()); + identifier); job.getConfiguration().setInt("minimrclientcluster.nodemanagers.number", noOfNMs); miniMRYarnCluster.init(job.getConfiguration()); Modified: hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java?rev=1464637&r1=1464636&r2=1464637&view=diff ============================================================================== --- hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java (original) +++ hadoop/common/branches/branch-2.0.4-alpha/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java Thu Apr 4 17:03:22 2013 @@ -18,6 +18,7 @@ package org.apache.hadoop.mapred; import java.io.IOException; +import java.util.Random; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -177,8 +178,10 @@ public class MiniMRCluster { int numTrackerToExclude, Clock clock) throws IOException { if (conf == null) conf = new JobConf(); FileSystem.setDefaultUri(conf, namenode); + String identifier = this.getClass().getName() + "_" + + Integer.toString(new Random().nextInt(Integer.MAX_VALUE)); mrClientCluster = MiniMRClientClusterFactory.create(this.getClass(), - numTaskTrackers, conf); + identifier, numTaskTrackers, conf); } public UserGroupInformation getUgi() {