Re: How to export all not-null keyed ValueState

2019-05-10 Thread Averell Huyen Levan
Thank you very much, Fabian. Regards, Averell On Fri, May 10, 2019 at 9:46 PM Fabian Hueske wrote: > Hi Averell, > > I'd go with your approach any state access (given that you use RocksDB > keyed state) or deduplication of messages is going to be more expensive > than a simple cast. > > Best, F

Re: How to export all not-null keyed ValueState

2019-05-10 Thread Fabian Hueske
Hi Averell, I'd go with your approach any state access (given that you use RocksDB keyed state) or deduplication of messages is going to be more expensive than a simple cast. Best, Fabian Am Fr., 10. Mai 2019 um 13:08 Uhr schrieb Averell Huyen Levan < lvhu...@gmail.com>: > Hi Fabian, > > Thanks

Re: How to export all not-null keyed ValueState

2019-05-10 Thread Averell Huyen Levan
Hi Fabian, Thanks for that. However, as I mentioned in my previous email, that implementation requires a lot of typecasting/object wrapping. I tried to broadcast that Toggle stream - the toggles will be saved as a MapState, and whenever an export trigger record arrived, I send out that MapState. T

Re: How to export all not-null keyed ValueState

2019-05-10 Thread Fabian Hueske
Hi Averell, Ah, sorry. I had assumed the toggle events where broadcasted anyway. Since you had both streams keyed, your current solution looks fine to me. Best, Fabian Am Fr., 10. Mai 2019 um 03:13 Uhr schrieb Averell Huyen Levan < lvhu...@gmail.com>: > Hi Fabian, > > Sorry, but I am still conf

Re: How to export all not-null keyed ValueState

2019-05-09 Thread Averell Huyen Levan
Hi Fabian, Sorry, but I am still confused about your guide. If I union the Toggle stream with the StateReportTrigger stream, would that means I need to make my Toggles broadcasted states? Or there's some way to modify the keyed states from within the processBroadcastElement() method? I tried to i

Re: How to export all not-null keyed ValueState

2019-05-09 Thread Fabian Hueske
Hi, Passing a Context through a DataStream definitely does not work. You'd need to have the keyed state that you want to scan over in the KeyedBroadcastProcessFunction. For the toggle filter use case, you would need to have a unioned stream with Toggle and StateReport events. For the output, you

Re: How to export all not-null keyed ValueState

2019-05-09 Thread Averell
Thank you Congxian and Fabian. @Fabian: could you please give a bit more details? My understanding is: to pass the context itself and an OutputTag to the KeyedStateFunction parameter of KeyedBroadcastProcessFunction#Context.applyToKeyedState(), and from within that KeyedStateFunction.process() se

Re: How to export all not-null keyed ValueState

2019-05-09 Thread Fabian Hueske
Hi, The KeyedBroadcastProcessFunction has a method to iterate over all keys of a keyed state. This function is available via the Context object of the processBroadcast() method. Hence you need a broadcasted message to trigger the operation. Best, Fabian Am Do., 9. Mai 2019 um 08:46 Uhr schrieb C

Re: How to export all not-null keyed ValueState

2019-05-08 Thread Congxian Qiu
Hi, Averell AFAIK, we can't get all the key-values from value state, but MapState has a function called `entries` can do this, maybe can use MapState as a workaround. On May 7, 2019, 16:16 +0800, Averell , wrote: > Hi, > > I have a keyed value state which is available for only about 1% the total

How to export all not-null keyed ValueState

2019-05-07 Thread Averell
Hi, I have a keyed value state which is available for only about 1% the total number of keyed values that I have. Is there any way to get the values of all those state values? I looked at the queryable state option, but it looks like supporting querying by keyed value only. Thanks and best rega