You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Kostas Kloudas (Jira)" <ji...@apache.org> on 2020/01/24 18:38:00 UTC

[jira] [Comment Edited] (FLINK-2646) User functions should be able to differentiate between successful close and erroneous close

    [ https://issues.apache.org/jira/browse/FLINK-2646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023164#comment-17023164 ] 

Kostas Kloudas edited comment on FLINK-2646 at 1/24/20 6:37 PM:
----------------------------------------------------------------

For [~sewen]'s comment, I totally agree that now one method is enough. In the FLIP I mention 2 methods ({{prepareToShutdown}} and {{shutdown}}) because as mention in the "Assumption" block, we assume that for batch we do not have checkpointing. The FLIP was written some time ago and Flink has evolved quite much since then and the plans for {{DataStream}} subsuming {{DataSet}} have become more concrete. If we have checkpointing, then there seems to be no reason for a separate method and {{shutdown()}} or {{endOfStream()}} seems enough.


was (Author: kkl0u):
For [~sewen]'s comment, I totally agree that now one method is enough. In the FLIP I mention 2 methods because as mentioned in the "Assumption" block, we assume that for batch we do have checkpointing. The FLIP was written some time ago and Flink has evolved quiet much since then. If we have checkpointing, then there seems to be no reason for a separate method and {{shutdown()}} or {{endOfStream()}} seems enough.

> User functions should be able to differentiate between successful close and erroneous close
> -------------------------------------------------------------------------------------------
>
>                 Key: FLINK-2646
>                 URL: https://issues.apache.org/jira/browse/FLINK-2646
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / DataStream
>    Affects Versions: 0.10.0
>            Reporter: Stephan Ewen
>            Assignee: Kostas Kloudas
>            Priority: Major
>              Labels: usability
>
> Right now, the {{close()}} method of rich functions is invoked in case of proper completion, and in case of canceling in case of error (to allow for cleanup).
> In certain cases, the user function needs to know why it is closed, whether the task completed in a regular fashion, or was canceled/failed.
> I suggest to add a method {{closeAfterFailure()}} to the {{RichFunction}}. By default, this method calls {{close()}}. The runtime is the changed to call {{close()}} as part of the regular execution and {{closeAfterFailure()}} in case of an irregular exit.
> Because by default all cases call {{close()}} the change would not be API breaking.



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