Repository: tez
Updated Branches:
  refs/heads/branch-0.7 ca0ecab2c -> 087c94280


TEZ-3093. CriticalPathAnalyzer should be accessible via zeppelin (rbalamohan)

(cherry picked from commit 12e1aae1eac834a77e3a2b5b3be1cd6d59196d48)


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

Branch: refs/heads/branch-0.7
Commit: 7b5e692f48833bccc747a75ac490d5a0b9574f5d
Parents: ca0ecab
Author: Rajesh Balamohan <[email protected]>
Authored: Thu Feb 4 16:29:48 2016 -0800
Committer: Rajesh Balamohan <[email protected]>
Committed: Thu Feb 4 19:06:50 2016 -0800

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../tez/analyzer/plugins/CriticalPathAnalyzer.java       | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/7b5e692f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0d7433c..5127ba8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
   TEZ-2972. Avoid task rescheduling when a node turns unhealthy
 
 ALL CHANGES
+  TEZ-3093. CriticalPathAnalyzer should be accessible via zeppelin
   TEZ-3089. TaskConcurrencyAnalyzer can return negative task count with very 
large jobs
   TEZ-2307. Possible wrong error message when submitting new dag
   TEZ-3076. Reduce merge memory overhead to support large number of in-memory 
mapoutputs

http://git-wip-us.apache.org/repos/asf/tez/blob/7b5e692f/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/CriticalPathAnalyzer.java
----------------------------------------------------------------------
diff --git 
a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/CriticalPathAnalyzer.java
 
b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/CriticalPathAnalyzer.java
index d4efdf9..a7e37ab 100644
--- 
a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/CriticalPathAnalyzer.java
+++ 
b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/CriticalPathAnalyzer.java
@@ -62,6 +62,7 @@ public class CriticalPathAnalyzer extends TezAnalyzerBase 
implements Analyzer {
   }
 
   public static final String DRAW_SVG = "tez.critical-path-analyzer.draw-svg";
+  public static final String SVG_DIR = "output-dir";
 
   public static class CriticalPathStep {
     public enum EntityType {
@@ -111,6 +112,10 @@ public class CriticalPathAnalyzer extends TezAnalyzerBase 
implements Analyzer {
   public CriticalPathAnalyzer() {
   }
 
+  public CriticalPathAnalyzer(Configuration conf) {
+    setConf(conf);
+  }
+
   @Override 
   public void analyze(DagInfo dagInfo) throws TezException {
     // get all attempts in the dag and find the last failed/succeeded attempt.
@@ -152,7 +157,11 @@ public class CriticalPathAnalyzer extends TezAnalyzerBase 
implements Analyzer {
   
   private void saveCriticalPathAsSVG(DagInfo dagInfo) {
     SVGUtils svg = new SVGUtils();
-    String outputFileName = getOutputDir() + File.separator + 
dagInfo.getDagId() + ".svg";
+    String outputDir = getOutputDir();
+    if (outputDir == null) {
+      outputDir = getConf().get(SVG_DIR);
+    }
+    String outputFileName = outputDir + File.separator + dagInfo.getDagId() + 
".svg";
     System.out.println("Writing output to: " + outputFileName);
     svg.saveCriticalPathAsSVG(dagInfo, outputFileName, criticalPath);
   }

Reply via email to