You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Truong Duc Kien <du...@gmail.com> on 2016/12/29 09:39:13 UTC

What is the advantages of ReducingState over ValueState and vice versa ?

Hi all,

Since both ReducingState and ValueState store a single value, there are
many use cases where both can be used.
When should we use one instead of the other ?

Best regards,
Kien

Re: What is the advantages of ReducingState over ValueState and vice versa ?

Posted by Stephan Ewen <se...@apache.org>.
Hi!

Currently, there will not be much difference in how the execution behaves
(assuming you manually read from the value state, aggregate, and write
back). Think of the ReducingState as syntactic sugar.

However, the ReducingState has the potential for performance optimizations
(deferred reducing if values are currently not in memory). That is not
really exploited at the moment, though.

On the other hand, the value state has the advantage that it is a bit more
flexible, and you can change the logic easier when upgrading the program.

Greetings,
Stephan




On Thu, Dec 29, 2016 at 10:39 AM, Truong Duc Kien <du...@gmail.com>
wrote:

> Hi all,
>
> Since both ReducingState and ValueState store a single value, there are
> many use cases where both can be used.
> When should we use one instead of the other ?
>
> Best regards,
> Kien
>