public class StreamerBoundedSizeWindow<E> extends StreamerWindowAdapter<E>
It is guaranteed that window size will never get less then maximum size when poling from this window concurrently from different threads.
Modifier and Type | Field and Description |
---|---|
protected int |
maxSize
Window maximum size.
|
Constructor and Description |
---|
StreamerBoundedSizeWindow() |
Modifier and Type | Method and Description |
---|---|
protected int |
addAllInternal(Collection<E> evts,
Collection<E> col,
Set<E> set)
Adds all events to queue implementation.
|
protected boolean |
addInternal(E evt,
Collection<E> col,
Set<E> set)
Adds event to queue implementation.
|
void |
checkConfiguration()
Check window configuration.
|
protected Collection<T> |
collection()
Get underlying collection.
|
protected void |
consistencyCheck(Collection<E> col,
Set<E> set,
AtomicInteger size)
Checks consistency.
|
protected Collection<E> |
dequeue0(int cnt)
Dequeues up to cnt elements from window.
|
protected boolean |
enqueue0(E evt)
Adds event to window.
|
int |
evictionQueueSize()
Gets number of entries available for eviction.
|
int |
getMaximumSize()
Gets window maximum size.
|
boolean |
isUnique() |
protected org.apache.ignite.internal.processors.streamer.GridStreamerWindowIterator<E> |
iterator0()
Returns an iterator over a set of elements of type T without check for iteration limit.
|
org.apache.ignite.internal.processors.streamer.GridStreamerWindowIterator<E> |
iteratorInternal(Collection<E> col,
Set<E> set,
AtomicInteger size)
Creates iterator based on implementation collection type.
|
protected Collection<E> |
newCollection()
Creates new collection specific for window implementation.
|
protected Collection<E> |
pollEvicted0(int cnt)
If window supports eviction, this method will return up to cnt evicted elements.
|
protected Collection<E> |
pollEvictedBatch0()
If window supports batch eviction, this method will poll next evicted batch from window.
|
protected E |
pollInternal(Collection<E> col,
Set<E> set) |
protected void |
reset0()
Reset routine.
|
void |
setMaximumSize(int maxSize)
Sets window maximum size.
|
void |
setUnique(boolean unique) |
int |
size()
Gets number of events currently stored in window.
|
protected void |
stop0()
Dispose window.
|
clearEvicted, dequeue, dequeue, dequeueAll, enqueue, enqueue, enqueueAll, getClassName, getEvictionQueueSize, getFilter, getName, getSize, index, index, indexes, indexProviders, iterator, name, pollEvicted, pollEvicted, pollEvictedAll, pollEvictedBatch, reset, setFilter, setIndexes, setName, snapshot, start, stop, updateIndexes
protected Collection<E> newCollection()
public org.apache.ignite.internal.processors.streamer.GridStreamerWindowIterator<E> iteratorInternal(Collection<E> col, Set<E> set, AtomicInteger size)
col
- Collection.set
- Set to check.size
- Size.protected boolean addInternal(E evt, Collection<E> col, Set<E> set)
evt
- Event to add.col
- Collection to add to.set
- Set to check.True
if event was added.protected int addAllInternal(Collection<E> evts, Collection<E> col, Set<E> set)
evts
- Events to add.col
- Collection to add to.set
- Set to check.@Nullable protected E pollInternal(Collection<E> col, Set<E> set)
col
- Collection to add to.set
- Set to check.protected void consistencyCheck(Collection<E> col, Set<E> set, AtomicInteger size)
col
- Collection.set
- Set if unique.size
- Size holder.public int getMaximumSize()
public void setMaximumSize(int maxSize)
maxSize
- Maximum size.public boolean isUnique()
public void setUnique(boolean unique)
unique
- If true, only unique elements will be accepted.public void checkConfiguration()
checkConfiguration
in class StreamerWindowAdapter<E>
protected void stop0()
stop0
in class StreamerWindowAdapter<E>
public int size()
public int evictionQueueSize()
protected boolean enqueue0(E evt)
enqueue0
in class StreamerWindowAdapter<E>
evt
- Event.True
if event added.protected Collection<E> pollEvicted0(int cnt)
pollEvicted0
in class StreamerWindowAdapter<E>
cnt
- Count.protected Collection<E> pollEvictedBatch0()
pollEvictedBatch0
in class StreamerWindowAdapter<E>
protected Collection<E> dequeue0(int cnt)
dequeue0
in class StreamerWindowAdapter<E>
cnt
- Count.protected org.apache.ignite.internal.processors.streamer.GridStreamerWindowIterator<E> iterator0()
iterator0
in class StreamerWindowAdapter<E>
protected void reset0()
reset0
in class StreamerWindowAdapter<E>
protected Collection<T> collection()
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 16 2015