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

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

Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/5883


> Minor code comments fix in RuntimeContext
> -----------------------------------------
>
>                 Key: FLINK-9225
>                 URL: https://issues.apache.org/jira/browse/FLINK-9225
>             Project: Flink
>          Issue Type: Bug
>            Reporter: binlijin
>            Priority: Trivial
>         Attachments: FLINK-9225.patch
>
>
> * <pre>{@code
> * DataStream<MyType> stream = ...;
> * KeyedStream<MyType> keyedStream = stream.keyBy("id");
> *
> * keyedStream.map(new RichMapFunction<MyType, Tuple2<MyType, Long>>() {
> *
> *     private ValueState<Long> count;
> *
> *     public void open(Configuration cfg) {
> *         state = getRuntimeContext().getState(
> *                 new ValueStateDescriptor<Long>("count", 
> LongSerializer.INSTANCE, 0L));
> *     }
> *
> *     public Tuple2<MyType, Long> map(MyType value) {
> *         long count = state.value() + 1;
> *         state.update(value);
> *         return new Tuple2<>(value, count);
> *     }
> * });
>  * }</pre>
>  
> "private ValueState<Long> count;"  should be "private ValueState<Long> state;"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to