[
https://issues.apache.org/jira/browse/FLINK-2646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15670070#comment-15670070
]
Kostas Kloudas commented on FLINK-2646:
---------------------------------------
Big +1 for the feature as well.
To revive the discussion, this issue seems similar to the one in the dev list,
here:
http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-Adding-a-dispose-method-in-the-RichFunction-td14466.html#a14468
In there, there is also an example with the {{BucketingSink}} illustrating the
necessity of this addition.
The only thing I want to add is that we may want to align the naming and the
responsibility of the methods with the ones
in the operators. So I would suggest to keep the {{close()}} and introduce a
{{dispose()}} method that will just be responsible for cleaning up / freeing
resources. This uniformity will also help already experienced Flink users who
know the lifecycle of an operator, grasp the role of each method faster.
> 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)