public interface StreamerWindow<E> extends Iterable<E>
Ignite comes with following rolling windows implementations out of the box:
StreamerUnboundedWindow
StreamerBoundedSizeWindow
StreamerBoundedSizeBatchWindow
StreamerBoundedSizeSortedWindow
StreamerBoundedTimeWindow
StreamerBoundedTimeBatchWindow
Streamer window is configured via StreamerConfiguration.getWindows()
method.
Modifier and Type | Method and Description |
---|---|
void |
clearEvicted()
Clears all evicted entries.
|
E |
dequeue()
Dequeues last element from windows.
|
Collection<E> |
dequeue(int cnt)
Dequeues up to
cnt elements from window. |
Collection<E> |
dequeueAll()
Dequeues all elements from window.
|
boolean |
enqueue(E... evts)
Adds events to window.
|
boolean |
enqueue(E evt)
Adds single event to window.
|
boolean |
enqueueAll(Collection<E> evts)
Adds all events to window.
|
int |
evictionQueueSize()
Gets number of entries available for eviction.
|
<K,V> StreamerIndex<E,K,V> |
index()
Gets default index, if default index is not configured then
IllegalArgumentException will be thrown. |
<K,V> StreamerIndex<E,K,V> |
index(String name)
Gets index by name, if not index with such name was configured then
IllegalArgumentException will be thrown. |
Collection<StreamerIndex<E,?,?>> |
indexes()
Gets all indexes configured for this window.
|
String |
name()
Gets window name.
|
E |
pollEvicted()
If window supports eviction, this method will return next evicted element.
|
Collection<E> |
pollEvicted(int cnt)
If window supports eviction, this method will return up to
cnt evicted elements. |
Collection<E> |
pollEvictedAll()
If window supports eviction, this method will return all available evicted elements.
|
Collection<E> |
pollEvictedBatch()
If window supports batch eviction, this method will poll next evicted batch from window.
|
void |
reset()
Resets window.
|
int |
size()
Gets number of events currently stored in window.
|
Collection<E> |
snapshot(boolean includeIvicted)
Create window snapshot.
|
String name()
<K,V> StreamerIndex<E,K,V> index()
IllegalArgumentException
will be thrown.K
- Type of the index key.V
- Type of the index value.<K,V> StreamerIndex<E,K,V> index(@Nullable String name)
IllegalArgumentException
will be thrown.K
- Type of the index key.V
- Type of the index value.name
- Name of the index, if null
then analogous to index()
.Collection<StreamerIndex<E,?,?>> indexes()
void reset()
int size()
int evictionQueueSize()
boolean enqueue(E evt) throws IgniteException
evt
- Event to add.True
if event was added.IgniteException
- If index update failed.boolean enqueue(E... evts) throws IgniteException
evts
- Events to add.
IgniteException
- If index update failed.boolean enqueueAll(Collection<E> evts) throws IgniteException
evts
- Collection of events to add.True
if all events were added, false
if at
least 1 event was skipped.IgniteException
- If index update failed.@Nullable E dequeue() throws IgniteException
null
if window is empty.IgniteException
- If index update failed.Collection<E> dequeue(int cnt) throws IgniteException
cnt
elements from window. If current window size is less than cnt
,
will dequeue all elements from window.cnt
- Count to dequeue.IgniteException
- If index update failed.Collection<E> dequeueAll() throws IgniteException
IgniteException
- If index update failed.@Nullable E pollEvicted() throws IgniteException
null
if eviction queue is empty or if
window does not support eviction.IgniteException
- If index update failed.Collection<E> pollEvicted(int cnt) throws IgniteException
cnt
evicted elements.cnt
- Number of elements to evict.IgniteException
- If index update failed.Collection<E> pollEvictedBatch() throws IgniteException
IgniteException
- If index update failed.Collection<E> pollEvictedAll() throws IgniteException
IgniteException
- If index update failed.void clearEvicted() throws IgniteException
IgniteException
- If index update failed.Collection<E> snapshot(boolean includeIvicted)
includeIvicted
- Whether to include evicted entries or not.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015