[
https://issues.apache.org/jira/browse/FLINK-5852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15887993#comment-15887993
]
ASF GitHub Bot commented on FLINK-5852:
---------------------------------------
Github user uce commented on a diff in the pull request:
https://github.com/apache/flink/pull/3365#discussion_r103429470
--- Diff:
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobExceptionsHandler.java
---
@@ -41,19 +43,23 @@ public JobExceptionsHandler(ExecutionGraphHolder
executionGraphHolder) {
@Override
public String handleRequest(AccessExecutionGraph graph, Map<String,
String> params) throws Exception {
+ return createJobExceptionsJson(graph);
+ }
+
+ public static String createJobExceptionsJson(AccessExecutionGraph
graph) throws IOException {
StringWriter writer = new StringWriter();
JsonGenerator gen =
JsonFactory.jacksonFactory.createGenerator(writer);
gen.writeStartObject();
// most important is the root failure cause
String rootException = graph.getFailureCauseAsString();
- if (rootException != null) {
- gen.writeStringField("root-exception", rootException);
+ if
(!rootException.equals(ExceptionUtils.STRINGIFIED_NULL_EXCEPTION)) {
--- End diff --
Should we have both?
```java
if (rootException != null &&
!rootException.equals(ExceptionUtils.STRINGIFIED_NULL_EXCEPTION))?
```
> Move JSON generation code into static methods
> ---------------------------------------------
>
> Key: FLINK-5852
> URL: https://issues.apache.org/jira/browse/FLINK-5852
> Project: Flink
> Issue Type: Improvement
> Components: Webfrontend
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
> Fix For: 1.3.0
>
>
> In order to implement the HistoryServer we need a way to generate the JSON
> responses independent of the REST API. As such i suggest to move the main
> parts of the generation code for job-specific handlers into static methods.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)