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

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

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/966#discussion_r36357066
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/common/io/ReplicatingInputFormat.java
 ---
    @@ -59,7 +60,7 @@
      * @see org.apache.flink.api.common.operators.base.FilterOperatorBase
      * @see org.apache.flink.api.common.operators.base.MapPartitionOperatorBase
      */
    -public final class ReplicatingInputFormat<OT, S extends InputSplit> 
implements InputFormat<OT, S> {
    +public final class ReplicatingInputFormat<OT, S extends InputSplit> 
extends RichInputFormat<OT, S> {
    --- End diff --
    
    The `ReplicatingInputFormat` can wrap any kind of `InputFormat` (with or 
without RuntimeContext). 
    Therefore, it needs to extend `RichInputFormat` but overwrite the 
`setRuntimeContext()` method and forward the context to its wrapped IF, if this 
is also a `RichInputFormat`.
    
    Please check the updated JavaDocs as well. The wrapped IF does not need to 
be rich.


> 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
>            Assignee: Sachin Goel
>            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