TEZ-3093. CriticalPathAnalyzer should be accessible via zeppelin (rbalamohan)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/12e1aae1 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/12e1aae1 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/12e1aae1 Branch: refs/heads/TEZ-2980 Commit: 12e1aae1eac834a77e3a2b5b3be1cd6d59196d48 Parents: 89bc6ab Author: Rajesh Balamohan <[email protected]> Authored: Thu Feb 4 16:29:48 2016 -0800 Committer: Rajesh Balamohan <[email protected]> Committed: Thu Feb 4 16:29:48 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/12e1aae1/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index b7bb98a..2e484eb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Release 0.8.3: Unreleased INCOMPATIBLE CHANGES 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-2974. Tez tools: TFileRecordReader in tez-tools should support reading >2 GB tfiles. http://git-wip-us.apache.org/repos/asf/tez/blob/12e1aae1/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); }
