From 5808ba30dd0c354f3fcea739a06795eed5ae76a8 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Sun, 30 Jun 2013 15:53:29 +0000 Subject: [PATCH] MAPREDUCE-5349. TestClusterMapReduceTestCase and TestJobName fail on Windows in branch-2. Contributed by Chuan Liu. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1498144 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop/mapred/MiniMRClientClusterFactory.java | 11 +++++------ .../java/org/apache/hadoop/mapred/MiniMRCluster.java | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 51133263dc9..9479e34cd11 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -463,6 +463,9 @@ Release 2.1.0-beta - 2013-07-02 MAPREDUCE-5177. Use common utils FileUtil#setReadable/Writable/Executable & FileUtil#canRead/Write/Execute. (Ivan Mitic via suresh) + MAPREDUCE-5349. TestClusterMapReduceTestCase and TestJobName fail on Windows + in branch-2. (Chuan Liu via cnauroth) + MAPREDUCE-5291. Change MR App to use updated property names in container-log4j.properties. (Zhijie Shen via sseth) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java index 38c656bcb82..023da480822 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRClientClusterFactory.java @@ -38,12 +38,11 @@ public class MiniMRClientClusterFactory { public static MiniMRClientCluster create(Class caller, int noOfNMs, Configuration conf) throws IOException { - return create(caller, caller.getName(), noOfNMs, conf); + return create(caller, caller.getSimpleName(), noOfNMs, conf); } - + public static MiniMRClientCluster create(Class caller, String identifier, - int noOfNMs, - Configuration conf) throws IOException { + int noOfNMs, Configuration conf) throws IOException { if (conf == null) { conf = new Configuration(); @@ -71,8 +70,8 @@ public static MiniMRClientCluster create(Class caller, String identifier, fs.setPermission(remoteCallerJar, new FsPermission("744")); job.addFileToClassPath(remoteCallerJar); - MiniMRYarnCluster miniMRYarnCluster = - new MiniMRYarnCluster(identifier, noOfNMs); + MiniMRYarnCluster miniMRYarnCluster = new MiniMRYarnCluster(identifier, + noOfNMs); job.getConfiguration().set("minimrclientcluster.caller.name", identifier); job.getConfiguration().setInt("minimrclientcluster.nodemanagers.number", diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java index 281a6d87df9..5320621c740 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java @@ -178,7 +178,7 @@ public MiniMRCluster(int jobTrackerPort, int taskTrackerPort, int numTrackerToExclude, Clock clock) throws IOException { if (conf == null) conf = new JobConf(); FileSystem.setDefaultUri(conf, namenode); - String identifier = this.getClass().getName() + "_" + String identifier = this.getClass().getSimpleName() + "_" + Integer.toString(new Random().nextInt(Integer.MAX_VALUE)); mrClientCluster = MiniMRClientClusterFactory.create(this.getClass(), identifier, numTaskTrackers, conf);