org.apache.ignite.internal.processors.job

## Class GridJobProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.job.GridJobProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridJobProcessor
    extends GridProcessorAdapter

Responsible for all grid job execution and communication.

### 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
`GridJobProcessor(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`GridJobWorker` `activeJob(IgniteUuid jobId)` Gets active job.
`void` `cancelJob(IgniteUuid sesId, IgniteUuid jobId, boolean sys)`
`String` `currentTaskName()` Gets name task executed by current thread.
`int` `currentTaskNameHash()` Gets hash of task name executed by current thread.
`void` `currentTaskSession(ComputeTaskSession ses)` Callback from job worker to set current task session for execution.
`boolean` `internal()`
`void` `masterLeaveLocal(IgniteUuid sesId)` Notify processor that master leave aware handler must be invoked on all jobs with the given session ID.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`void` `processJobExecuteRequest(ClusterNode node, GridJobExecuteRequest req)`
`Collection<ComputeJobSibling>` `requestJobSiblings(ComputeTaskSession ses)`
`void` `setAttributes(GridJobSessionImpl ses, Map<?,?> attrs)`
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.

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

`assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onReconnected, toString, validateNode, validateNode`

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

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

### Constructor Detail

#### GridJobProcessor

    public GridJobProcessor(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.

#### stop

    public void stop(boolean cancel)

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.

#### 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.

#### activeJob

    @Nullable
    public GridJobWorker activeJob(IgniteUuid jobId)

Gets active job.

Parameters:
  `jobId` - Job ID.
Returns:
  Active job.

#### internal

    public boolean internal()

Returns:
  `True` if running internal task.

#### setAttributes

    public void setAttributes(GridJobSessionImpl ses,
                              Map<?,?> attrs)
                       throws IgniteCheckedException

Parameters:
  `ses` - Session.
  `attrs` - Attributes.
Throws:
  `IgniteCheckedException` - If failed.

#### requestJobSiblings

    public Collection<ComputeJobSibling> requestJobSiblings(ComputeTaskSession ses)
                                                     throws IgniteCheckedException

Parameters:
  `ses` - Session.
Returns:
  Siblings.
Throws:
  `IgniteCheckedException` - If failed.

#### masterLeaveLocal

    public void masterLeaveLocal(IgniteUuid sesId)

Notify processor that master leave aware handler must be invoked on all jobs with the given session ID.

Parameters:
  `sesId` - Session ID.

#### cancelJob

    public void cancelJob(@Nullable
                          IgniteUuid sesId,
                          @Nullable
                          IgniteUuid jobId,
                          boolean sys)

Parameters:
  `sesId` - Session ID.
  `jobId` - Job ID.
  `sys` - System flag.

#### processJobExecuteRequest

    public void processJobExecuteRequest(ClusterNode node,
                                         GridJobExecuteRequest req)

Parameters:
  `node` - Node.
  `req` - Request.

#### currentTaskSession

    public void currentTaskSession(ComputeTaskSession ses)

Callback from job worker to set current task session for execution.

Parameters:
  `ses` - Session.

#### currentTaskNameHash

    public int currentTaskNameHash()

Gets hash of task name executed by current thread.

Returns:
  Task name hash or `0` if security is disabled.

#### currentTaskName

    public String currentTaskName()

Gets name task executed by current thread.

Returns:
  Task name or `null` if security is disabled.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridComponent`
Overrides:
  `printMemoryStats` in class `GridProcessorAdapter`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019