Hi Jonathan, Your requirement can be achieved by using a custom time window extension. It can be implemented using java and then used within Siddhi query. Following documentation will Introduce you to extending Siddhi [1] and writing window extensions [2]. These extensions are formerly known as 'stream function extensions' since they operate on incoming event stream. Within the process method you can implement your processing logic and within init method you can perform whatever the initialization tasks that you want.
On another note while I acknowledge that this approach is CPU efficient, if the time period for which you evaluate the pattern is small then this improvement will only have minor impact. In a case like that you can use in-built pattern functionality of Siddhi [3]. [1] https://docs.wso2.com/display/CEP400/SiddhiQL+Guide+3.0#SiddhiQLGuide3.0-SiddhiExtensions [2] https://docs.wso2.com/display/CEP400/Writing+a+Custom+Stream+Function+Extension [3] https://docs.wso2.com/display/CEP400/SiddhiQL+Guide+3.0#SiddhiQLGuide3.0-Pattern Thanks Tishan On Thu, Sep 24, 2015 at 2:09 PM, Jonathan Yom-Tov <[email protected]> wrote: > hi, > > I'd like to write an extension to Siddhi that changes the way it finds > event sequences and patterns. The idea would is that I would be trying to > find sequences/patterns in order of selectivity, not time. For example, say > I wanted to match A->B->C, but I know that C is the rarest event, followed > by B and A. So I would keep a buffer of events until I found a C event, > then look for a B event in the buffer, then for an A. According to > http://assaf.net.technion.ac.il/files/2013/01/DEBS-2015.pdf this would > make the matching significantly more efficient in terms of CPU and memory > required. > > The problem is, I'm not sure which classes I should override/look into. > As it's the actual pattern matching functionality I have to modify it seems > extending Windows, Transformers, OutputAttributeProcessors, Functions is > not the way to go. Does anyone have any pointers? > > thanks, > Jon. > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Tishan Dahanayakage Software Engineer WSO2, Inc. Mobile:+94 716481328 Disclaimer: This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, re-transmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
