-
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?
Conversation
|
💔 -1 overall
This message was automatically generated. |
ayushtkn
left a comment
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.
Thanx @abstractdog , this sounds cool thing to do, dropped some minor comments/question.
rest LGTM
| 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); |
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.
should use placeholders
LOG.info("Writing DAG JSON plan to: {}", logFile);
| } | ||
|
|
||
| private void writePBJsonFile(DAGPlan dagPB, DAGImpl newDag) { | ||
| String logFile = logDirs[new Random().nextInt(logDirs.length)] + File.separatorChar + newDag.getID() + "-" |
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_NAME are in tezSysStagingPath, 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
| 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); |
| printWriter.println(DAGUtils.generateSimpleJSONPlan(dagPB)); | ||
| printWriter.close(); | ||
| } catch (IOException | JSONException e) { | ||
| LOG.warn("Failed to write TEZ_PLAN JSON to " + outFile, e); |
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.
should change to:
LOG.warn("Failed to write TEZ_PLAN JSON to {}", outFile, e);
| try { | ||
| PrintWriter printWriter = new PrintWriter(outFile, "UTF-8"); | ||
| printWriter.println(DAGUtils.generateSimpleJSONPlan(dagPB)); | ||
| printWriter.close(); |
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 this close should be in finally block or we should use try-with-resource for printWriter, else if printWriter.println(DAGUtils.generateSimpleJSONPlan(dagPB)); this throws exception, we won't be closing the printWritter
|
@abstractdog I think If you address the comments this should be good to go :-) |
No description provided.