org.apache.ignite.internal

## Class ComputeTaskInternalFuture<R>

- java.lang.Object
- - java.util.concurrent.locks.AbstractOwnableSynchronizer
  - - java.util.concurrent.locks.AbstractQueuedSynchronizer
    - - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
      - - org.apache.ignite.internal.ComputeTaskInternalFuture<R>

Type Parameters:
  `R` - Type of the task result returning from `ComputeTask.reduce(List)` method.

All Implemented Interfaces:
  Serializable, IgniteInternalFuture<R>

    public class ComputeTaskInternalFuture<R>
    extends GridFutureAdapter<R>

This class provide implementation for task future.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`AbstractQueuedSynchronizer.ConditionObject`

### Constructor Summary

Constructors
Constructor and Description
`ComputeTaskInternalFuture(ComputeTaskSession ses, GridKernalContext ctx)`

### Method Summary

Methods
`boolean` `cancel()` Default no-op implementation that always returns `false`.
`static <R> ComputeTaskInternalFuture<R>` `finishedFuture(GridKernalContext ctx, Class<?> taskCls, IgniteCheckedException e)`
`ComputeTaskSession` `getTaskSession()` Gets task timeout.
`ComputeTaskFuture<R>` `publicFuture()`
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter

`chain, duration, endTime, error, get, get, get, get0, ignoreInterrupts, isCancelled, isDone, isFailed, listen, onCancelled, onDone, onDone, onDone, onDone, result, startTime, tryAcquireShared, tryReleaseShared`

### Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease`

### Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer

`getExclusiveOwnerThread, setExclusiveOwnerThread`

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

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

### Constructor Detail

#### ComputeTaskInternalFuture

    public ComputeTaskInternalFuture(ComputeTaskSession ses,
                             GridKernalContext ctx)

Parameters:
  `ses` - Task session instance.
  `ctx` - Kernal context.

### Method Detail

#### finishedFuture

    public static <R> ComputeTaskInternalFuture<R> finishedFuture(GridKernalContext ctx,
                                                  Class<?> taskCls,
                                                  IgniteCheckedException e)

Parameters:
  `ctx` - Context.
  `taskCls` - Task class.
  `e` - Error.
Returns:
  Finished task future.

#### publicFuture

    public ComputeTaskFuture<R> publicFuture()

Returns:
  Future returned by public API.

#### getTaskSession

    public ComputeTaskSession getTaskSession()

Gets task timeout.

Returns:
  Task timeout.

#### cancel

    public boolean cancel()
                   throws IgniteCheckedException

Default no-op implementation that always returns `false`. Futures that do support cancellation should override this method and call `GridFutureAdapter.onCancelled()` callback explicitly if cancellation indeed did happen.

Specified by:
  `cancel` in interface `IgniteInternalFuture<R>`
Overrides:
  `cancel` in class `GridFutureAdapter<R>`
Returns:
  `True` if future was canceled (i.e. was not finished prior to this call).
Throws:
  `IgniteCheckedException` - If cancellation failed.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridFutureAdapter<R>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015