-
Notifications
You must be signed in to change notification settings - Fork 440
TEZ-4333: Debug artifacts can include DAG plan in json format #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1038,6 +1038,7 @@ private void writeDebugArtifacts(DAGPlan dagPB, DAGImpl newDag) { | |
| if (debugArtifacts) { | ||
| Utils.generateDAGVizFile(newDag, dagPB, logDirs, newDag.getDAGScheduler()); | ||
| writePBTextFile(newDag); | ||
| writePBJsonFile(dagPB, newDag); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1056,6 +1057,21 @@ private void writePBTextFile(DAG dag) { | |
| } | ||
| } | ||
|
|
||
| private void writePBJsonFile(DAGPlan dagPB, DAGImpl newDag) { | ||
| String logFile = logDirs[new Random().nextInt(logDirs.length)] + File.separatorChar + newDag.getID() + "-" | ||
| + TezConstants.TEZ_PB_PLAN_JSON_NAME; | ||
|
|
||
| LOG.info("Writing DAG JSON plan to: " + logFile); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should use placeholders |
||
| File outFile = new File(logFile); | ||
| try { | ||
| PrintWriter printWriter = new PrintWriter(outFile, "UTF-8"); | ||
| printWriter.println(DAGUtils.generateSimpleJSONPlan(dagPB)); | ||
| printWriter.close(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this close should be in |
||
| } catch (IOException | JSONException e) { | ||
| LOG.warn("Failed to write TEZ_PLAN JSON to " + outFile, e); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should change to: |
||
| } | ||
| } | ||
|
|
||
| protected void addIfService(Object object, boolean addDispatcher) { | ||
| if (object instanceof Service) { | ||
| Service service = (Service) object; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think other files like
TEZ_PB_PLAN_TEXT_NAMEare intezSysStagingPath, should we keep these files also there?tez/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java
Lines 211 to 214 in 5bba1ff