org.apache.ignite.internal.processors.closure

## Class GridClosureProcessor.C2<R>

- java.lang.Object
- - org.apache.ignite.internal.processors.closure.GridClosureProcessor.C2<R>

All Implemented Interfaces:
  Serializable, Binarylizable, ComputeJob, GridInternalWrapper<Callable>, GridNoImplicitInjection

Direct Known Subclasses:
  GridClosureProcessor.C2MLA

Enclosing class:
  GridClosureProcessor

    public static class GridClosureProcessor.C2<R>
    extends Object
    implements ComputeJob, Binarylizable, GridNoImplicitInjection, GridInternalWrapper<Callable>

See Also:
  Serialized Form

### Field Summary

Fields
`protected Callable<R>` `c`

### Constructor Summary

Constructors
Constructor and Description
`C2()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cancel()` This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results).
`Object` `execute()` Executes this job.
`void` `readBinary(BinaryReader reader)` Reads fields from provided reader.
`String` `toString()`
`Callable` `userObject()` Get user object where resources must be injected.
`void` `writeBinary(BinaryWriter writer)` Writes fields to provided writer.

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

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

### Field Detail

#### c

    @GridToStringInclude
    protected Callable<R> c

### Constructor Detail

#### C2

    public C2()

### Method Detail

#### execute

    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.

#### cancel

    public void cancel()

This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). Job is also cancelled when `IgniteFuture.cancel()` is called.

Note that job cancellation is only a hint, and just like with `Thread.interrupt()` method, it is really up to the actual job instance to gracefully finish execution and exit.

Specified by:
  `cancel` in interface `ComputeJob`

#### writeBinary

    public void writeBinary(BinaryWriter writer)
                     throws BinaryObjectException

Writes fields to provided writer.

Specified by:
  `writeBinary` in interface `Binarylizable`
Parameters:
  `writer` - Binary object writer.
Throws:
  `BinaryObjectException` - In case of error.

#### readBinary

    public void readBinary(BinaryReader reader)
                    throws BinaryObjectException

Reads fields from provided reader.

Specified by:
  `readBinary` in interface `Binarylizable`
Parameters:
  `reader` - Binary object reader.
Throws:
  `BinaryObjectException` - In case of error.

#### userObject

    public Callable userObject()

Get user object where resources must be injected.

Specified by:
  `userObject` in interface `GridInternalWrapper<Callable>`
Returns:
  User object.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022