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 can use side outputs to route the different outputs to
different streams.

Best, Fabian

Am Do., 9. Mai 2019 um 10:34 Uhr schrieb Averell <lvhu...@gmail.com>:

> 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() send out the side output. Am I
> understand your idea correctly?
>
> BTW, I have another question regarding KeyedBroadcastProcessFunction best
> practice: I am having two streams: Data and Toggle. The stream Toggle is
> just a keyed boolean stream, being used to filter data from the stream
> Data.
> And I am implementing that filter using a simple RichCoFlatMapFunction.
>
> Now that I want to export the list of keys which are currently toggled on.
> Should I
> (1) have one additional KeyedBroadcastProcessFunction operator (which has
> Toggle and BroadCast as the input streams), or
> (2) replace that RichCoFlatMapFunction with a new
> KeyedBroadcastProcessFunction, which has both functionalities: filter and
> export? Doing this would require unioning Toggle and Data into one single
> keyed stream.
>
> Thanks and best regards,
> Averell
>
>
>
>
> --
> Sent from:
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>

Reply via email to