public class GridStreamerImpl extends Object implements GridStreamerEx, Externalizable
| Constructor and Description |
|---|
GridStreamerImpl()
Empty constructor required by
Externalizable. |
GridStreamerImpl(GridKernalContext ctx,
GridStreamerConfiguration c) |
| 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(GridStreamerFailureListener lsnr)
Adds streamer failure listener.
|
boolean |
cancelled(GridUuid futId)
Checks if cancel request was received for this future ID.
|
GridStreamerConfiguration |
configuration()
Gets streamer configuration.
|
GridStreamerContext |
context()
Gets streamer context.
|
void |
deployClass(Class<?> depCls)
Explicitly sets deployment class.
|
GridStreamerEventRouter |
eventRouter() |
GridKernalContext |
kernalContext() |
GridStreamerMetrics |
metrics()
Gets current streamer metrics.
|
String |
name()
Gets streamer name.
|
void |
onFutureCompleted(GridStreamerStageExecutionFuture fut)
Called when future is completed and parent should be notified, if any.
|
void |
onFutureMapped(GridStreamerStageExecutionFuture fut)
Called before execution requests are sent to remote nodes or scheduled for local execution.
|
void |
onKernalStop(boolean cancel)
On kernal stop callback.
|
void |
onQueryCompleted(long time,
int nodes)
Callback executed when streamer query completes.
|
void |
onUndeploy(UUID leftNodeId,
ClassLoader undeployedLdr)
Callback for undeployed class loaders.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on unmarshalling.
|
void |
removeStreamerFailureListener(GridStreamerFailureListener lsnr)
Removes streamer failure listener.
|
void |
reset()
Resets all configured streamer windows by calling
GridStreamerWindow.reset() on each and
clears local space. |
void |
resetMetrics()
Resets all streamer metrics.
|
void |
scheduleExecutions(GridStreamerStageExecutionFuture fut,
Map<UUID,GridStreamerExecutionBatch> execs)
Schedules batch executions either on local or on remote nodes.
|
void |
start() |
void |
stop(boolean cancel) |
String |
toString() |
<E> GridStreamerWindow<E> |
window()
Gets streamer default window (the first one in configuration list).
|
<E> GridStreamerWindow<E> |
window(String windowName)
Gets streamer window by window name.
|
void |
writeExternal(ObjectOutput out) |
public GridStreamerImpl()
Externalizable.public GridStreamerImpl(GridKernalContext ctx, GridStreamerConfiguration c)
ctx - Kernal context.c - Configuration.public void start()
throws GridException
GridException - If failed.public void onKernalStop(boolean cancel)
cancel - Cancel.public void stop(boolean cancel)
cancel - Whether currently running tasks should be cancelled.@Nullable public String name()
name in interface GridStreamerpublic GridStreamerConfiguration configuration()
configuration in interface GridStreamerpublic void addEvent(Object evt, Object... evts) throws GridException
addEvent in interface GridStreamerevt - Event to add.evts - Optional events to add.GridException - If event submission failed.public void addEventToStage(String stageName, Object evt, Object... evts) throws GridException
addEventToStage in interface GridStreamerstageName - Stage name to start with.evt - Event tp process.evts - Optional events.GridException - If event submission failed.public void addEvents(Collection<?> evts) throws GridException
addEvents in interface GridStreamerevts - Events to add.GridException - If event submission failed.public void addEventsToStage(String stageName, Collection<?> evts) throws GridException
addEventsToStage in interface GridStreamerstageName - Stage name to start with.evts - Events to process.GridException - If event submission failed.public GridStreamerContext context()
context in interface GridStreamerpublic void addStreamerFailureListener(GridStreamerFailureListener lsnr)
GridStreamerConfiguration.isAtLeastOnce() is set to false and on node which originated
pipeline execution otherwise.addStreamerFailureListener in interface GridStreamerlsnr - Listener to add.public void removeStreamerFailureListener(GridStreamerFailureListener lsnr)
removeStreamerFailureListener in interface GridStreamerlsnr - Listener to remove.public GridStreamerMetrics metrics()
metrics in interface GridStreamerpublic void reset()
GridStreamerWindow.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.
reset in interface GridStreamerpublic void resetMetrics()
resetMetrics in interface GridStreamerpublic void deployClass(Class<?> depCls)
deployClass in interface GridStreamerdepCls - Deployment class.public <E> GridStreamerWindow<E> window()
window in interface GridStreamerExpublic <E> GridStreamerWindow<E> window(String windowName)
window in interface GridStreamerExwindowName - Window name.public GridKernalContext kernalContext()
kernalContext in interface GridStreamerExpublic void onFutureMapped(GridStreamerStageExecutionFuture fut)
onFutureMapped in interface GridStreamerExfut - Future.public void onFutureCompleted(GridStreamerStageExecutionFuture fut)
onFutureCompleted in interface GridStreamerExfut - Future.public GridStreamerEventRouter eventRouter()
eventRouter in interface GridStreamerExpublic void scheduleExecutions(GridStreamerStageExecutionFuture fut, Map<UUID,GridStreamerExecutionBatch> execs) throws GridException
scheduleExecutions in interface GridStreamerExfut - Future.execs - Executions grouped by node ID.GridException - If failed.public void onUndeploy(UUID leftNodeId, ClassLoader undeployedLdr)
onUndeploy in interface GridStreamerExleftNodeId - Left node ID which caused undeployment.undeployedLdr - Undeployed class loader.public void onQueryCompleted(long time,
int nodes)
onQueryCompleted in interface GridStreamerExtime - Consumed time.nodes - Participating nodes count.public boolean cancelled(GridUuid futId)
futId - Future ID.True if future was cancelled, false otherwise.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve()
Copyright © 2014. All rights reserved.