[
https://issues.apache.org/jira/browse/FLINK-9225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
binlijin updated FLINK-9225:
----------------------------
Attachment: FLINK-9225.patch
> 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)