public class WindowManager<T> extends java.lang.Object implements IManager<T>
Modifier and Type | Field and Description |
---|---|
static int |
EXPIRE_EVENTS_THRESHOLD |
Constructor and Description |
---|
WindowManager() |
WindowManager(WindowLifeCycleListener<T> windowLifeCycleListener) |
Modifier and Type | Method and Description |
---|---|
void |
add(Event<T> windowEvent) |
void |
add(IMessage<T> message) |
void |
add(IMessage<T> message,
long ts) |
IWindowMessage<T> |
bundleExpiredWindowIMessage(java.util.List<IMessage<T>> events)
This method bundles data into a IWindowMessage for creating expired IWindowMessages
|
IWindowMessage<T> |
bundleNonExpiredWindowIMessage(java.util.List<IMessage<T>> events)
This method bundles data into a IWindowMessage for creating non-expired IWindowMessages
|
IWindowMessage<T> |
bundleWindowMessage(java.util.List<Event<T>> events) |
void |
compactWindow() |
long |
getEarliestEventTimestamp(long start,
long end)
provides the event with earliest timestamp between end and start timestamps
by scanning through the queue of messages.
|
long |
getEventCount(long referenceTime)
This method returns the number of event count which has the timestamp lesser than the
reference timestamp
|
IEvictionPolicy<T> |
getEvictionPolicy() |
java.util.List<java.lang.Long> |
getSlidingCountTimestamps(long start,
long end,
long slide)
This method is scanning the list of events falling under a given
starting and end time stamp
|
IWindowingPolicy<T> |
getWindowingPolicy() |
boolean |
onEvent() |
java.util.List<Event<T>> |
scanEvents(boolean fullScan) |
void |
setEvictionPolicy(IEvictionPolicy<T> evictionPolicy) |
void |
setWindowingPolicy(IWindowingPolicy<T> windowingPolicy) |
void |
shutdown() |
void |
track(Event<T> windowEvent) |
public static final int EXPIRE_EVENTS_THRESHOLD
public WindowManager(WindowLifeCycleListener<T> windowLifeCycleListener)
public WindowManager()
public IWindowingPolicy<T> getWindowingPolicy()
public void setWindowingPolicy(IWindowingPolicy<T> windowingPolicy)
public IEvictionPolicy<T> getEvictionPolicy()
public void setEvictionPolicy(IEvictionPolicy<T> evictionPolicy)
public IWindowMessage<T> bundleWindowMessage(java.util.List<Event<T>> events)
public IWindowMessage<T> bundleNonExpiredWindowIMessage(java.util.List<IMessage<T>> events)
events
- list of elements that need to be passed into a windowpublic IWindowMessage<T> bundleExpiredWindowIMessage(java.util.List<IMessage<T>> events)
events
- list of elements that need to be passed into a windowpublic void compactWindow()
public void shutdown()
public java.util.List<java.lang.Long> getSlidingCountTimestamps(long start, long end, long slide)
start
- the starting timestampend
- the end time stampslide
- the sliding interval countpublic long getEventCount(long referenceTime)
referenceTime
- timestamp to which we compare the event time to filter them outpublic long getEarliestEventTimestamp(long start, long end)
start
- starting timestamp (excluded for calculation)end
- ending timestamp (included for calculation)