org.apache.ignite.streamer

## Interface StreamerStage<IN>

All Known Implementing Classes:
  StreamerStageWrapper

    public interface StreamerStage<IN>

Streamer stage is a component that determines event processing flow. User logic related to any particular event processing is implemented by streamer stage. A stage takes events as an input and returns groups of events mapped to different stages as an output. Events for every returned stage will be passed to `StreamerEventRouter` which will determine on which node the stage should be executed.

Generally, event stage execution graph if fully controlled by return values of this method, while node execution graph is controlled by `StreamerEventRouter.route(StreamerContext, String, Object)` method.

### Method Summary

Methods
`String` `name()` Gets streamer stage name.
`Map<String,Collection<?>>` `run(StreamerContext ctx, Collection<IN> evts)` Stage execution routine.

### Method Detail

#### name

    String name()

Gets streamer stage name.

Returns:
  Name of the stage.

#### run

    @Nullable
    Map<String,Collection<?>> run(StreamerContext ctx,
                                         Collection<IN> evts)
                                  throws IgniteException

Stage execution routine. After the passed in events are processed, stage can emit another set of events to be processed. The returned events can be mapped to different stages. Events for every returned stage will be passed to `StreamerEventRouter` which will determine on which node the stage should be executed.

Generally, event stage execution graph if fully controlled by return values of this method, while node execution graph is controlled by `StreamerEventRouter.route(StreamerContext, String, Object)` method.

Parameters:
  `ctx` - Streamer context.
  `evts` - Input events.
Returns:
  Map of stage name to collection of events.
Throws:
  `IgniteException` - If failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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