Re: Emitting current state to a sink

2019-04-30 Thread M Singh
Thanks Avi for your help.  Mans On Tuesday, April 30, 2019, 5:57:51 AM EDT, Avi Levi wrote: Sure!  you get the context and the collector in the processBroadcastElement method see snippet below  override def processBroadcastElement(value: BroadcastRequest, ctx:

Re: Emitting current state to a sink

2019-04-30 Thread Avi Levi
Sure! you get the context and the collector in the processBroadcastElement method see snippet below override def processBroadcastElement(value: BroadcastRequest, ctx: KeyedBroadcastProcessFunction[String, Request, BroadcastRequest, String]#Context, out: Collector[String]): Unit = {

Re: Emitting current state to a sink

2019-04-29 Thread M Singh
Hi Avi: Can you please elaborate (or include an example/code snippet) of how you were able to achieve collecting the keyed states from the processBroadcastElement method using the applyToKeyedState ?  I am trying to understand which collector you used to emit the state since the broadcasted

Re: Emitting current state to a sink

2019-04-29 Thread Fabian Hueske
Nice! Thanks for the confirmation :-) Am Mo., 29. Apr. 2019 um 13:21 Uhr schrieb Avi Levi : > Thanks! Works like a charm :) > > On Mon, Apr 29, 2019 at 12:11 PM Fabian Hueske wrote: > >> *This Message originated outside your organization.* >> -- >> Hi Avi, >> >> I'm

Re: Emitting current state to a sink

2019-04-29 Thread Avi Levi
Thanks! Works like a charm :) On Mon, Apr 29, 2019 at 12:11 PM Fabian Hueske wrote: > *This Message originated outside your organization.* > -- > Hi Avi, > > I'm not sure if you cannot emit data from the keyed state when you > receive a broadcasted message. > The

Re: Emitting current state to a sink

2019-04-29 Thread Fabian Hueske
Hi Avi, I'm not sure if you cannot emit data from the keyed state when you receive a broadcasted message. The Context parameter of the processBroadcastElement() method in the KeyedBroadcastProcessFunction has the applyToKeyedState() method. The method takes a KeyedStateFunction that is applied

Re: Emitting current state to a sink

2019-04-26 Thread Avi Levi
Hi Timo, I defiantly did. but broadcasting a command and trying to address the persisted state (I mean the state of the data stream and not the broadcasted one) you get the exception that I wrote (java.lang.NullPointerException: No key set. This method should not be called outside of a keyed

Re: Emitting current state to a sink

2019-04-26 Thread Timo Walther
Hi Avi, did you have a look at the .connect() and .broadcast() API functionalities? They allow you to broadcast a control stream to all operators. Maybe this example [1] or other examples in this repository can help you. Regards, Timo [1]

Emitting current state to a sink

2019-04-25 Thread Avi Levi
Hi, We have a keyed pipeline with persisted state. Is there a way to broadcast a command and collect all values that persisted in the state ? The end result can be for example sending a fetch command to all operators and emitting the results to some sink why do we need it ? from time to time we