org.apache.ignite.internal.processors.streamer

## Class StreamerStageWrapper

- java.lang.Object
- - org.apache.ignite.internal.processors.streamer.StreamerStageWrapper

All Implemented Interfaces:
  StreamerStage<Object>

    public class StreamerStageWrapper
    extends Object
    implements StreamerStage<Object>

Stage wrapper that handles metrics calculation and time measurement.

### Constructor Summary

Constructors
Constructor and Description
`StreamerStageWrapper(StreamerStage<Object> delegate, int idx)`

### Method Summary

Methods
`int` `index()`
`String` `name()` Gets streamer stage name.
`String` `nextStageName()`
`void` `nextStageName(String nextStageName)`
`Map<String,Collection<?>>` `run(StreamerContext ctx, Collection<Object> evts)` Stage execution routine.
`String` `toString()`
`StreamerStage` `unwrap()`

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

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

### Constructor Detail

#### StreamerStageWrapper

    public StreamerStageWrapper(StreamerStage<Object> delegate,
                        int idx)

Parameters:
  `delegate` - Delegate stage.
  `idx` - Index.

### Method Detail

#### index

    public int index()

Returns:
  Stage index.

#### nextStageName

    @Nullable
    public String nextStageName()

Returns:
  Next stage name in pipeline or `null` if this is the last stage.

#### nextStageName

    public void nextStageName(String nextStageName)

Parameters:
  `nextStageName` - Next stage name in pipeline.

#### name

    public String name()

Gets streamer stage name.

Specified by:
  `name` in interface `StreamerStage<Object>`
Returns:
  Name of the stage.

#### run

    public Map<String,Collection<?>> run(StreamerContext ctx,
                                Collection<Object> evts)

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.

Specified by:
  `run` in interface `StreamerStage<Object>`
Parameters:
  `ctx` - Streamer context.
  `evts` - Input events.
Returns:
  Map of stage name to collection of events.

#### unwrap

    public StreamerStage unwrap()

Returns:
  Delegate.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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