I also think it's better to have an optional parameter for the two cases rather 
than having two different windows.

Since our convention was to consider 'first unique' as the special case we can 
have a Boolean optional parameter such as 'isFirstUnique' to alter the window 
behavior and let the default behavior to be 'last unique'


> On Aug 25, 2016, at 7:47 PM, Dilini Muthumala <[email protected]> wrote:
> 
> Good point, Lasantha. Thanks for bringing it up. 
> 
> In my point of view, going forward, it's better to have a parameter to a 
> Unique Window to specify whether to drop first event or the last event, 
> rather than having two windows as Unique Window and First Unique Window.
> I think so, because otherwise we might end up having many unique windows 
> because for each unique window (length, time, length batch, time batch...), 
> we might have to write a first unique window as well.
> 
> We can leave this parameter as an optional one, so in case it does not matter 
> whether to use 'first' or 'last', user can omit the parameter.
> 
> If we assume that the common case would expect the last event to be kept in 
> window, then we can set the default value of the parameter to 'last'.
> 
> WDYT?
> 
> Thanks,
> Dilini
> 
>> On Thu, Aug 25, 2016 at 5:05 PM, Lasantha Fernando <[email protected]> 
>> wrote:
>> Hi all,
>> 
>> If we go by the basic unique window implementation we have, we have 
>> introduced two implementations (unique and firstUnique) [1.2]. If we go by 
>> that convention, we would have to create a separate window for the first 
>> unique implementations.
>> 
>> I think the rational behind having a unique window and a firstUnique window 
>> was the assumption that the common case would expect the last event to be 
>> kept in window (in case of duplicates). firstUnique was considered a special 
>> case and kept separately so that users won't have to think about whether to 
>> use 'first' or 'last' in a scenario where it does not matter.
>> 
>> Just wanted to raise this point so that this aspect and the overall 
>> consistency with the basic unique window implementation were also under 
>> discussion.. :-)
>> 
>> [1] 
>> https://docs.wso2.com/display/CEP420/Inbuilt+Windows#InbuiltWindows-uniqueunique
>> [2] 
>> https://docs.wso2.com/display/CEP420/Inbuilt+Windows#InbuiltWindows-firstUniquefirstUnique
>> 
>> Thanks,
>> Lasantha
>> 
>>> On Thu, Aug 25, 2016 at 12:37 PM, Rajjaz Mohammed <[email protected]> wrote:
>>> Hi Malith,
>>> 
>>> +1, Will add in the implementation.
>>> 
>>>> On Thu, Aug 25, 2016 at 12:31 PM, Dilini Muthumala <[email protected]> wrote:
>>>> 
>>>>> On Thu, Aug 25, 2016 at 12:18 PM, Malith Jayasinghe <[email protected]> 
>>>>> wrote:
>>>>> Hi Dilini,
>>>>> 
>>>>> Can we provide an option here to specify which event to be dropped (i.e. 
>>>>> earlier event or the later one)?
>>>> 
>>>> Hi Malith,
>>>> 
>>>> +1 to provide that option.
>>>> 
>>>> Platform Extensions team,
>>>> If we add that option, then I think, we'll have to add that support to all 
>>>> of the Unique windows which we have done (UniqueTimeWindow, 
>>>> UniqueLengthWindow, UniqueTimeBatchWindow and UniqueLengthBatchWindow) to 
>>>> keep consistency.
>>>> 
>>>> Thanks,
>>>> Dilini
>>>>  
>>>>> 
>>>>>> On Thu, Aug 25, 2016 at 11:40 AM, Dilini Muthumala <[email protected]> 
>>>>>> wrote:
>>>>>> Adding architecture list
>>>>>> 
>>>>>>> On Thu, Aug 25, 2016 at 11:37 AM, Dilini Muthumala <[email protected]> 
>>>>>>> wrote:
>>>>>>> Hi all,
>>>>>>> 
>>>>>>> As Rajjaz is working on implementing UniqueTimeBatchWindow and 
>>>>>>> UniqueLengthBatchWindow, we were discussing below design for the window:
>>>>>>> 
>>>>>>> As we know, UniqueTimeBatchWindow can be used to create a batch of 
>>>>>>> events, in such a way that the batch does not contain "duplicate 
>>>>>>> events".
>>>>>>> (Here, I say two events are duplicate when those events have equal 
>>>>>>> values for a certain attribute. It does not mean that both the events 
>>>>>>> are exactly the same)
>>>>>>> 
>>>>>>> This means, when we emit current events or expired events from the 
>>>>>>> window, those events cannot have duplicate events. 
>>>>>>> 
>>>>>>> As such, when the window is collecting events to create a batch,
>>>>>>> upon seeing a duplicate event, to keep the uniqueness in the batch, one 
>>>>>>> of the duplicates need to be dropped (UniqueTimeBatchWindow keeps the 
>>>>>>> latest event in the batch, dropping the event which came earlier).
>>>>>>> 
>>>>>>> Any concerns on dropping events in the window?
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> Dilini
>>>>>>> 
>>>>>>> -- 
>>>>>>> Dilini Muthumala
>>>>>>> Senior Software Engineer, 
>>>>>>> WSO2 Inc.
>>>>>>> 
>>>>>>> E-mail : [email protected]
>>>>>>> Mobile: +94 713-400-029 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> 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
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> Malith Jayasinghe 
>>>>> 
>>>>> 
>>>>> WSO2, Inc. (http://wso2.com)
>>>>> Email   : [email protected]
>>>>> Mobile : 0770704040 
>>>>> Lean . Enterprise . Middleware
>>>>> 
>>>>> _______________________________________________
>>>>> Architecture mailing list
>>>>> [email protected]
>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> 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
>>> 
>>> 
>>> 
>>> -- 
>>> Thank you
>>> Best Regards
>>> 
>>> Rajjaz HM
>>> Associate Software Engineer
>>> Platform Extension Team 
>>> WSO2 Inc.
>>> lean | enterprise | middleware
>>> Mobile | +94752833834|+94777226874
>>> Email   | [email protected]
>>> LinkedIn | Blogger | WSO2 Profile
>>> 
>>> 
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>> 
>> 
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
> 
> 
> 
> -- 
> 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
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to