Repository: hadoop Updated Branches: refs/heads/trunk ce69c9b54 -> 62943b8e3
MAPREDUCE-6472. MapReduce AM should have java.io.tmpdir=./tmp to be consistent with tasks. Contributed by Naganarasimha G R Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/62943b8e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/62943b8e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/62943b8e Branch: refs/heads/trunk Commit: 62943b8e3aff3b274c439f72a8bb86094c1ab0e8 Parents: ce69c9b Author: Jason Lowe <[email protected]> Authored: Tue Sep 15 19:43:20 2015 +0000 Committer: Jason Lowe <[email protected]> Committed: Tue Sep 15 19:43:20 2015 +0000 ---------------------------------------------------------------------- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/mapred/YARNRunner.java | 4 ++++ .../java/org/apache/hadoop/mapred/TestYARNRunner.java | 10 ++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/62943b8e/hadoop-mapreduce-project/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 8c64738..dd7a34a 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -590,6 +590,9 @@ Release 2.7.2 - UNRELEASED MAPREDUCE-6474. ShuffleHandler can possibly exhaust nodemanager file descriptors (Kuhu Shukla via jlowe) + MAPREDUCE-6472. MapReduce AM should have java.io.tmpdir=./tmp to be + consistent with tasks (Naganarasimha G R via jlowe) + Release 2.7.1 - 2015-07-06 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/62943b8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java index 2bb2483..84a27d9 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java @@ -402,6 +402,10 @@ public class YARNRunner implements ClientProtocol { vargs.add(MRApps.crossPlatformifyMREnv(jobConf, Environment.JAVA_HOME) + "/bin/java"); + Path amTmpDir = + new Path(MRApps.crossPlatformifyMREnv(conf, Environment.PWD), + YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR); + vargs.add("-Djava.io.tmpdir=" + amTmpDir); MRApps.addLog4jSystemProperties(null, vargs, conf); // Check for Java Lib Path usage in MAP and REDUCE configs http://git-wip-us.apache.org/repos/asf/hadoop/blob/62943b8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java index 0e53ab0..010446f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java @@ -461,7 +461,8 @@ public class TestYARNRunner extends TestCase { int adminPos = -1; int userIndex = 0; int userPos = -1; - + int tmpDirPos = -1; + for(String command : commands) { if(command != null) { assertFalse("Profiler should be disabled by default", @@ -473,11 +474,16 @@ public class TestYARNRunner extends TestCase { userPos = command.indexOf("-Xmx1024m"); if(userPos >= 0) userIndex = index; + + tmpDirPos = command.indexOf("-Djava.io.tmpdir="); } index++; } - + + // Check java.io.tmpdir opts are set in the commands + assertTrue("java.io.tmpdir is not set for AM", tmpDirPos > 0); + // Check both admin java opts and user java opts are in the commands assertTrue("AM admin command opts not in the commands.", adminPos > 0); assertTrue("AM user command opts not in the commands.", userPos > 0);
