public interface IgniteStreamer
StreamerStage
, a set of stages event passed through is called pipeline.
For each submitted group of events streamer determines one or more execution nodes that will process this
group of events. Execution nodes are determined by StreamerEventRouter
. Execution nodes run stages
with received events. After stage execution streamer gets an optional set of events that should be processed
further. The process is repeated until stage returns empty map. After stage returned empty map pipeline execution
for given group of events is finished.
It is guaranteed that group of events returned by router will be neither split nor concatenated with any other group of events and will be passed to stage as is. Event processing order is not guaranteed, group that was submitted second can be processed earlier then first submitted group.
If StreamerConfiguration.isAtLeastOnce()
is set to false
, then event execution is not tracked
by streamer and any occurred failure will be reported to failure listener on node on which failure happened. If
this configuration property is set to true
, then streamer will cancel current pipeline execution in case
of failure and will try to execute pipeline from the beginning. If failover cannot be succeeded or maximum number
of failover attempts is exceeded, then listener will be notified on node which originated pipeline execution.
StreamerStage
,
StreamerEventRouter
Modifier and Type | Method and Description |
---|---|
void |
addEvent(Object evt,
Object... evts)
Submits group of events for processing.
|
void |
addEvents(Collection<?> evts)
Submits group of events for processing.
|
void |
addEventsToStage(String stageName,
Collection<?> evts)
Submits events to streamer.
|
void |
addEventToStage(String stageName,
Object evt,
Object... evts)
Submits group of events to streamer.
|
void |
addStreamerFailureListener(StreamerFailureListener lsnr)
Adds streamer failure listener.
|
StreamerConfiguration |
configuration()
Gets streamer configuration.
|
StreamerContext |
context()
Gets streamer context.
|
void |
deployClass(Class<?> depCls)
Explicitly sets deployment class.
|
StreamerMetrics |
metrics()
Gets current streamer metrics.
|
String |
name()
Gets streamer name.
|
void |
removeStreamerFailureListener(StreamerFailureListener lsnr)
Removes streamer failure listener.
|
void |
reset()
Resets all configured streamer windows by calling
StreamerWindow.reset() on each and
clears local space. |
void |
resetMetrics()
Resets all streamer metrics.
|
StreamerConfiguration configuration()
String name()
null
for default no-name streamer.void addEvent(Object evt, Object... evts) throws IgniteException
evt
- Event to add.evts
- Optional events to add.IgniteException
- If event submission failed.void addEventToStage(String stageName, Object evt, Object... evts) throws IgniteException
stageName
- Stage name to start with.evt
- Event tp process.evts
- Optional events.IgniteException
- If event submission failed.void addEvents(Collection<?> evts) throws IgniteException
evts
- Events to add.IgniteException
- If event submission failed.void addEventsToStage(String stageName, Collection<?> evts) throws IgniteException
stageName
- Stage name to start with.evts
- Events to process.IgniteException
- If event submission failed.StreamerContext context()
void addStreamerFailureListener(StreamerFailureListener lsnr)
StreamerConfiguration.isAtLeastOnce()
is set to false
and on node which originated
pipeline execution otherwise.lsnr
- Listener to add.void removeStreamerFailureListener(StreamerFailureListener lsnr)
lsnr
- Listener to remove.StreamerMetrics metrics()
void reset()
StreamerWindow.reset()
on each and
clears local space.
This is local method, it will clear only local windows and local space. Note that windows and space will not be cleaned while stages are executing, i.e. all currently running stages will have to complete before streamer can be reset.
void resetMetrics()
void deployClass(Class<?> depCls)
depCls
- Deployment class.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 16 2015