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

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

Github user sachingoel0101 commented on the pull request:

    https://github.com/apache/flink/pull/966#issuecomment-127037112
  
    @StephanEwen, it would be much simpler to have an interface. But then we 
leave the part about implementing the `setRuntimeContext` and 
`getRuntimeContext` to the user. IMO that's not a very good option. So it makes 
to extend rich formats from abstract Rich formats. Doing that, I couldn't 
figure out a better solution if we want to make all existing IO formats rich. 
To sum it up:
    1. If we only defined an interface, we leave the implementation of `setter` 
and `getter` methods to the user.
    2. If we write a Rich abstract class, we have to make all existing IO 
formats rich since the user might want to extend one of these, and of course 
can't extend two classes.
    If there's a way to achieve this, let me know. I might have missed 
something.
    
    As for the `postConfigure` method, it was to guarantee that the 
`RuntimeContext` will be available now. I tried initializing the context in 
`DataSourceTask` and `DataSinkTask` before calling `configure`, but it seems 
the format is re-initialized somewhere as that information is lost. I could 
remove this function and we can just initialize `counters` etc. in `open` call.


> Allow access to RuntimeContext from Input and OutputFormats
> -----------------------------------------------------------
>
>                 Key: FLINK-1819
>                 URL: https://issues.apache.org/jira/browse/FLINK-1819
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>    Affects Versions: 0.9, 0.8.1
>            Reporter: Fabian Hueske
>            Priority: Minor
>             Fix For: 0.9
>
>
> User function that extend a RichFunction can access a {{RuntimeContext}} 
> which gives the parallel id of the task and access to Accumulators and 
> BroadcastVariables. 
> Right now, Input and OutputFormats cannot access their {{RuntimeContext}}.



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

Reply via email to