|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.view.ViewSupport
com.espertech.esper.view.ext.TimeOrderView
public final class TimeOrderView
Window retaining timestamped events up to a given number of seconds such that older events that arrive later are sorted into the window and released in timestamp order.
The insert stream consists of all arriving events. The remove stream consists of events in order of timestamp value as supplied by each event.
Timestamp values on events should match engine time. The window compares engine time to timestamp value and releases events when the event's timestamp is less then engine time minus interval size (the event is older then the window tail).
The view accepts 2 parameters. The first parameter is the field name to get the event timestamp value from, the second parameter defines the interval size.
Field Summary |
---|
Fields inherited from class com.espertech.esper.view.ViewSupport |
---|
parent |
Constructor Summary | |
---|---|
TimeOrderView(StatementContext statementContext,
TimeOrderViewFactory timeOrderViewFactory,
String timestampFieldName,
long intervalSize,
IStreamTimeOrderRandomAccess optionalSortedRandomAccess,
boolean isRemoveStreamHandling)
Ctor. |
Method Summary | |
---|---|
View |
cloneView(StatementContext statementContext)
Duplicates the view. |
protected void |
expire()
This method removes (expires) objects from the window and schedules a new callback for the time when the next oldest message would expire from the window. |
EventType |
getEventType()
Provides metadata information about the type of object the event collection contains. |
long |
getIntervalSize()
Returns the time interval size. |
protected IStreamTimeOrderRandomAccess |
getOptionalSortedRandomAccess()
Returns the friend handling the random access, cal be null if not required. |
String |
getTimestampFieldName()
Returns the timestamp property name. |
boolean |
isEmpty()
True to indicate the sort window is empty, or false if not empty. |
Iterator<EventBean> |
iterator()
Allows iteration through all elements in this event collection. |
void |
setParent(Viewable parent)
Called when the View is added to a Viewable object. |
String |
toString()
|
void |
update(EventBean[] newData,
EventBean[] oldData)
Notify that data has been added or removed from the Viewable parent. |
Methods inherited from class com.espertech.esper.view.ViewSupport |
---|
addView, dumpChildViews, dumpUpdateParams, dumpUpdateParams, findDescendent, getParent, getViews, hasViews, removeView, updateChildren, updateChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.espertech.esper.view.View |
---|
getParent |
Methods inherited from interface com.espertech.esper.view.Viewable |
---|
addView, getViews, hasViews, removeView |
Constructor Detail |
---|
public TimeOrderView(StatementContext statementContext, TimeOrderViewFactory timeOrderViewFactory, String timestampFieldName, long intervalSize, IStreamTimeOrderRandomAccess optionalSortedRandomAccess, boolean isRemoveStreamHandling)
optionalSortedRandomAccess
- is the friend class handling the random access, if required by
expressionstimeOrderViewFactory
- for copying this view in a group-bystatementContext
- the statement contexttimestampFieldName
- the property name of the event supplying timestamp valuesintervalSize
- the interval time lengthisRemoveStreamHandling
- if the view must handle the remove stream of parent viewsMethod Detail |
---|
public void setParent(Viewable parent)
View
setParent
in interface View
setParent
in class ViewSupport
parent
- is the parent that this view is a child ofpublic String getTimestampFieldName()
public long getIntervalSize()
protected IStreamTimeOrderRandomAccess getOptionalSortedRandomAccess()
public View cloneView(StatementContext statementContext)
CloneableView
Expected to return a same view in initialized state for grouping.
cloneView
in interface CloneableView
statementContext
- is services for the view
public final EventType getEventType()
EventCollection
getEventType
in interface EventCollection
public final void update(EventBean[] newData, EventBean[] oldData)
View
update
in interface View
newData
- is the new data that has been added to the parent viewoldData
- is the old data that has been removed from the parent viewpublic boolean isEmpty()
public final Iterator<EventBean> iterator()
EventCollection
iterator
in interface EventCollection
iterator
in interface Iterable<EventBean>
public final String toString()
toString
in class Object
protected final void expire()
|
© 2007 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |