You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Frank Wilson <fa...@gmail.com> on 2019/05/09 13:01:03 UTC

Reduce key state

Hi,

In an unwindowed key stream while using event time semantics is state
stored indefinitely or does it get expired eventually (was wondering if the
state inherits the event time of the element that updated, and if it
expires when the watermark goes past it).

Thanks,

Frank

Re: Reduce key state

Posted by Fabian Hueske <fh...@gmail.com>.
Hi Frank,

By default, Flink does not remove any state. It is the responsibility of
the developer to ensure that an application does not leak state.
Typically, you would use timers [1] to discard state that expired and is
not useful anymore.

In the last release 1.8, we added lazy cleanup strategies for State TTL
(time-to-live) [2] [3].
You configure a time-to-live when you define state and state is removed if
it wasn't touched for the configured interval of time. There are a bunch of
config options (is read and/or write considered as touch, strict read
protection, etc.). Right now, only processing time is supported.

Best, Fabian

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.8/dev/stream/operators/process_function.html#timers
[2]
https://flink.apache.org/news/2019/04/09/release-1.8.0.html#new-features-and-improvements
[3]
https://ci.apache.org/projects/flink/flink-docs-release-1.8/dev/stream/state/state.html#state-time-to-live-ttl

Am Do., 9. Mai 2019 um 15:01 Uhr schrieb Frank Wilson <fa...@gmail.com>:

> Hi,
>
> In an unwindowed key stream while using event time semantics is state
> stored indefinitely or does it get expired eventually (was wondering if the
> state inherits the event time of the element that updated, and if it
> expires when the watermark goes past it).
>
> Thanks,
>
> Frank
>