org.apache.ignite.streamer.router

## Class StreamerRandomEventRouter

- java.lang.Object
- - org.apache.ignite.streamer.StreamerEventRouterAdapter
  - - org.apache.ignite.streamer.router.StreamerRandomEventRouter

All Implemented Interfaces:
  StreamerEventRouter

    public class StreamerRandomEventRouter
    extends StreamerEventRouterAdapter

Random router. Routes event to random node.

### Constructor Summary

Constructors
Constructor and Description
`StreamerRandomEventRouter()` Empty constructor for spring.
`StreamerRandomEventRouter(Collection<IgnitePredicate<ClusterNode>> predicates)` Constructs random event router with optional set of filters to apply to streamer projection.
`StreamerRandomEventRouter(IgnitePredicate<ClusterNode>... predicates)` Constructs random event router with optional set of filters to apply to streamer projection.

### Method Summary

Methods
`ClusterNode` `route(StreamerContext ctx, String stageName, Object evt)` Selects a node for given event that should be processed by a stage with given name.

### Methods inherited from class org.apache.ignite.streamer.StreamerEventRouterAdapter

`route`

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

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

### Constructor Detail

#### StreamerRandomEventRouter

    public StreamerRandomEventRouter()

Empty constructor for spring.

#### StreamerRandomEventRouter

    public StreamerRandomEventRouter(@Nullable
                             IgnitePredicate<ClusterNode>... predicates)

Constructs random event router with optional set of filters to apply to streamer projection.

Parameters:
  `predicates` - Node predicates.

#### StreamerRandomEventRouter

    public StreamerRandomEventRouter(Collection<IgnitePredicate<ClusterNode>> predicates)

Constructs random event router with optional set of filters to apply to streamer projection.

Parameters:
  `predicates` - Node predicates.

### Method Detail

#### route

    public ClusterNode route(StreamerContext ctx,
                    String stageName,
                    Object 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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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