org.apache.ignite.internal.processors.continuous

## 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/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridContinuousProcessor(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addBackupNotification(UUID nodeId, UUID routineId, Collection<?> objs, Object orderedTopic)`
`void` `addNotification(UUID nodeId, UUID routineId, Object obj, Object orderedTopic, boolean sync, boolean msg)`
`void` `collectGridNodeData(DiscoveryDataBag dataBag)` Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.
`void` `collectJoiningNodeData(DiscoveryDataBag dataBag)` Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`boolean` `lockStopping()`
`void` `onCacheStart(GridCacheContext ctx)` Callback invoked when cache is started.
`void` `onCacheStop(GridCacheContext ctx)`
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)` Method is called on nodes that are already in grid (not on joining node).
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`UUID` `registerStaticRoutine(String cacheName, javax.cache.event.CacheEntryUpdatedListener<?,?> locLsnr, CacheEntryEventSerializableFilter rmtFilter, 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).
`void` `start()` Starts grid component.
`IgniteInternalFuture<UUID>` `startRoutine(GridContinuousHandler hnd, boolean locOnly, int bufSize, long interval, boolean autoUnsubscribe, IgnitePredicate<ClusterNode> prjPred)`
`void` `stop(boolean cancel)` Stops grid component.
`IgniteInternalFuture<?>` `stopRoutine(UUID routineId)`
`void` `unlockStopping()`

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, onKernalStart, onReconnected, printMemoryStats, toString, validateNode, validateNode`

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

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

### Constructor Detail

#### GridContinuousProcessor

    public GridContinuousProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### lockStopping

    public boolean lockStopping()

Returns:
  `true` if lock successful, `false` if processor already stopped.

#### unlockStopping

    public void unlockStopping()

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Overrides:
  `onKernalStop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### discoveryDataType

    @Nullable
    public GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements any of methods `GridComponent.collectJoiningNodeData(DiscoveryDataBag)` or `GridComponent.collectGridNodeData(DiscoveryDataBag)`.

Specified by:
  `discoveryDataType` in interface `GridComponent`
Overrides:
  `discoveryDataType` in class `GridProcessorAdapter`
Returns:
  Unique component type for discovery data exchange.

#### collectJoiningNodeData

    public void collectJoiningNodeData(DiscoveryDataBag dataBag)

Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.

Specified by:
  `collectJoiningNodeData` in interface `GridComponent`
Overrides:
  `collectJoiningNodeData` in class `GridProcessorAdapter`
Parameters:
  `dataBag` - container object to store discovery data in.

#### collectGridNodeData

    public void collectGridNodeData(DiscoveryDataBag dataBag)

Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.

Specified by:
  `collectGridNodeData` in interface `GridComponent`
Overrides:
  `collectGridNodeData` in class `GridProcessorAdapter`
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:
  `onJoiningNodeDataReceived` in interface `GridComponent`
Overrides:
  `onJoiningNodeDataReceived` in class `GridProcessorAdapter`
Parameters:
  `data` - `DiscoveryDataBag.JoiningNodeDiscoveryData` interface 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:
  `onGridDataReceived` in interface `GridComponent`
Overrides:
  `onGridDataReceived` in class `GridProcessorAdapter`
Parameters:
  `data` - `DiscoveryDataBag.GridDiscoveryData` interface 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
                                      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).

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
                                                   IgnitePredicate<ClusterNode> prjPred)

Parameters:
  `hnd` - Handler.
  `bufSize` - Buffer size.
  `interval` - Time interval.
  `autoUnsubscribe` - Automatic unsubscribe flag.
  `locOnly` - Local only flag.
  `prjPred` - Projection predicate.
Returns:
  Future.

#### stopRoutine

    public IgniteInternalFuture<?> stopRoutine(UUID routineId)

Parameters:
  `routineId` - Consume ID.
Returns:
  Future.

#### addBackupNotification

    public void addBackupNotification(UUID nodeId,
                                      UUID routineId,
                                      Collection<?> objs,
                                      @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. If `null`, non-ordered message will be sent.
Throws:
  `IgniteCheckedException` - In case of error.

#### addNotification

    public void addNotification(UUID nodeId,
                                UUID routineId,
                                @Nullable
                                Object obj,
                                @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. If `null`, non-ordered message will be sent.
  `sync` - If `true` then waits for event acknowledgment.
  `msg` - If `true` then sent data is message.
Throws:
  `IgniteCheckedException` - In case of error.

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)

Client disconnected callback.

Specified by:
  `onDisconnected` in interface `GridComponent`
Overrides:
  `onDisconnected` in class `GridProcessorAdapter`
Parameters:
  `reconnectFut` - Reconnect future.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018