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

ASF GitHub Bot commented on FLINK-3777:
---------------------------------------

Github user fhueske commented on the pull request:

    https://github.com/apache/flink/pull/1903#issuecomment-212483482
  
    Thanks for this PR @fpompermaier.
    
    We need to check all places where `InputFormat.configure()` is called to 
ensure that we free resources as promised in the JavaDocs of 
`RichInputFormat.closeInputFormat()`. I found a few more spots where we need to 
call `closeInputFormat()` if the IF is a `RichInputFormat`.
    
    - ReplicatingInputFormat which is a wrapper for other input formats.
    - DataSourceNode.computeOperatorSpecificDefaultEstimates() which tries to 
obtain some input statistics and initializes the input format with 
`configure()`.
    - `InputFormatVertex.initializeOnMaster()` calls `configure()` as well.
    
    It would also be good to add a test that the closeInputFormat() method is 
actually called.


> Add open and close methods to manage IF lifecycle
> -------------------------------------------------
>
>                 Key: FLINK-3777
>                 URL: https://issues.apache.org/jira/browse/FLINK-3777
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.0.1
>            Reporter: Flavio Pompermaier
>            Assignee: Flavio Pompermaier
>              Labels: inputformat, lifecycle
>
> At the moment the opening and closing of an inputFormat are not managed, 
> although open() could be (improperly IMHO) simulated by configure().
> This limits the possibility to reuse expensive resources (like database 
> connections) and manage their release. 
> Probably the best option would be to add 2 methods (i.e. openInputformat() 
> and closeInputFormat() ) to RichInputFormat*
> * NOTE: the best option from a "semantic" point of view would be to rename 
> the current open() and close() to openSplit() and closeSplit() respectively 
> while using open() and close() methods for the IF lifecycle management, but 
> this would cause a backward compatibility issue...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to