org.apache.ignite.streamer

## Class StreamerConfiguration

- java.lang.Object
- - org.apache.ignite.streamer.StreamerConfiguration

    public class StreamerConfiguration
    extends Object

Streamer configuration.

### Field Summary

Fields
`static int` `DFLT_MAX_CONCURRENT_SESSIONS` By default maximum number of concurrent sessions is unlimited.
`static int` `DFLT_MAX_FAILOVER_ATTEMPTS` Default value for maximum failover attempts.

### Constructor Summary

Constructors
Constructor and Description
`StreamerConfiguration()`
`StreamerConfiguration(StreamerConfiguration c)`

### Method Summary

Methods
`int` `getMaximumConcurrentSessions()` Gets maximum number of concurrent events to be processed by streamer.
`int` `getMaximumFailoverAttempts()` Gets maximum number of failover attempts to try when pipeline execution has failed.
`String` `getName()` Gets streamer name.
`StreamerEventRouter` `getRouter()` Gets streamer event router.
`Collection<StreamerStage>` `getStages()` Gets collection of streamer stages.
`int` `getThreadPoolSize()` Gets streamer pool size.
`Collection<StreamerWindow>` `getWindows()` Gets collection of streamer event windows.
`boolean` `isAtLeastOnce()` Gets flag indicating whether streamer should track event execution sessions and failover event execution if any failure detected or any node on which execution happened has left the grid before successful response is received.
`void` `setAtLeastOnce(boolean atLeastOnce)`
`void` `setMaximumConcurrentSessions(int maxConcurrentSessions)` Sets maximum number of concurrent sessions.
`void` `setMaximumFailoverAttempts(int maxFailoverAttempts)` Sets maximum number of failover attempts.
`void` `setName(String name)` Sets the name of the streamer.
`void` `setRouter(StreamerEventRouter router)` Sets router for streamer.
`void` `setStages(Collection<StreamerStage> stages)` Sets stages.
`void` `setThreadPoolSize(int poolSize)` Sets streamer pool size.
`void` `setWindows(Collection<StreamerWindow> win)` Sets collection of streamer windows.
`String` `toString()`

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

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

### Field Detail

#### DFLT_MAX_CONCURRENT_SESSIONS

    public static final int DFLT_MAX_CONCURRENT_SESSIONS

By default maximum number of concurrent sessions is unlimited.

See Also:
  Constant Field Values

#### DFLT_MAX_FAILOVER_ATTEMPTS

    public static final int DFLT_MAX_FAILOVER_ATTEMPTS

Default value for maximum failover attempts.

See Also:
  Constant Field Values

### Constructor Detail

#### StreamerConfiguration

    public StreamerConfiguration()

#### StreamerConfiguration

    public StreamerConfiguration(StreamerConfiguration c)

Parameters:
  `c` - Configuration to copy.

### Method Detail

#### getName

    @Nullable
    public String getName()

Gets streamer name. Must be unique within grid.

Returns:
  Streamer name, if `null` then default streamer is returned.

#### setName

    public void setName(String name)

Sets the name of the streamer.

Parameters:
  `name` - Name.

#### getRouter

    @Nullable
    public StreamerEventRouter getRouter()

Gets streamer event router.

Returns:
  Event router, if `null` then events will be executed locally.

#### setRouter

    public void setRouter(StreamerEventRouter router)

Sets router for streamer.

Parameters:
  `router` - Router.

#### getWindows

    public Collection<StreamerWindow> getWindows()

Gets collection of streamer event windows. At least one window should be configured. Each window must have unique name.

Returns:
  Streamer windows.

#### setWindows

    public void setWindows(Collection<StreamerWindow> win)

Sets collection of streamer windows.

Parameters:
  `win` - Window.

#### getStages

    public Collection<StreamerStage> getStages()

Gets collection of streamer stages. Streamer must have at least one stage to execute. Each stage must have unique name.

Returns:
  Collection of streamer stages.

#### setStages

    public void setStages(Collection<StreamerStage> stages)

Sets stages.

Parameters:
  `stages` - Stages.

#### isAtLeastOnce

    public boolean isAtLeastOnce()

Gets flag indicating whether streamer should track event execution sessions and failover event execution if any failure detected or any node on which execution happened has left the grid before successful response is received.

Setting this flag to `true` will guarantee that all pipeline stages will be executed at least once for each group of event submitted to streamer (or failure listener will be notified if failover cannot succeed). However, it does not guarantee that each stage will be executed at most once.

Returns:
  `True` if event should be processed at least once, or `false` if failures can be safely ignored.

#### setAtLeastOnce

    public void setAtLeastOnce(boolean atLeastOnce)

Parameters:
  `atLeastOnce` - `True` to guarantee that event will be processed at least once.

#### getMaximumFailoverAttempts

    public int getMaximumFailoverAttempts()

Gets maximum number of failover attempts to try when pipeline execution has failed. This parameter is ignored if `isAtLeastOnce()` is set to `false`.

If not set, default value is

Returns:
  Maximum number of failover attempts to try.

#### setMaximumFailoverAttempts

    public void setMaximumFailoverAttempts(int maxFailoverAttempts)

Sets maximum number of failover attempts.

Parameters:
  `maxFailoverAttempts` - Maximum number of failover attempts.
See Also:
  `getMaximumFailoverAttempts()`

#### getMaximumConcurrentSessions

    public int getMaximumConcurrentSessions()

Gets maximum number of concurrent events to be processed by streamer. This property is taken into account when `isAtLeastOnce()` is set to `true`. If not positive, number of sessions will not be limited by any value.

Returns:
  Maximum number of concurrent events to be processed. If number of concurrent events is greater then this value, caller will be blocked until enough responses are received.

#### setMaximumConcurrentSessions

    public void setMaximumConcurrentSessions(int maxConcurrentSessions)

Sets maximum number of concurrent sessions.

Parameters:
  `maxConcurrentSessions` - Maximum number of concurrent sessions.
See Also:
  `getMaximumConcurrentSessions()`

#### getThreadPoolSize

    public int getThreadPoolSize()

Gets streamer pool size. Defines a thread pool size in which streamer stages will be executed.

If not specified, thread pool executor with max pool size equal to number of cores will be created.

Returns:
  Streamer thread pool size.

#### setThreadPoolSize

    public void setThreadPoolSize(int poolSize)

Sets streamer pool size.

Parameters:
  `poolSize` - Pool size.
See Also:
  `getThreadPoolSize()`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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