You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/04/15 07:34:00 UTC

[jira] [Resolved] (FLINK-13880) The behavior of JobExecutionResult.getAccumulatorResult does not match its java doc

     [ https://issues.apache.org/jira/browse/FLINK-13880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu resolved FLINK-13880.
-----------------------------
    Fix Version/s: 1.11.0
       Resolution: Fixed

Fixed in master (1.11.0): 936cb6553580b72a37652417063accf5773971df

> The behavior of JobExecutionResult.getAccumulatorResult does not match its java doc
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-13880
>                 URL: https://issues.apache.org/jira/browse/FLINK-13880
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Core
>    Affects Versions: 1.11.0
>            Reporter: Caizhi Weng
>            Assignee: Caizhi Weng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The java doc of `JobExecutionResult.getAccumulatorResult` states that "Returns \{@code null}, if no accumulator with that name was produced", but actually an NPE will be triggered if no accumulator with that name is produced.
> I'm going to rewrite the `getAccumulatorResult` method to the following:
> {code:java}
> public <T> T getAccumulatorResult(String accumulatorName) {
>    OptionalFailure<Object> result = this.accumulatorResults.get(accumulatorName);
>    if (result != null) {
>       return (T) result.getUnchecked();
>    } else {
>       return null;
>    }
> }
> {code}
> Please assign this issue to me if this solution is acceptable.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)