Hi all,
Please find the draft implementation at [1]. Removed getIterator() for the
moment and also changed find method to return List of events if multiple
matches happen.

[1]
https://github.com/wso2-dev/siddhi/blob/Siddhi-3.0.0/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/util/collection/SiddhiWindow.java

On Tue, Nov 4, 2014 at 12:38 PM, Tishan Dahanayakage <tis...@wso2.com>
wrote:

> Lasantha,
>
> On Tue, Nov 4, 2014 at 12:18 PM, Lasantha Fernando <lasan...@wso2.com>
> wrote:
>
>> Hi Tishan,
>>
>> On 4 November 2014 09:58, Tishan Dahanayakage <tis...@wso2.com> wrote:
>>
>>>
>>>
>>> On Tue, Nov 4, 2014 at 9:45 AM, Srinath Perera <srin...@wso2.com> wrote:
>>>
>>>> Big picture is CEP retain events within Windows, Windows with Join, and
>>>> for patterns and sequence matching. When those windows (or data structures)
>>>> are small they work ok, but when they are big they need specific
>>>> optimisations like  Indexes (B-Trees), Bloom Filters, Compression, disk
>>>> based etc.
>>>>
>>>> Idea is to hide event storage under common interface so we can write
>>>> generic code that will work with different windows joins etc and let users
>>>> select and optimize. For example, with this, the disk based window will
>>>> work with all types of windows.
>>>>
>>>> Tishan, can we merge peek and removeLat with last(boolean remove)?
>>>>
>>>
>>> ​OK.​
>>>
>>>>
>>>> --Srinath
>>>>
>>>>
>>>>
>>>> On Mon, Nov 3, 2014 at 3:26 PM, Tishan Dahanayakage <tis...@wso2.com>
>>>> 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();
>>>>>
>>>>
>>> ​//Returns the last element while removal is based on the Boolean input
>>> parameter. Returns null if remove is false.
>>>
>> I think the behaviour of the method should be "Returns null if the window
>> is empty"? A typo?.. :-)
>>
>
> ​Yeah. Thanks for pointing out.
> //Returns the last element while removal is based on Boolean input
> parameter. Returns null if window is empty.​
>
>
>> public Event getLast(Boolean remove)​
>>>
>>>>
>>>>> //Removes a specific Event if present. Else returns null.
>>>>> public void remove(Event event);
>>>>>
>>>>> ​Will remove this and merge with removeLast()​​
>>>
>>>> //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();
>>>>>
>>>>> //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();​
>>>>>
>>>>>
>> Thanks,
>> Lasantha
>>
>>> --
>>>>> 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.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> ============================
>>>> Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
>>>> Site: http://people.apache.org/~hemapani/
>>>> Photos: http://www.flickr.com/photos/hemapani/
>>>> Phone: 0772360902
>>>>
>>>
>>>
>>>
>>> --
>>> 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
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> *Lasantha Fernando*
>> Software Engineer - Data Technologies Team
>> WSO2 Inc. http://wso2.com
>>
>> email: lasan...@wso2.com
>> mobile: (+94) 71 5247551
>>
>> _______________________________________________
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> 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.
>



-- 
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
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to