I believe in the new implementation we should not give the iterator out This will bring lots of issues like people might get all the events and iterate them :(.
Suho On Mon, Nov 3, 2014 at 5:37 AM, Rajeev Sampath <[email protected]> wrote: > Hi, > > On Mon, Nov 3, 2014 at 3:26 PM, Tishan Dahanayakage <[email protected]> > wrote: > >> Hi all, >> >> Following is a draft of the interface of Siddhi window data structure >> that will be exposed. Rationale behind this is to seamlessly support >> different implementations such as bloom >> >> filters, disk backed window, etc. Please review this and propose >> necessary modifications. >> >> //Initializes the data structure. Configuration parameters such as size, >> indexing attributes can be passed along with Expression[] >> public void init(Expression[] expressions); >> >> //Adds objects to the data structure >> public void add(Event event); >> >> //Removes and returns last element >> public Event removeLast(); >> >> //Removes a specific Event if present. Else returns null. >> public void remove(Event event); >> >> //Returns the last element without removing >> public Event peek(); >> >> //Finds and returns a event if present in window. else returns null. >> This method is required for implementations like bloom filter >> public Event find(String attribute, Object value); >> >> //Returns an Iterator to iterate the data structure >> public Iterator<Event> iterator(); >> >> > I think it'll be also useful if this is overloaded to take parameters > (similar to find() - for cases where more than 1 event matches) > public Iterator<Event> iterator(String attribute, Object value); > > WDYT? > > > Thanks > Rajeev > > >> //Returns elements of data structure as an array for persistence purposes >> public Object[] currentState(); >> >> //Re-populate data structure with given set of Objects >> public void restoreState(Object[] objects); >> >> //Returns no of Events reside inside data structure >> public int size(); >> >> //Free up any used resources >> public void destroy(); >> >> -- >> 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. >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > Rajeev Sampath > Senior Software Engineer > WSO2, Inc.; http://www.wso2.com. > > Mobile: > * +94716265766 <%2B94716265766>* > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- *S. Suhothayan* Technical Lead & Team Lead of WSO2 Complex Event Processor *WSO2 Inc. *http://wso2.com * <http://wso2.com/>* lean . enterprise . middleware *cell: (+94) 779 756 757 | blog: http://suhothayan.blogspot.com/ <http://suhothayan.blogspot.com/>twitter: http://twitter.com/suhothayan <http://twitter.com/suhothayan> | linked-in: http://lk.linkedin.com/in/suhothayan <http://lk.linkedin.com/in/suhothayan>*
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
