0

I need store a white list by 2 mins, but i need execute a query (using my white list) when a new stream arrive. I am using two stream with the next code:

I need to charge my WHITELIST updated every two minutes.

define trigger periodicalTriggerStream at every 2 min;

from DSB_TEMPORAL#window.time(2 min)
select wlist:whitelist() as whitel , DSB_licensekey, flg_urldsb
insert into temporal;

I need that this query execute when arrive a new event. (I use my whitelist)

from temporal
select findwlist:findwhitelist(DSB_licensekey, flg_urldsb, whitel) as flg_url11
insert into temporal_WL11;

Is it posible?

Community
  • 1
  • 1
  • Please give more context on what is wlist:whitelist() and findwlist:findwhitelist() do? – suho Jul 29 '16 at 04:52
  • thank you, wlist:whitelist() is a function extension that receive a json array. findwlist:findwhitelist is other function extension that receive a string. I want that wlist:whitelist() execute every two minutes and i want that findwlist:findwhitelist execute every new event arrive, but in findwlist:findwhitelist I use the information that receive in wlist:whitelist(). – ROBY HERNAN RUBIANO Jul 29 '16 at 06:38

1 Answers1

1

Will this work?

define trigger periodicalTriggerStream at every 2 min;

from periodicalTriggerStream
select wlist:whitelist() as whitel 
insert into whitelStream;

from whitelStream#window.length(1) join newEventStream 
select findwlist:findwhitelist(DSB_licensekey, flg_urldsb, whitel) as flg_url11
insert into temporal_WL11;

The basic idea is you calculate wlist:whitelist() every 2 min, store the results in #window.length(1) and then join the new events with the event window.

suho
  • 912
  • 6
  • 12