org.apache.ignite.streamer.window

## Class StreamerBoundedTimeBatchWindow<E>

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

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

    public class StreamerBoundedTimeBatchWindow<E>
    extends StreamerWindowAdapter<E>

Window that accumulates events in batches, and is bounded by time and maximum number of batches.

### Constructor Summary

Constructors
Constructor and Description
`StreamerBoundedTimeBatchWindow()`

### 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` `getBatchSize()` Gets batch size.
`long` `getBatchTimeInterval()` Gets batch time interval.
`int` `getMaximumBatches()` Gets maximum number of batches can be stored in window.
`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` `setBatchSize(int batchSize)` Sets batch size.
`void` `setBatchTimeInterval(long batchTimeInterval)` Sets batch time interval.
`void` `setMaximumBatches(int maxBatches)` Sets maximum number of batches can be stored in window.
`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

#### StreamerBoundedTimeBatchWindow

    public StreamerBoundedTimeBatchWindow()

### Method Detail

#### getMaximumBatches

    public int getMaximumBatches()

Gets maximum number of batches can be stored in window.

Returns:
  Maximum number of batches for window.

#### setMaximumBatches

    public void setMaximumBatches(int maxBatches)

Sets maximum number of batches can be stored in window.

Parameters:
  `maxBatches` - Maximum number of batches for window.

#### getBatchSize

    public int getBatchSize()

Gets batch size.

Returns:
  Batch size.

#### setBatchSize

    public void setBatchSize(int batchSize)

Sets batch size.

Parameters:
  `batchSize` - Batch size.

#### getBatchTimeInterval

    public long getBatchTimeInterval()

Gets batch time interval.

Returns:
  Batch time interval.

#### setBatchTimeInterval

    public void setBatchTimeInterval(long batchTimeInterval)

Sets batch time interval.

Parameters:
  `batchTimeInterval` - Batch time interval.

#### 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.

#### 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.

#### 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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015