org.apache.ignite.streamer

## Interface StreamerEventRouter

All Known Implementing Classes:
  StreamerAffinityEventRouter, StreamerCacheAffinityEventRouter, StreamerEventRouterAdapter, StreamerLocalEventRouter, StreamerRandomEventRouter, StreamerRoundRobinEventRouter

    public interface StreamerEventRouter

Streamer event router. Pluggable component that determines event execution flow across the grid. Each time a group of events is submitted to streamer or returned to streamer by a stage, event router will be used to select execution node for next stage.

### Method Summary

Methods
`<T> Map<ClusterNode,Collection<T>>` `route(StreamerContext ctx, String stageName, Collection<T> evts)` Selects a node for given events that should be processed by a stage with given name.
`<T> ClusterNode` `route(StreamerContext ctx, String stageName, T evt)` Selects a node for given event that should be processed by a stage with given name.

### Method Detail

#### route

    @Nullable
    <T> ClusterNode route(StreamerContext ctx,
                                 String stageName,
                                 T evt)

Selects a node for given event that should be processed by a stage with given name.

Parameters:
  `ctx` - Streamer context.
  `stageName` - Stage name.
  `evt` - Event to route.
Returns:
  Node to route to. If this method returns `null` then the whole pipeline execution will be terminated. All running and ongoing stages for pipeline execution will be cancelled.

#### route

    @Nullable
    <T> Map<ClusterNode,Collection<T>> route(StreamerContext ctx,
                                                    String stageName,
                                                    Collection<T> evts)

Selects a node for given events that should be processed by a stage with given name.

Parameters:
  `ctx` - Streamer context.
  `stageName` - Stage name to route events.
  `evts` - Events.
Returns:
  Events to node mapping. If this method returns `null` then the whole pipeline execution will be terminated. All running and ongoing stages for pipeline execution will be cancelled.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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