org.apache.ignite.internal.processors.platform.compute

## Class PlatformAbstractJob

- java.lang.Object
- - org.apache.ignite.internal.processors.platform.compute.PlatformAbstractJob

All Implemented Interfaces:
  Externalizable, Serializable, ComputeJob, PlatformJob

Direct Known Subclasses:
  PlatformClosureJob, PlatformFullJob

    public abstract class PlatformAbstractJob
    extends Object
    implements PlatformJob, Externalizable

Base interop job.

See Also:
  Serialized Form

### Field Summary

Fields
`protected Ignite` `ignite` Ignite instance.
`protected Object` `job` Job.
`protected long` `ptr` Pointer to job in the native platform.
`protected PlatformAbstractTask` `task` Parent task; present only on local job instance.

### Constructor Summary

Constructors
`protected` `PlatformAbstractJob()` `Externalizable` support.
`protected` `PlatformAbstractJob(PlatformAbstractTask task, long ptr, Object job)` Constructor.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected boolean` `createJob(PlatformContext ctx)` Create job in native platform if needed.
`Object` `execute()` Executes this job.
`protected abstract Object` `execute0(PlatformContext ctx)` Internal job execution routine.
`Object` `job()` Gets native job.
`long` `pointer()` Gets native pointer to deployed job.
`protected Object` `runLocal(PlatformContext ctx, boolean cancel)` Run local job.

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

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

### Methods inherited from interface org.apache.ignite.compute.ComputeJob

`cancel`

### Methods inherited from interface java.io.Externalizable

`readExternal, writeExternal`

### Field Detail

#### ignite

    @IgniteInstanceResource
    protected transient Ignite ignite

Ignite instance.

#### task

    protected transient PlatformAbstractTask task

Parent task; present only on local job instance.

#### ptr

    protected transient long ptr

Pointer to job in the native platform.

#### job

    protected Object job

Job.

### Constructor Detail

#### PlatformAbstractJob

    protected PlatformAbstractJob()

`Externalizable` support.

#### PlatformAbstractJob

    protected PlatformAbstractJob(PlatformAbstractTask task,
                                  long ptr,
                                  Object job)

Constructor.

Parameters:
  `task` - Parent task.
  `ptr` - Pointer.
  `job` - Job.

### Method Detail

#### execute

    @Nullable
    public Object execute()

Executes this job.

Specified by:
  `execute` in interface `ComputeJob`
Returns:
  Job execution result (possibly `null`). This result will be returned in `ComputeJobResult.getData()` method passed into `ComputeTask.result(ComputeJobResult, List)` task method on caller node.

#### execute0

    protected abstract Object execute0(PlatformContext ctx)
                                throws IgniteCheckedException

Internal job execution routine.

Parameters:
  `ctx` - Interop processor.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - If failed.

#### createJob

    protected boolean createJob(PlatformContext ctx)
                         throws IgniteCheckedException

Create job in native platform if needed.

Parameters:
  `ctx` - Context.
Returns:
  `True` if job was created, `false` if this is local job and creation is not necessary.
Throws:
  `IgniteCheckedException` - If failed.

#### runLocal

    protected Object runLocal(PlatformContext ctx,
                              boolean cancel)

Run local job.

Parameters:
  `ctx` - Context.
  `cancel` - Cancel flag.
Returns:
  Result.

#### pointer

    public long pointer()

Gets native pointer to deployed job.

Specified by:
  `pointer` in interface `PlatformJob`
Returns:
  Pointer.

#### job

    public Object job()

Gets native job.

Specified by:
  `job` in interface `PlatformJob`
Returns:
  Native job.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018