[ https://issues.apache.org/jira/browse/FLINK-8234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294970#comment-16294970 ]
ASF GitHub Bot commented on FLINK-8234: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/5168#discussion_r157475492 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/client/SerializedJobExecutionResult.java --- @@ -55,6 +56,26 @@ public SerializedJobExecutionResult(JobID jobID, long netRuntime, this.accumulatorResults = accumulators; } + /** + * Creates an instance from {@link JobExecutionResult}. + */ + public static SerializedJobExecutionResult from(final JobExecutionResult jobExecutionResult) { + final Map<String, Object> accumulatorResults = jobExecutionResult.getAllAccumulatorResults(); + + final Map<String, SerializedValue<Object>> serializedAccumulatorResults = new HashMap<>(accumulatorResults.size()); + for (final Map.Entry<String, Object> entry : accumulatorResults.entrySet()) { + try { + serializedAccumulatorResults.put(entry.getKey(), new SerializedValue<>(entry.getValue())); + } catch (final IOException e) { + throw new RuntimeException(e); --- End diff -- We shouldn't throw `RuntimeExceptions` but instead let the `IOException` bubble up. > Cache JobExecutionResult from finished JobManagerRunners > -------------------------------------------------------- > > Key: FLINK-8234 > URL: https://issues.apache.org/jira/browse/FLINK-8234 > Project: Flink > Issue Type: Sub-task > Components: Distributed Coordination > Affects Versions: 1.5.0 > Reporter: Till Rohrmann > Assignee: Gary Yao > Labels: flip-6 > Fix For: 1.5.0 > > > In order to serve the {{JobExecutionResults}} we have to cache them in the > {{Dispatcher}} after the {{JobManagerRunner}} has finished. The cache should > have a configurable size and should periodically clean up stale entries in > order to avoid memory leaks. -- This message was sent by Atlassian JIRA (v6.4.14#64029)