flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, Javier" <javier.lo...@zalando.de>
Subject Working with State example /flink streaming
Date Wed, 25 Nov 2015 15:55:51 GMT
Hi,

We are trying to do a test using States but we have not been able to
achieve our desired result. Basically we have a data stream with data as
[{"id":"11","value":123}] and we want to calculate the sum of all values
grouping by ID. We were able to achieve this using windows but not with
 states. The example that is in the documentation (
https://ci.apache.org/projects/flink/flink-docs-master/apis/streaming_guide.html#working-with-state)
is not very clear and even has some errors, for example:

public class CounterSum implements RichReduceFunction<Long>

should be

public class CounterSum extends RichReduceFunction<Long>

as RichReduceFuncion is a Class, not an interface.

We wanted to ask you if you have an example of how to use States with
Flink.

Thanks in advance for your help.

Mime
View raw message