[
https://issues.apache.org/jira/browse/FLINK-2646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15670219#comment-15670219
]
Stephan Ewen edited comment on FLINK-2646 at 11/16/16 11:34 AM:
----------------------------------------------------------------
One thing we can do is mirror the way it is done on the internal operators:
- {{close()}} is only called upon success. A Failure in {{close()}} means a
failure of the job.
- {{dispose()}} is always called, regardless of success or failure.
We could add {{dispose()}} to the {{AbstractRichFunction}} and have
{{dispose()}} call {{close()}} by default. That way, initially {{close()}} is
still called for all situations (success and not) and users can override this
into "success" and "cleanup".
was (Author: stephanewen):
One thing we can do is mirror the way it is done on the internal operators:
- {{close()}} is only called upon success. A Failure in {{close()}} means a
failure of the job.
- {{dispose()}} is always called, regardless of success or failure.
We could add {{dispose()}} to the {{AbstractRichFunction}} and have {{close()}}
call {{dispose()}} by default.
> Rich functions should provide a method "closeAfterFailure()"
> ------------------------------------------------------------
>
> Key: FLINK-2646
> URL: https://issues.apache.org/jira/browse/FLINK-2646
> Project: Flink
> Issue Type: Improvement
> Components: Core
> Affects Versions: 0.10.0
> Reporter: Stephan Ewen
> Assignee: Liang Chen
> Fix For: 1.0.0
>
>
> 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
(v6.3.4#6332)