Hi Sachini,

Thanks for the explanation.

Regards,
Grainier

On Thu, Sep 24, 2015 at 3:47 AM, Sachini Jayasekara <[email protected]>
wrote:

> Hi Grainier,
>
>
> *FrequentWindowProcessor* is based on Misra-Gries counting algorithm.
>
>
> Parameter: sizeOftheMap + key to group the events (If no keys are given
> the concatenation of all the attributes of the event is considered as the
> key)
>
> We keep a map of (key,counter)
> Whenever an event comes,
>  generate the key based on the parameters given
>                           check the map for that key.
>                           if the key is already in the map increment the
> count by 1; add event to the window ; remove the old event corresponding to
> the key from the window
>                           else if it's not there
>                                                   if map size <=
> sizeOftheMap  add a new entry to the map with (key,count=1); add event to
> the window
>                                                   else if size >
> sizeOftheMap
>                                                            decrement the
> count stored in the map by 1 for all the entries
>   remove all the entries which has count 0 from the map and from the
> window
>                                                                if count of
> none of the entries in the map becomes 0, discard the new event
>                                                                else add
> the new entry to map with (key,count=1) ; add event to the window
>
>
>
>
> *LossyFrequentProcessor* - based on Lossy Counting algorithm is also for
> frequency counts
>
> Parameters: support threshold, error bound, key to group the events (If no
> keys are given the concatenation of all the attributes of the event is
> considered as the key)
>
> In this algorithm events are divided into buckets.
>
> We keep a map of (key, lossycount [bucket id, count] )
> Whenever an event comes,
>                           calculate the bucketId
>  generate the key based on the parameters given
>  check the map for that key.
>                           if the key is already in the map increment the
> count by 1;
>                           else if it's not there add a new entry to the
> map with (key,[bucketId,1])
>                           event removal and insertion to the window is
> done based on the user given parameters. (You can check the code for the
> exact conditions)
>
>
> Thanks,
> Sachini
>
> On Wed, Sep 23, 2015 at 1:04 AM, Grainier Perera <[email protected]>
> wrote:
>
>> Hi Sachini,
>>
>> Could you provide a small description on the functionality, parameters
>> and return types of Frequent window processor and Lossy frequent window
>> processor of Siddhi inbuilt windows?
>>
>> Thanks,
>> Grainier.
>> --
>> Grainier Perera
>> Software Engineer
>> Mobile : +94716122384
>> WSO2 Inc. | http://wso2.com
>> lean.enterprise.middleware
>>
>
>
>
> --
>
>
>
> *Thanks & Regards,Sachini JayasekaraSoftware Engineer; **WSO2 Inc. *
>
> *lean . enterprise . middleware |  http://wso2.com <http://wso2.com> *
>
> Mobile : +94712371165
>



-- 
Grainier Perera
Software Engineer
Mobile : +94716122384
WSO2 Inc. | http://wso2.com
lean.enterprise.middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to