Re: No key found restore States

2016-06-03 Thread Aljoscha Krettek
Hi, right now, the way to do it is by using a custom operator, i.e. a OneInputStreamOperator. There you have the low-level control and can set timers based on watermarks or processing time. You can, for example look at StreamMap for a very simple operator or WindowOperator for an operator that does

Re: No key found restore States

2016-06-02 Thread simon peyer
Hi In other words, what's the easiest way to clean up states in flink, if this key may never arrive again? --Thanks Simon > On 02 Jun 2016, at 10:16, simon peyer wrote: > > Hi Max > > Thanks for your answer. > We have some states, on some keys, which we would like to delete after a > certai

Re: No key found restore States

2016-06-02 Thread simon peyer
Hi Max Thanks for your answer. We have some states, on some keys, which we would like to delete after a certain time. And since there is no option at the moment to put an "expiriece" date on it, I just use the snapshot function to test and verify if the current key is still in some threshold.

Re: No key found restore States

2016-06-01 Thread Maximilian Michels
Hi Simon, You don't need to write any code to checkpoint the Keyed State. It is done automatically by Flink. Just remove the `snapshoteState(..)` and `restoreState(..)` methods. Cheers, Max On Wed, Jun 1, 2016 at 4:00 PM, simon peyer wrote: > Hi Max > > I'm using a keyby but would like to store

Re: No key found restore States

2016-06-01 Thread simon peyer
Hi Max I'm using a keyby but would like to store the state. Thus what's the way to go? How do I have to handle the state in option 2). Could you give an example? Thanks --Simon > On 01 Jun 2016, at 15:55, Maximilian Michels wrote: > > Hi Simon, > > There are two types of state: > > > 1)

Re: No key found restore States

2016-06-01 Thread Maximilian Michels
Hi Simon, There are two types of state: 1) Keyed State The state you access via `getRuntimeContext().getState(..)` is scoped by key. If no key is in the scope, the key is null and update operations won't work. Use a `keyBy(..)` before your map function to partition the state by key. The state i