org.apache.ignite.streamer.window

## Class StreamerBoundedTimeWindow<E>

- java.lang.Object
- - org.apache.ignite.streamer.window.StreamerWindowAdapter<E>
  - - org.apache.ignite.streamer.window.StreamerBoundedTimeWindow<E>

All Implemented Interfaces:
  Iterable<E>, LifecycleAware, StreamerWindow<E>, StreamerWindowMBean

    public class StreamerBoundedTimeWindow<E>
    extends StreamerWindowAdapter<E>

Window which is bounded by size and time interval.

### Constructor Summary

Constructors
Constructor and Description
`StreamerBoundedTimeWindow()`

### Method Summary

Methods
`void` `checkConfiguration()` Check window configuration.
`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.
`long` `getTimeInterval()` Gets window time interval.
`boolean` `isUnique()` Gets window unique flag.
`protected GridStreamerWindowIterator<E>` `iterator0()` Returns an iterator over a set of elements of type T without check for iteration limit.
`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 void` `reset0()` Reset routine.
`void` `setMaximumSize(int maxSize)` Sets window maximum size.
`void` `setTimeInterval(long timeInterval)` Sets window time interval.
`void` `setUnique(boolean unique)` Sets window unique flag.
`int` `size()` Gets number of events currently stored in window.
`protected void` `stop0()` Dispose window.

### Methods inherited from class org.apache.ignite.streamer.window.StreamerWindowAdapter

`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StreamerBoundedTimeWindow

    public StreamerBoundedTimeWindow()

### Method Detail

#### getMaximumSize

    public int getMaximumSize()

Gets window maximum size.

Returns:
  Maximum size.

#### setMaximumSize

    public void setMaximumSize(int maxSize)

Sets window maximum size.

Parameters:
  `maxSize` - Max size.

#### getTimeInterval

    public long getTimeInterval()

Gets window time interval.

Returns:
  Time interval.

#### setTimeInterval

    public void setTimeInterval(long timeInterval)

Sets window time interval.

Parameters:
  `timeInterval` - Time interval.

#### isUnique

    public boolean isUnique()

Gets window unique flag.

Returns:
  `True` if only unique events should be added to window.

#### setUnique

    public void setUnique(boolean unique)

Sets window unique flag.

Parameters:
  `unique` - `True` if only unique events should be added to window.

#### checkConfiguration

    public void checkConfiguration()

Check window configuration.

Specified by:
  `checkConfiguration` in class `StreamerWindowAdapter<E>`

#### stop0

    protected void stop0()

Dispose window.

Specified by:
  `stop0` in class `StreamerWindowAdapter<E>`

#### reset0

    protected void reset0()

Reset routine.

Specified by:
  `reset0` in class `StreamerWindowAdapter<E>`

#### size

    public int size()

Gets number of events currently stored in window.

Returns:
  Current size of the window.

#### evictionQueueSize

    public int evictionQueueSize()

Gets number of entries available for eviction.

Returns:
  Number of entries available for eviction.

#### enqueue0

    protected boolean enqueue0(E evt)

Adds event to window.

Specified by:
  `enqueue0` in class `StreamerWindowAdapter<E>`
Parameters:
  `evt` - Event.
Returns:
  `True` if event added.

#### pollEvicted0

    protected Collection<E> pollEvicted0(int cnt)

If window supports eviction, this method will return up to cnt evicted elements.

Specified by:
  `pollEvicted0` in class `StreamerWindowAdapter<E>`
Parameters:
  `cnt` - Count.
Returns:
  Evicted elements.

#### pollEvictedBatch0

    protected Collection<E> pollEvictedBatch0()

If window supports batch eviction, this method will poll next evicted batch from window. If windows does not support batch eviction but supports eviction, will return collection of single last evicted element. If window does not support eviction, will return empty collection.

Specified by:
  `pollEvictedBatch0` in class `StreamerWindowAdapter<E>`
Returns:
  Elements from evicted batch.

#### dequeue0

    protected Collection<E> dequeue0(int cnt)

Dequeues up to cnt elements from window. If current window size is less than cnt, will dequeue all elements from window.

Specified by:
  `dequeue0` in class `StreamerWindowAdapter<E>`
Parameters:
  `cnt` - Count.
Returns:
  Dequeued elements.

#### iterator0

    protected GridStreamerWindowIterator<E> iterator0()

Returns an iterator over a set of elements of type T without check for iteration limit. That is, in case concurrent thread constantly adding new elements to the window we could iterate forever.

Specified by:
  `iterator0` in class `StreamerWindowAdapter<E>`
Returns:
  Iterator.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015