public class StreamerBoundedSizeSortedWindow<E> extends StreamerWindowAdapter<E>
StreamerBoundedSizeWindow, which limits
window only on size, this window also provides events in sorted order.| Modifier and Type | Field and Description |
|---|---|
protected int |
maxSize
Window maximum size.
|
| Constructor and Description |
|---|
StreamerBoundedSizeSortedWindow() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
addAllInternal(Collection<E> evts,
Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col,
Set<E> set)
Adds all events to queue implementation.
|
protected boolean |
addInternal(E evt,
Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<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<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<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.
|
Comparator<E> |
getComparator()
Gets event comparator.
|
int |
getMaximumSize()
Gets window maximum size.
|
boolean |
isUnique() |
protected GridStreamerWindowIterator<E> |
iterator0()
Returns an iterator over a set of elements of type T without check for iteration limit.
|
protected GridStreamerWindowIterator<E> |
iteratorInternal(Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col,
Set<E> set,
AtomicInteger size)
Creates iterator based on implementation collection type.
|
protected Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<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<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col,
Set<E> set) |
protected void |
reset0()
Reset routine.
|
void |
setComparator(Comparator<E> comp)
Sets event comparator.
|
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, updateIndexespublic Comparator<E> getComparator()
public void setComparator(Comparator<E> comp)
comp - Comparator.protected Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> newCollection()
protected boolean addInternal(E evt, Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col, @Nullable 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<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col, @Nullable Set<E> set)
evts - Events to add.col - Collection to add to.set - Set to check.protected E pollInternal(Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col, Set<E> set)
col - Collection to add to.set - Set to check.protected GridStreamerWindowIterator<E> iteratorInternal(Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<E>> col, Set<E> set, AtomicInteger size)
col - Collection.set - Set to check.size - Size.protected void consistencyCheck(Collection<org.apache.ignite.streamer.window.StreamerBoundedSizeSortedWindow.Holder<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 GridStreamerWindowIterator<E> iterator0()
iterator0 in class StreamerWindowAdapter<E>protected void reset0()
reset0 in class StreamerWindowAdapter<E>protected Collection<T> collection()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015