1

How can I invoke a method like

select udf(a,b) from Event.win:length_batch(5)

and print the window of size 5 out again. Say i send the following events:

runtime.sendEvent(new Event(1,2));
runtime.sendEvent(new Event(3,4));
runtime.sendEvent(new Event(4,2));
runtime.sendEvent(new Event(6,8));
runtime.sendEvent(new Event(4,6));

and print them out in the same order after batching them. This means that the method invoked udf(a,b) shall only be executed once per batch. I have used the updatelistener, but I have to invoke it as a method event though i can get the desired result using the listener.

Thanks.

wandapong
  • 59
  • 5

1 Answers1

1

I think you are looking for "subscribers".

Subscribers in doc

public void update(Event[] rows) {...}
goodie
  • 364
  • 1
  • 2
  • 4
  • EDIT: I see its alsmot the same way as adding a listener. I will test it out meanwhile. Thanks – wandapong Oct 03 '16 at 22:15
  • but the update() method is invoked when setSubscriber(sub)? this is almost the same as setting a listener. What I want is the method specified in my query to do what is possible with the update(Event[] new, Event[] old) method without the need for setting it as a subscriber. The update method is basically the same s the updatelistener no? – wandapong Oct 04 '16 at 09:23