Class GridContinuousProcessor
- java.lang.Object
-
- org.apache.ignite.internal.processors.GridProcessorAdapter
-
- org.apache.ignite.internal.processors.continuous.GridContinuousProcessor
-
- All Implemented Interfaces:
GridComponent,GridProcessor
public class GridContinuousProcessor extends GridProcessorAdapter
Processor for continuous routines.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridContinuousProcessor.LocalRoutineInfoLocal routine info.static classGridContinuousProcessor.RemoteRoutineInfoRemote routine info.static interfaceGridContinuousProcessor.RoutineInfoRoutine interface info.-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent
GridComponent.DiscoveryDataExchangeType
-
-
Field Summary
Fields Modifier and Type Field Description static StringCQ_SYS_VIEWstatic StringCQ_SYS_VIEW_DESC-
Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
ctx, diagnosticLog, log
-
-
Constructor Summary
Constructors Constructor Description GridContinuousProcessor(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBackupNotification(UUID nodeId, UUID routineId, Collection<?> objs, @Nullable Object orderedTopic)voidaddNotification(UUID nodeId, UUID routineId, @Nullable Object obj, @Nullable Object orderedTopic, boolean sync, boolean msg)voidcollectGridNodeData(DiscoveryDataBag dataBag)Collects discovery data on nodes already in grid on receivingTcpDiscoveryNodeAddedMessage.voidcollectJoiningNodeData(DiscoveryDataBag dataBag)Collects discovery data on joining node before sendingTcpDiscoveryJoinRequestMessagerequest.@Nullable GridComponent.DiscoveryDataExchangeTypediscoveryDataType()Gets unique component type to distinguish components providing discovery data.booleanlockStopping()voidonCacheStart(GridCacheContext ctx)Callback invoked when cache is started.voidonCacheStop(GridCacheContext ctx)voidonDisconnected(IgniteFuture<?> reconnectFut)Client disconnected callback.voidonGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)Receives discovery data object from remote nodes (called on new node during discovery process).voidonJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)Method is called on nodes that are already in grid (not on joining node).voidonKernalStop(boolean cancel)Callback to notify that kernal is about to stop.UUIDregisterStaticRoutine(String cacheName, javax.cache.event.CacheEntryUpdatedListener<?,?> locLsnr, CacheEntryEventSerializableFilter rmtFilter, @Nullable IgnitePredicate<ClusterNode> prjPred)Registers routine info to be sent in discovery data during this node join (to be used for internal queries started from client nodes).voidstart()Starts grid component.IgniteInternalFuture<UUID>startRoutine(GridContinuousHandler hnd, boolean locOnly, int bufSize, long interval, boolean autoUnsubscribe, @Nullable IgnitePredicate<ClusterNode> prjPred)voidstop(boolean cancel)Stops grid component.IgniteInternalFuture<?>stopRoutine(UUID routineId)voidunlockStopping()-
Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
assertParameter, onKernalStart, onReconnected, printMemoryStats, toString, validateNode, validateNode
-
-
-
-
Field Detail
-
CQ_SYS_VIEW
public static final String CQ_SYS_VIEW
-
CQ_SYS_VIEW_DESC
public static final String CQ_SYS_VIEW_DESC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GridContinuousProcessor
public GridContinuousProcessor(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
start
public void start() throws IgniteCheckedExceptionStarts grid component.- Specified by:
startin interfaceGridComponent- Overrides:
startin classGridProcessorAdapter- Throws:
IgniteCheckedException- Throws in case of any errors.
-
lockStopping
public boolean lockStopping()
- Returns:
trueif lock successful,falseif processor already stopped.
-
unlockStopping
public void unlockStopping()
-
onKernalStop
public void onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.- Specified by:
onKernalStopin interfaceGridComponent- Overrides:
onKernalStopin classGridProcessorAdapter- Parameters:
cancel- Flag indicating whether jobs should be canceled.
-
stop
public void stop(boolean cancel) throws IgniteCheckedExceptionStops grid component.- Specified by:
stopin interfaceGridComponent- Overrides:
stopin classGridProcessorAdapter- Parameters:
cancel- Iftrue, then all ongoing tasks or jobs for relevant components need to be cancelled.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
discoveryDataType
@Nullable public @Nullable GridComponent.DiscoveryDataExchangeType discoveryDataType()
Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements any of methodsGridComponent.collectJoiningNodeData(DiscoveryDataBag)orGridComponent.collectGridNodeData(DiscoveryDataBag).- Specified by:
discoveryDataTypein interfaceGridComponent- Overrides:
discoveryDataTypein classGridProcessorAdapter- Returns:
- Unique component type for discovery data exchange.
-
collectJoiningNodeData
public void collectJoiningNodeData(DiscoveryDataBag dataBag)
Collects discovery data on joining node before sendingTcpDiscoveryJoinRequestMessagerequest.- Specified by:
collectJoiningNodeDatain interfaceGridComponent- Overrides:
collectJoiningNodeDatain classGridProcessorAdapter- Parameters:
dataBag- container object to store discovery data in.
-
collectGridNodeData
public void collectGridNodeData(DiscoveryDataBag dataBag)
Collects discovery data on nodes already in grid on receivingTcpDiscoveryNodeAddedMessage.- Specified by:
collectGridNodeDatain interfaceGridComponent- Overrides:
collectGridNodeDatain classGridProcessorAdapter- Parameters:
dataBag- container object to store discovery data in.
-
onJoiningNodeDataReceived
public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
Method is called on nodes that are already in grid (not on joining node). It receives discovery data from joining node.- Specified by:
onJoiningNodeDataReceivedin interfaceGridComponent- Overrides:
onJoiningNodeDataReceivedin classGridProcessorAdapter- Parameters:
data-DiscoveryDataBag.JoiningNodeDiscoveryDatainterface to retrieve discovery data of joining node.
-
onGridDataReceived
public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
Receives discovery data object from remote nodes (called on new node during discovery process).- Specified by:
onGridDataReceivedin interfaceGridComponent- Overrides:
onGridDataReceivedin classGridProcessorAdapter- Parameters:
data-DiscoveryDataBag.GridDiscoveryDatainterface to retrieve discovery data collected on remote nodes (data common for all nodes in grid and specific for each node).
-
onCacheStart
public void onCacheStart(GridCacheContext ctx) throws IgniteCheckedException
Callback invoked when cache is started.- Parameters:
ctx- Cache context.- Throws:
IgniteCheckedException- If failed.
-
onCacheStop
public void onCacheStop(GridCacheContext ctx)
- Parameters:
ctx- Callback invoked when cache is stopped.
-
registerStaticRoutine
public UUID registerStaticRoutine(String cacheName, javax.cache.event.CacheEntryUpdatedListener<?,?> locLsnr, CacheEntryEventSerializableFilter rmtFilter, @Nullable @Nullable IgnitePredicate<ClusterNode> prjPred) throws IgniteCheckedException
Registers routine info to be sent in discovery data during this node join (to be used for internal queries started from client nodes). Peer class loading is not applied to static routines.- Parameters:
cacheName- Cache name.locLsnr- Local listener.rmtFilter- Remote filter.prjPred- Projection predicate.- Returns:
- Routine ID.
- Throws:
IgniteCheckedException- If failed.
-
startRoutine
public IgniteInternalFuture<UUID> startRoutine(GridContinuousHandler hnd, boolean locOnly, int bufSize, long interval, boolean autoUnsubscribe, @Nullable @Nullable IgnitePredicate<ClusterNode> prjPred) throws IgniteCheckedException
- Parameters:
hnd- Handler.bufSize- Buffer size.interval- Time interval.autoUnsubscribe- Automatic unsubscribe flag.locOnly- Local only flag.prjPred- Projection predicate.- Returns:
- Future.
- Throws:
IgniteCheckedException
-
stopRoutine
public IgniteInternalFuture<?> stopRoutine(UUID routineId)
- Parameters:
routineId- Consume ID.- Returns:
- Future.
-
addBackupNotification
public void addBackupNotification(UUID nodeId, UUID routineId, Collection<?> objs, @Nullable @Nullable Object orderedTopic) throws IgniteCheckedException
- Parameters:
nodeId- ID of the node that started routine.routineId- Routine ID.objs- Notification objects.orderedTopic- Topic for ordered notifications. Ifnull, non-ordered message will be sent.- Throws:
IgniteCheckedException- In case of error.
-
addNotification
public void addNotification(UUID nodeId, UUID routineId, @Nullable @Nullable Object obj, @Nullable @Nullable Object orderedTopic, boolean sync, boolean msg) throws IgniteCheckedException
- Parameters:
nodeId- ID of the node that started routine.routineId- Routine ID.obj- Notification object.orderedTopic- Topic for ordered notifications. Ifnull, non-ordered message will be sent.sync- Iftruethen waits for event acknowledgment.msg- Iftruethen sent data is message.- Throws:
IgniteCheckedException- In case of error.
-
onDisconnected
public void onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.- Specified by:
onDisconnectedin interfaceGridComponent- Overrides:
onDisconnectedin classGridProcessorAdapter- Parameters:
reconnectFut- Reconnect future.
-
-