Class PriorEventBufferUnbound
java.lang.Object
com.espertech.esper.common.internal.view.prior.PriorEventBufferUnbound
- All Implemented Interfaces:
ViewUpdatedCollection
,RandomAccessByIndex
public class PriorEventBufferUnbound
extends Object
implements ViewUpdatedCollection, RandomAccessByIndex
Buffer class for insert stream events only for use with unbound streams that inserts data only, to serve
up one or more prior events in the insert stream based on an index.
Does not expect or care about the remove stream and simple keeps a rolling buffer of new data events up to the maximum prior event we are asking for.
-
Field Summary
Fields inherited from interface com.espertech.esper.common.internal.view.access.RandomAccessByIndex
EPTYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
De-allocate resources held by the collection.getNewData
(int index) Returns an new data event given an index.getNewDataTail
(int index) int
getOldData
(int index) Returns an old data event given an index.int
void
Accepts view insert and remove stream.
-
Constructor Details
-
PriorEventBufferUnbound
public PriorEventBufferUnbound(int maxPriorIndex) Ctor.- Parameters:
maxPriorIndex
- is the highest prior-event index required by any expression
-
-
Method Details
-
update
Description copied from interface:ViewUpdatedCollection
Accepts view insert and remove stream.- Specified by:
update
in interfaceViewUpdatedCollection
- Parameters:
newData
- is the insert stream events or null if no dataoldData
- is the remove stream events or null if no data
-
getNewData
Description copied from interface:RandomAccessByIndex
Returns an new data event given an index.- Specified by:
getNewData
in interfaceRandomAccessByIndex
- Parameters:
index
- to return new data for- Returns:
- new data event
-
getOldData
Description copied from interface:RandomAccessByIndex
Returns an old data event given an index.- Specified by:
getOldData
in interfaceRandomAccessByIndex
- Parameters:
index
- to return old data for- Returns:
- old data event
-
destroy
public void destroy()Description copied from interface:ViewUpdatedCollection
De-allocate resources held by the collection.- Specified by:
destroy
in interfaceViewUpdatedCollection
-
getNewDataTail
- Specified by:
getNewDataTail
in interfaceRandomAccessByIndex
-
getWindowIterator
- Specified by:
getWindowIterator
in interfaceRandomAccessByIndex
-
getWindowCollectionReadOnly
- Specified by:
getWindowCollectionReadOnly
in interfaceRandomAccessByIndex
-
getWindowCount
public int getWindowCount()- Specified by:
getWindowCount
in interfaceRandomAccessByIndex
-
getNewEvents
-
getNumEventsInsertBuf
public int getNumEventsInsertBuf()- Specified by:
getNumEventsInsertBuf
in interfaceViewUpdatedCollection
-