tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-512. Write the dag plan to disk when using sessions, if at the DEBUG log level. (sseth)
Date Fri, 27 Sep 2013 00:44:28 GMT
Updated Branches:
  refs/heads/master 2debbca59 -> 06c7e1da3


TEZ-512. Write the dag plan to disk when using sessions, if at the DEBUG
log level. (sseth)


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

Branch: refs/heads/master
Commit: 06c7e1da376fa7491072820a1bd7a36dd85158a7
Parents: 2debbca
Author: Siddharth Seth <sseth@apache.org>
Authored: Thu Sep 26 17:44:13 2013 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Thu Sep 26 17:44:13 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/dag/app/DAGAppMaster.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/06c7e1da/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index 67fe763..b846992 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -21,6 +21,7 @@ package org.apache.tez.dag.app;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -612,6 +613,21 @@ public class DAGAppMaster extends AbstractService {
       // RPC server runs in the context of the job user as it was started in
       // the job user's UGI context
       LOG.info("Starting DAG submitted via RPC");
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Writing DAG plan to: " + TezConfiguration.TEZ_PB_PLAN_TEXT_NAME);
+        
+        File outFile = new File(TezConfiguration.TEZ_PB_PLAN_TEXT_NAME);
+        try {
+          PrintWriter printWriter = new PrintWriter(outFile);
+          String dagPbString = dagPlan.toString();
+          printWriter.println(dagPbString);
+          printWriter.close();
+        } catch (IOException e) {
+          throw new TezException("Failed to write TEZ_PLAN to " + outFile.toString(), e);
+        }
+        
+        
+      }
       startDAG(dagPlan);
       return currentDAG.getID().toString();
     }


Mime
View raw message