You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by bi...@apache.org on 2014/10/22 03:47:31 UTC
git commit: TEZ-1210. TezClientUtils.localizeDagPlanAsText() needs to
be fixed for session mode (Alexander Pivovarov via bikas)
Repository: tez
Updated Branches:
refs/heads/master 7a802b13d -> 1cee45da1
TEZ-1210. TezClientUtils.localizeDagPlanAsText() needs to be fixed for session mode (Alexander Pivovarov via bikas)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/1cee45da
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/1cee45da
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/1cee45da
Branch: refs/heads/master
Commit: 1cee45da1be60fd1d0b71a84fe5875920931da5c
Parents: 7a802b1
Author: Bikas Saha <bi...@apache.org>
Authored: Tue Oct 21 18:47:23 2014 -0700
Committer: Bikas Saha <bi...@apache.org>
Committed: Tue Oct 21 18:47:23 2014 -0700
----------------------------------------------------------------------
CHANGES.txt | 2 ++
.../main/java/org/apache/tez/client/TezClientUtils.java | 3 ++-
.../main/java/org/apache/tez/common/TezCommonUtils.java | 10 ++++++++--
.../java/org/apache/tez/common/TestTezCommonUtils.java | 9 +++++----
4 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/1cee45da/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3b85ff8..4f632bb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -51,6 +51,8 @@ ALL CHANGES:
within a group
TEZ-1396. Grouping should generate consistent groups when given the same set
of splits
+ TEZ-1210. TezClientUtils.localizeDagPlanAsText() needs to be fixed for
+ session mode
Release 0.5.1: 2014-10-02
http://git-wip-us.apache.org/repos/asf/tez/blob/1cee45da/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 ed199ec..0ac3a26 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
@@ -731,7 +731,8 @@ public class TezClientUtils {
private static Path localizeDagPlanAsText(DAGPlan dagPB, FileSystem fs, AMConfiguration amConfig,
String strAppId, Path tezSysStagingPath) throws IOException {
- Path textPath = TezCommonUtils.getTezTextPlanStagingPath(tezSysStagingPath);
+ Path textPath =
+ TezCommonUtils.getTezTextPlanStagingPath(tezSysStagingPath, strAppId, dagPB.getName());
FSDataOutputStream dagPBOutTextStream = null;
try {
dagPBOutTextStream = TezCommonUtils.createFileForAM(fs, textPath);
http://git-wip-us.apache.org/repos/asf/tez/blob/1cee45da/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java b/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java
index 3d56b7b..04d2bfc 100644
--- a/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java
+++ b/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java
@@ -193,11 +193,17 @@ public class TezCommonUtils {
*
* @param tezSysStagingPath
* TEZ system level staging directory used for Tez internals
+ * @param strAppId
+ * Application ID
+ * @param dagPBName
+ * DAG PB Name
* @return path to store the plan in text
*/
@Private
- public static Path getTezTextPlanStagingPath(Path tezSysStagingPath) {
- return new Path(tezSysStagingPath, TezConstants.TEZ_PB_PLAN_TEXT_NAME);
+ public static Path getTezTextPlanStagingPath(Path tezSysStagingPath, String strAppId,
+ String dagPBName) {
+ String fileName = strAppId + "-" + dagPBName + "-" + TezConstants.TEZ_PB_PLAN_TEXT_NAME;
+ return new Path(tezSysStagingPath, fileName);
}
/**
http://git-wip-us.apache.org/repos/asf/tez/blob/1cee45da/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java
----------------------------------------------------------------------
diff --git a/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java b/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java
index 45d73a3..23d2dbb 100644
--- a/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java
+++ b/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java
@@ -18,7 +18,6 @@
package org.apache.tez.common;
-import java.io.File;
import java.io.IOException;
import org.apache.commons.logging.Log;
@@ -159,11 +158,13 @@ public class TestTezCommonUtils {
@Test
public void testTezTextPlanStagingPath() throws Exception {
String strAppId = "testAppId";
- Path stageDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
- Path confStageDir = TezCommonUtils.getTezTextPlanStagingPath(stageDir);
+ String dagPBName = "testDagPBName";
+ Path tezSysStagingPath = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
+ Path confStageDir =
+ TezCommonUtils.getTezTextPlanStagingPath(tezSysStagingPath, strAppId, dagPBName);
String expectedDir = RESOLVED_STAGE_DIR + Path.SEPARATOR
+ TezCommonUtils.TEZ_SYSTEM_SUB_DIR + Path.SEPARATOR + strAppId + Path.SEPARATOR
- + TezConstants.TEZ_PB_PLAN_TEXT_NAME;
+ + strAppId + "-" + dagPBName + "-" + TezConstants.TEZ_PB_PLAN_TEXT_NAME;
Assert.assertEquals(confStageDir.toString(), expectedDir);
}