>
> On Thu, Aug 18, 2016 at 1:00 PM, Rajjaz Mohammed <[email protected]> wrote:
>
>> Hi All,
>>
>> In existing uniqueWindow allows us to specify any number of
>> attributes(list)[1] for the key but in my current implementation, I'm
>> changed to support single attribute[2] so it will be a variable instead of
>> a list. but in *constructFinder* method,  we need to set list instead of
>> a variable.  Please advice on this.
>>
>
AFAIU, variableExpressionExecutors parameter passed in the constructFinder
is not relevant when determining whether to support multiple attributes or
not. Please correct me if I've missed anything.


To add to what Rajjaz has mentioned,

The existing unique window in Siddhi allows multiple attributes to be
considered when checking for uniqueness.

E.g.
Here, unique window allows both ip and hour attributes to be considered
when checking uniqueness.
from LoginEvents#window.unique(ip, hour)
select count(ip) as ipCount, ip, hour
insert into uniqueIps ;


Since unique window supports it, IMO it is good to support it in
uniqueTimeBatch as well. WDYT?


Below are the options I see to support this in uniqueTimeBatch.

*Option#1:*
*Allow multiple attributes, but start time for the window should be a
constant.*
E.g.
Here 1000 is the start time. ip and hour will be considered when checking
for uniqueness.

from LoginEvents#unique.timeBatch(1 min, 1000, ip, hour)
select count(ip) as ipCount, ip, hour
insert into uniqueIps ;

We cannot allow start time to be a variable because then we cannot
determine whether it is a startTime or whether it is meant to be used when
checking for uniqueness.
E.g.
from LoginEvents#unique.timeBatch(1 min, *time*, ip, hour)
select count(ip) as ipCount, ip, hour
insert into uniqueIps ;

Here we cannot determine whether *time* is startTime or it is meant to be
used for checking uniqueness (like ip and hour).

*Option#2:*
*Not allowing multiple attributes (i.e. only one attribute is allowed to
check uniqueness), and let start time be a constant or a variable.*
E.g.
from LoginEvents#unique.timeBatch(1 min, ip, time)
select count(ip) as ipCount, ip, hour
insert into uniqueIps ;

This is the current implementation of the UniqueBatchWindow (I changed the
order of parameters in the current impl, to keep consistency with other
examples).

IMO, allowing start time to be a variable does not add much value, because
even if we allow it to be read from an event attribute, we will only read
it from the first event.
Therefore, I would prefer option#1.

WDYT? If we are to support multiple attributes, do we have better options?

Thanks,
Dilini





>
>> [1] https://github.com/wso2/siddhi/blob/master/modules/siddhi-
>> core/src/main/java/org/wso2/siddhi/core/query/processor/
>> stream/window/UniqueWindowProcessor.java#L53
>> [2] https://github.com/wso2-extensions/siddhi-window-unique-
>> timebatch/pull/1/files#diff-4b8e395809a6b3a3bea2f689cc7ea927R99
>>
>>
>> On Thu, Jul 21, 2016 at 3:22 PM, Sriskandarajah Suhothayan <[email protected]
>> > wrote:
>>
>>> Sorry, I miss read the mail. +1
>>>
>>> Regards
>>> Suho
>>>
>>> On Thu, Jul 21, 2016 at 3:02 PM, Rajjaz Mohammed <[email protected]>
>>> wrote:
>>>
>>>> Hi Suho,
>>>>
>>>> We really don't need to have both in the same implementation. But we
>>>>> can have both in common repo called UniqueBatchWindow.
>>>>>
>>>>> Both are not in same implementations.
>>>>
>>>>>
>>>>> I have planned to develop UniqueTimeBatchWindow,
>>>>>> UniqueLengthBatchWindow Extension for Siddhi. We already have TimeWindow,
>>>>>> TimeBatchWindow and  UniqueTimeWindow. Same to length also.
>>>>>>
>>>>>>  UniqueTimeBatchWindow, UniqueLengthBatchWindow are going to be two
>>>> seperate extensions.
>>>>
>>>> Currently, I'm planning to implement UniqueBatchWindow which is support
>>>>>> for both time and length.
>>>>>>
>>>>>> Please add your suggestions if you have.
>>>>>>
>>>>>> --
>>>>>> Thank you
>>>>>> Best Regards
>>>>>>
>>>>>> *Rajjaz HM*
>>>>>> Associate Software Engineer
>>>>>> Platform Extension Team
>>>>>> WSO2 Inc. <http://wso2.com/>
>>>>>> lean | enterprise | middleware
>>>>>> Mobile | +94752833834|+94777226874
>>>>>> Email   | [email protected]
>>>>>> LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
>>>>>> <http://rajjazhm.blogspot.com/> | WSO2 Profile
>>>>>> <http://wso2.com/about/team/mohammer-rajjaz/>
>>>>>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *S. Suhothayan*
>>>>> Associate Director / Architect & Team Lead of WSO2 Complex Event
>>>>> Processor
>>>>> *WSO2 Inc. *http://wso2.com
>>>>> * <http://wso2.com/>*
>>>>> lean . enterprise . middleware
>>>>>
>>>>>
>>>>> *cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | 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>*
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you
>>>> Best Regards
>>>>
>>>> *Rajjaz HM*
>>>> Associate Software Engineer
>>>> Platform Extension Team
>>>> WSO2 Inc. <http://wso2.com/>
>>>> lean | enterprise | middleware
>>>> Mobile | +94752833834|+94777226874
>>>> Email   | [email protected]
>>>> LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
>>>> <http://rajjazhm.blogspot.com/> | WSO2 Profile
>>>> <http://wso2.com/about/team/mohammer-rajjaz/>
>>>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *S. Suhothayan*
>>> Associate Director / Architect & Team Lead of WSO2 Complex Event
>>> Processor
>>> *WSO2 Inc. *http://wso2.com
>>> * <http://wso2.com/>*
>>> lean . enterprise . middleware
>>>
>>>
>>> *cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | 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>*
>>>
>>
>>
>>
>> --
>> Thank you
>> Best Regards
>>
>> *Rajjaz HM*
>> Associate Software Engineer
>> Platform Extension Team
>> WSO2 Inc. <http://wso2.com/>
>> lean | enterprise | middleware
>> Mobile | +94752833834|+94777226874
>> Email   | [email protected]
>> LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
>> <http://rajjazhm.blogspot.com/> | WSO2 Profile
>> <http://wso2.com/about/team/mohammer-rajjaz/>
>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>
>
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> Platform Extension Team
> WSO2 Inc. <http://wso2.com/>
> lean | enterprise | middleware
> Mobile | +94752833834|+94777226874
> Email   | [email protected]
> LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
> <http://rajjazhm.blogspot.com/> | WSO2 Profile
> <http://wso2.com/about/team/mohammer-rajjaz/>
> [image: https://wso2.com/signature] <https://wso2.com/signature>
>



-- 
*Dilini Muthumala*
Senior Software Engineer,
WSO2 Inc.

*E-mail :* [email protected]
*Mobile: *+94 713-400-029
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to