org.apache.ignite.internal.processors.hadoop

## Class HadoopTaskContext

- java.lang.Object
- - org.apache.ignite.internal.processors.hadoop.HadoopTaskContext

    public abstract class HadoopTaskContext
    extends Object

Task context.

### Constructor Summary

Constructors
`protected` `HadoopTaskContext(HadoopTaskInfo taskInfo, HadoopJob job)`

### Method Summary

Methods
`abstract void` `cancel()` Cancel current task execution.
`abstract void` `cleanupTaskEnvironment()` Cleans up local environment of the task.
`abstract <T extends HadoopCounter> T` `counter(String grp, String name, Class<T> cls)` Gets counter for the given name.
`abstract HadoopCounters` `counters()` Gets all known counters.
`abstract Comparator<Object>` `groupComparator()` Gets comparator for grouping on combine or reduce operation.
`HadoopTaskInput` `input()` Gets task input.
`void` `input(HadoopTaskInput in)` Sets input of the task.
`HadoopJob` `job()`
`abstract HadoopSerialization` `keySerialization()` Gets serializer for values.
`HadoopTaskOutput` `output()` Gets task output.
`void` `output(HadoopTaskOutput out)` Sets output of the task.
`abstract HadoopPartitioner` `partitioner()` Gets partitioner.
`abstract void` `prepareTaskEnvironment()` Prepare local environment for the task.
`abstract void` `run()` Execute current task.
`abstract Comparator<Object>` `sortComparator()` Gets sorting comparator.
`HadoopTaskInfo` `taskInfo()` Gets task info.
`void` `taskInfo(HadoopTaskInfo info)` Set a new task info.
`abstract HadoopSerialization` `valueSerialization()` Gets serializer for values.

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

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

### Constructor Detail

#### HadoopTaskContext

    protected HadoopTaskContext(HadoopTaskInfo taskInfo,
                     HadoopJob job)

Parameters:
  `taskInfo` - Task info.
  `job` - Job.

### Method Detail

#### taskInfo

    public HadoopTaskInfo taskInfo()

Gets task info.

Returns:
  Task info.

#### taskInfo

    public void taskInfo(HadoopTaskInfo info)

Set a new task info.

Parameters:
  `info` - Task info.

#### output

    public HadoopTaskOutput output()

Gets task output.

Returns:
  Task output.

#### input

    public HadoopTaskInput input()

Gets task input.

Returns:
  Task input.

#### job

    public HadoopJob job()

Returns:
  Job.

#### counter

    public abstract <T extends HadoopCounter> T counter(String grp,
                                      String name,
                                      Class<T> cls)

Gets counter for the given name.

Parameters:
  `grp` - Counter group's name.
  `name` - Counter name.
Returns:
  Counter.

#### counters

    public abstract HadoopCounters counters()

Gets all known counters.

Returns:
  Unmodifiable collection of counters.

#### input

    public void input(HadoopTaskInput in)

Sets input of the task.

Parameters:
  `in` - Input.

#### output

    public void output(HadoopTaskOutput out)

Sets output of the task.

Parameters:
  `out` - Output.

#### partitioner

    public abstract HadoopPartitioner partitioner()
                                           throws IgniteCheckedException

Gets partitioner.

Returns:
  Partitioner.
Throws:
  `IgniteCheckedException` - If failed.

#### keySerialization

    public abstract HadoopSerialization keySerialization()
                                                  throws IgniteCheckedException

Gets serializer for values.

Returns:
  Serializer for keys.
Throws:
  `IgniteCheckedException` - If failed.

#### valueSerialization

    public abstract HadoopSerialization valueSerialization()
                                                    throws IgniteCheckedException

Gets serializer for values.

Returns:
  Serializer for values.
Throws:
  `IgniteCheckedException` - If failed.

#### sortComparator

    public abstract Comparator<Object> sortComparator()

Gets sorting comparator.

Returns:
  Comparator for sorting.

#### groupComparator

    public abstract Comparator<Object> groupComparator()

Gets comparator for grouping on combine or reduce operation.

Returns:
  Comparator.

#### run

    public abstract void run()
                      throws IgniteCheckedException

Execute current task.

Throws:
  `IgniteCheckedException` - If failed.

#### cancel

    public abstract void cancel()

Cancel current task execution.

#### prepareTaskEnvironment

    public abstract void prepareTaskEnvironment()
                                         throws IgniteCheckedException

Prepare local environment for the task.

Throws:
  `IgniteCheckedException` - If failed.

#### cleanupTaskEnvironment

    public abstract void cleanupTaskEnvironment()
                                         throws IgniteCheckedException

Cleans up local environment of the task.

Throws:
  `IgniteCheckedException` - If failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0
Release Date | : March 31 2015