flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: Timers and state
Date Mon, 05 Mar 2018 16:15:11 GMT
Hi Alberto,

You can also add another MapState<Long, Key>. The key is a timestamps and
the value is the key that you want to discard.
When onTimer() is called, you look up the key in the MapState<Long, Key>
and and remove it from the original MapState.

Best, Fabian

2018-03-05 0:48 GMT-08:00 Xingcan Cui <xingcanc@gmail.com>:

> Hi Alberto,
> an ultimate solution for your problem would be a map state with ordered
> keys (like a TreeMap), but unfortunately, this is still a WIP feature.
> For now, maybe you could "eagerly removeā€ the outdated value (with
> `iterator.remove()`) when iterating the map state in the process function
> or split the key space for your map state into static bins, thus you could
> calculate a set of outdated keys before removing them.
> Hope that helps.
> Best,
> Xingcan
> On 5 Mar 2018, at 4:19 PM, Alberto Mancini <ab.mancini@gmail.com> wrote:

View raw message