incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Morel <matth...@yahoo-inc.com>
Subject Re: Sliding window
Date Tue, 19 Mar 2013 09:21:28 GMT
Hi,

in the constructor for that class, you can specify the unit of time (seconds, minutes etc)
and the duration of a slot expressed in that unit of time. If you specify 60 seconds, you'll
have a new slot every 60 seconds, regardless of the number of slots in the window. When a
new slot is created, the oldest slot (when number of slots > 6 in your case) is discarded
(we use a circular buffer).

Regards,

Matthieu

On Mar 19, 2013, at 08:52 , medikare mds wrote:

Considering the time-based AbstractSlidingWindowPE constructor, suppose I specify the time
unit as 60 seconds and number of slots as 6. Then, will one slot be used for every ten seconds?

On Sat, Feb 23, 2013 at 12:31 AM, Matthieu Morel <mmorel@apache.org<mailto:mmorel@apache.org>>
wrote:
Good questions - and thanks for pointing out the incomplete javadoc for the V parameter!

Have you tried customizing the "close()" method in your Slot implementation? This is called
when a new slot replaces the old one. That would be a convenient place to dump the slot data
to a file.

updateOpenSlot() is just to put data in the current slot.

Note that most things can be overriden, including the AbstractSlidingWindowPE class itself,
in order to better suit your specific needs.

Hope this helps,

Matthieu

On Feb 22, 2013, at 18:54 , medikare mds wrote:

> I'm trying to implement a time-based sliding window in my PE. I want a set of records
to be maintained in each slot. Whenever the time period elapses and a new slot is used, I
want the details of the old slot to get recorded in a file. Initially I faced problems in
determining what value the generic parameter V can take in the AbstractSlidingWindowPE. Then
I found out that it was a Collection object. But now I'm stuck on finding out how I can use
the updateOpenSlot() and getOpenSlot() functions properly. Can someone help me out?




Mime
View raw message