flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GJL <...@git.apache.org>
Subject [GitHub] flink pull request #5168: [FLINK-8234][flip6] WIP
Date Wed, 20 Dec 2017 08:26:17 GMT
Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5168#discussion_r157960760
  
    --- 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 --
    
    Not needed anymore.


---

Mime
View raw message