Thanks Max ^^
On Wed, Oct 28, 2015 at 8:41 PM, Maximilian Michels wrote:
> Oups, forgot the mapper :)
>
> static class StatefulMapper extends RichMapFunction Long>, Tuple2> {
>
>private OperatorState counter;
>
>@Override
>public Tuple2 map(Tuple2 value) throws
> Exception {
>
Oups, forgot the mapper :)
static class StatefulMapper extends RichMapFunction, Tuple2> {
private OperatorState counter;
@Override
public Tuple2 map(Tuple2 value) throws Exception {
System.out.println("Key: " + value.f0 +
" Previous state was: "+ counter.value() +
Hi Andra,
What you thought of turns out to be one of the core features of the Flink
streaming API. Flink's operators support state. State can be partitioned by
the the key using keyBy(field).
You may use a MapFunction to achieve what you wanted like so:
public static void main(String[] args) th