tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject tez git commit: TEZ-2787. Tez AM should have java.io.tmpdir=./tmp to be consistent with tasks (jeagles)
Date Fri, 11 Sep 2015 18:42:56 GMT
Repository: tez
Updated Branches:
  refs/heads/master 9554c6455 -> 46decf303


TEZ-2787. Tez AM should have java.io.tmpdir=./tmp to be consistent with tasks (jeagles)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/46decf30
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/46decf30
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/46decf30

Branch: refs/heads/master
Commit: 46decf303a224715a2fbf47b7d4f9463ca8a52c7
Parents: 9554c64
Author: Jonathan Eagles <jeagles@yahoo-inc.com>
Authored: Fri Sep 11 13:42:43 2015 -0500
Committer: Jonathan Eagles <jeagles@yahoo-inc.com>
Committed: Fri Sep 11 13:42:43 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../java/org/apache/tez/client/TezClientUtils.java   |  7 +++++--
 .../org/apache/tez/client/TestTezClientUtils.java    | 15 ++++++++++-----
 3 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/46decf30/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d2de18e..96934d3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -175,6 +175,7 @@ Release 0.7.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2787. Tez AM should have java.io.tmpdir=./tmp to be consistent with tasks
   TEZ-2780. Tez UI: Update All Tasks page while in progress
   TEZ-2792. Add AM web service API for tasks
   TEZ-2807. Log data in the finish event instead of the start event

http://git-wip-us.apache.org/repos/asf/tez/blob/46decf30/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
index 8f1eb7f..c96a7ec 100644
--- a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
+++ b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
@@ -998,9 +998,12 @@ public class TezClientUtils {
   static String constructAMLaunchOpts(TezConfiguration tezConf, Resource capability) {
     String defaultOpts = tezConf.get(TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS,
         TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS_DEFAULT);
-    String amOpts = "";
+    Path tmpDir = new Path(Environment.PWD.$(),
+        YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR);
+    String amOpts = "-Djava.io.tmpdir=" + tmpDir + " ";
+
     if (defaultOpts != null && !defaultOpts.isEmpty()) {
-      amOpts = defaultOpts + " ";
+      amOpts = amOpts + defaultOpts + " ";
     }
     amOpts = amOpts + tezConf.get(TezConfiguration.TEZ_AM_LAUNCH_CMD_OPTS,
         TezConfiguration.TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT);

http://git-wip-us.apache.org/repos/asf/tez/blob/46decf30/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java
----------------------------------------------------------------------
diff --git a/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java b/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java
index 394e4dd..bcf3239 100644
--- a/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java
+++ b/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java
@@ -49,6 +49,7 @@ import org.apache.hadoop.io.DataInputByteBuffer;
 import org.apache.hadoop.security.Credentials;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.yarn.api.ApplicationConstants;
+import org.apache.hadoop.yarn.api.ApplicationConstants.Environment;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
 import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
@@ -360,6 +361,9 @@ public class TestTezClientUtils {
 
   @Test(timeout = 5000)
   public void testAMCommandOpts() {
+    Path tmpDir = new Path(Environment.PWD.$(),
+        YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR);
+    String tmpOpts = "-Djava.io.tmpdir=" + tmpDir;
     TezConfiguration tezConf = new TezConfiguration();
     String amCommandOpts = "-Xmx 200m -Dtest.property";
     tezConf.set(TezConfiguration.TEZ_AM_LAUNCH_CMD_OPTS, amCommandOpts);
@@ -367,8 +371,9 @@ public class TestTezClientUtils {
     // Test1: Rely on defaults for cluster-default opts
     String amOptsConstructed =
         TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1));
-    assertEquals(
-        TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS_DEFAULT + " " + amCommandOpts,
+    assertEquals(tmpOpts + " "
+        + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS_DEFAULT + " "
+        + amCommandOpts,
         amOptsConstructed);
 
     // Test2: Setup cluster-default command opts explicitly
@@ -377,7 +382,7 @@ public class TestTezClientUtils {
     tezConf.set(TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, clusterDefaultCommandOpts);
     amOptsConstructed =
         TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1));
-    assertEquals(clusterDefaultCommandOpts + " " + amCommandOpts, amOptsConstructed);
+    assertEquals(tmpOpts + " " + clusterDefaultCommandOpts + " " + amCommandOpts, amOptsConstructed);
 
 
     // Test3: Don't setup Xmx explicitly
@@ -388,7 +393,7 @@ public class TestTezClientUtils {
         TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1));
     // It's OK for the Xmx value to show up before cluster default options, since Xmx will
not be replaced if it already exists.
     assertEquals(
-        " -Xmx" + ((int) (1024 * factor)) + "m" + " " + clusterDefaultCommandOpts + " " +
+        " -Xmx" + ((int) (1024 * factor)) + "m" + " " + tmpOpts + " " + clusterDefaultCommandOpts
+ " " +
             amCommandOpts,
         amOptsConstructed);
 
@@ -398,7 +403,7 @@ public class TestTezClientUtils {
     tezConf.set(TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, clusterDefaultCommandOpts);
     amOptsConstructed =
         TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1));
-    assertEquals(clusterDefaultCommandOpts + " " + amCommandOpts, amOptsConstructed);
+    assertEquals(tmpOpts + " " + clusterDefaultCommandOpts + " " + amCommandOpts, amOptsConstructed);
   }
 
   @Test(timeout = 5000)


Mime
View raw message