You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Boris Lublinsky <bo...@lightbend.com> on 2018/08/31 10:17:59 UTC

Using Managed Keyed State

Documentation https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-keyed-state <https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-keyed-state> lists ValueState<T> and List<T>, but their semantics seems to be different. In my tests ValueState<T> is associated with key, but it is not clear to me what List<T> is associated it.
I tried to test List[String] and ValueState[ModelBuffer[String]] and they behave very differently. Can you, please clarify the differences and usage patterns? 

Boris Lublinsky
FDP Architect
boris.lublinsky@lightbend.com
https://www.lightbend.com/


Re: Using Managed Keyed State

Posted by Andrey Zagrebin <an...@data-artisans.com>.
Hi,

If you ask about keyed state, you probably mean ListState<T>, because in any case List<T> is just java object for a concrete value of state. ListState<T> is also scoped by current record key as ValueState<T> but adds some list specific functionality. They are state object handles. Keyed state is also distributed by key, same way as record processing.

There is also an operator state types which are scoped by the operator, not by any record key. One of them also behaves similar to ListState<T> [1] but not per key. Operator state is distributed between parallel subtasks of the operator.

Best,
Andrey

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-operator-state <https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-operator-state>

> On 31 Aug 2018, at 12:17, Boris Lublinsky <bo...@lightbend.com> wrote:
> 
> Documentation https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-keyed-state <https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/state/state.html#using-managed-keyed-state> lists ValueState<T> and List<T>, but their semantics seems to be different. In my tests ValueState<T> is associated with key, but it is not clear to me what List<T> is associated it.
> I tried to test List[String] and ValueState[ModelBuffer[String]] and they behave very differently. Can you, please clarify the differences and usage patterns? 
> 
> Boris Lublinsky
> FDP Architect
> boris.lublinsky@lightbend.com <ma...@lightbend.com>
> https://www.lightbend.com/
>