Regarding windows and custom trigger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding windows and custom trigger

Abdul Salam Shaikh
Hi everyone,

I have a custom trigger implemented for Generic windows. The value which is responsible for triggering the window evaluation keeps on incrementing from some lower value anywhere between 0 to 50 to a certain maximum depending on the time of the day. 

The only solution which I can see for now is to cache the last value and check with the next value. 

//within the onElement function
if(cachedvalue > currentValue) {
  return TriggerResult.FIRE;
}
return TriggerResult.CONTINUE;

​The problem is the event which fires the trigger becomes a part of the window which affects my computation. Is there any way I can exclude the last event which fires the trigger to be a part of the next window. 
 ​

--
Thanks & Regards,

Abdul Salam Shaikh

Reply | Threaded
Open this post in threaded view
|

Re: Regarding windows and custom trigger

Kostas Kloudas
Hi Abdul,

Probably the new enhanced evictors can help you do what you want.
and also in the related JIRA to see what new features they add.

Thanks,
Kostas

On Nov 30, 2016, at 4:37 PM, Abdul Salam Shaikh <[hidden email]> wrote:

Hi everyone,

I have a custom trigger implemented for Generic windows. The value which is responsible for triggering the window evaluation keeps on incrementing from some lower value anywhere between 0 to 50 to a certain maximum depending on the time of the day. 

The only solution which I can see for now is to cache the last value and check with the next value. 

//within the onElement function
if(cachedvalue > currentValue) {
  return TriggerResult.FIRE;
}
return TriggerResult.CONTINUE;

​The problem is the event which fires the trigger becomes a part of the window which affects my computation. Is there any way I can exclude the last event which fires the trigger to be a part of the next window. 
 ​

--
Thanks & Regards,

Abdul Salam Shaikh