public class GridStreamerContextImpl extends Object implements GridStreamerContext
| Constructor and Description |
|---|
GridStreamerContextImpl(GridKernalContext ctx,
GridStreamerConfiguration cfg,
GridStreamerEx streamer) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(GridInClosure<GridStreamerContext> clo)
Queries all streamer nodes deployed within grid.
|
void |
broadcast(GridInClosure<GridStreamerContext> clo,
Collection<GridNode> nodes)
Queries streamer nodes deployed within grid.
|
<K,V> ConcurrentMap<K,V> |
localSpace()
Gets streamer local space.
|
String |
nextStageName()
For context passed to
GridStreamerStage.run(GridStreamerContext, Collection) this method will
return next stage name in execution pipeline. |
void |
nextStageName(String nextStageName)
Sets next stage name for main context.
|
GridProjection |
projection()
Gets instance of dynamic grid projection including all nodes on which this streamer is running.
|
<R> Collection<R> |
query(GridClosure<GridStreamerContext,R> clo)
Queries all streamer nodes deployed within grid.
|
<R> Collection<R> |
query(GridClosure<GridStreamerContext,R> clo,
Collection<GridNode> nodes)
Queries streamer nodes deployed within grid.
|
<R1,R2> R2 |
reduce(GridClosure<GridStreamerContext,R1> clo,
GridReducer<R1,R2> rdc)
Queries all streamer nodes deployed within grid.
|
<R1,R2> R2 |
reduce(GridClosure<GridStreamerContext,R1> clo,
GridReducer<R1,R2> rdc,
Collection<GridNode> nodes)
Queries streamer nodes deployed within grid.
|
<E> GridStreamerWindow<E> |
window()
Gets default event window, i.e.
|
<E> GridStreamerWindow<E> |
window(String winName)
Gets streamer event window by window name, if no window with such
name was configured
IllegalArgumentException will be thrown. |
public GridStreamerContextImpl(GridKernalContext ctx, GridStreamerConfiguration cfg, GridStreamerEx streamer)
ctx - Kernal context.cfg - Streamer configuration.streamer - Streamer impl.public GridProjection projection()
projection in interface GridStreamerContextpublic <K,V> ConcurrentMap<K,V> localSpace()
localSpace in interface GridStreamerContextpublic <E> GridStreamerWindow<E> window()
window in interface GridStreamerContextpublic <E> GridStreamerWindow<E> window(String winName)
IllegalArgumentException will be thrown.window in interface GridStreamerContextwinName - Window name.public String nextStageName()
GridStreamerStage.run(GridStreamerContext, Collection) this method will
return next stage name in execution pipeline. For context obtained from streamer object, this method will
return first stage name.nextStageName in interface GridStreamerContextpublic void nextStageName(String nextStageName)
nextStageName - Next stage name.public <R> Collection<R> query(GridClosure<GridStreamerContext,R> clo) throws GridException
query in interface GridStreamerContextclo - Function to be executed on individual nodes.GridException - If query execution failed.public <R> Collection<R> query(GridClosure<GridStreamerContext,R> clo, Collection<GridNode> nodes) throws GridException
query in interface GridStreamerContextclo - Function to be executed on individual nodes.nodes - Optional list of nodes to execute query on, if empty, then all nodes on
which this streamer is running will be queried.GridException - If query execution failed.public void broadcast(GridInClosure<GridStreamerContext> clo) throws GridException
broadcast in interface GridStreamerContextclo - Function to be executed on individual nodes.GridException - If closure execution failed.public void broadcast(GridInClosure<GridStreamerContext> clo, Collection<GridNode> nodes) throws GridException
broadcast in interface GridStreamerContextclo - Function to be executed on individual nodes.nodes - Optional list of nodes to execute query on, if empty, then all nodes on
which this streamer is running will be queried.GridException - If closure execution failed.public <R1,R2> R2 reduce(GridClosure<GridStreamerContext,R1> clo, GridReducer<R1,R2> rdc) throws GridException
reduce in interface GridStreamerContextclo - Function to be executed on individual nodes.rdc - Reducer to reduce results received from remote nodes.GridException - If query execution failed.public <R1,R2> R2 reduce(GridClosure<GridStreamerContext,R1> clo, GridReducer<R1,R2> rdc, Collection<GridNode> nodes) throws GridException
reduce in interface GridStreamerContextclo - Function to be executed on individual nodes.rdc - Reducer to reduce results received from remote nodes.nodes - Optional list of nodes to execute query on, if empty, then all nodes on
which this streamer is running will be queried.GridException - If query execution failed.Copyright © 2014. All rights reserved.