Re: save state in windows operation

2016-04-21 Thread Rubén Casado
[Spain] www.treelogic.com __ - Mensaje original - De: "Aljoscha Krettek" Para: user@flink.apache.org Enviados: Jueves, 21 de Abril 2016 11:21:00 GMT +01:00 Amsterdam / Berlín / Berna / Roma / Estocolmo / Viena Asunto: Re: save state

Re: save state in windows operation

2016-04-21 Thread Aljoscha Krettek
Hi, you should be able to do this using Flink's state abstraction in a RichWindowFunction like this: public static class MyApplyFunction extends RichWindowFunction, Tuple2, Tuple, GlobalWindow> { ValueStateDescriptor> stateDescriptor = new ValueStateDescriptor<>("last-result",

save state in windows operation

2016-04-21 Thread Rubén Casado
Hello, We have problems working with states in Flink and I am sure you can help us :-) Let's say we have a workflow something like: DataStream myData = env.from... myData.map(new MyMap (..)) .keyBy(0) .countWindow(n) .apply(new MyApplyFunction()) .writeAsCSV(...) To implement the