org.apache.ignite.internal.processors.hadoop

## Class HadoopJobEx

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

All Implemented Interfaces:
  HadoopJob

    public abstract class HadoopJobEx
    extends Object
    implements HadoopJob

Hadoop job.

### Constructor Summary

Constructors
Constructor and Description
`HadoopJobEx()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract void` `cleanupStagingDirectory()` Cleans up the job staging directory.
`abstract void` `cleanupTaskEnvironment(HadoopTaskInfo info)` Cleans up local environment of the task.
`abstract void` `dispose(boolean external)` Release all the resources.
`abstract HadoopTaskContext` `getTaskContext(HadoopTaskInfo info)` Returns context for task execution.
`boolean` `hasCombiner()` Checks whether job has combiner.
`boolean` `hasReducer()` Checks whether job has reducer.
`abstract HadoopJobId` `id()` Gets job ID.
`abstract String` `igniteWorkDirectory()`
`abstract HadoopJobInfo` `info()` Gets job information.
`abstract void` `initialize(boolean external, UUID locNodeId)` Does all the needed initialization for the job.
`abstract Collection<HadoopInputSplit>` `input()` Gets collection of input splits for this job.
`String` `jobName()` Gets job name.
`abstract void` `prepareTaskEnvironment(HadoopTaskInfo info)` Prepare local environment for the task.
`String` `property(String name)` Gets optional configuration property for the job.
`int` `reducers()`
`String` `user()` Gets user name.

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

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

### Constructor Detail

#### HadoopJobEx

    public HadoopJobEx()

### Method Detail

#### id

    public abstract HadoopJobId id()

Gets job ID.

Returns:
  Job ID.

#### info

    public abstract HadoopJobInfo info()

Gets job information.

Returns:
  Job information.

#### input

    public abstract Collection<HadoopInputSplit> input()

Gets collection of input splits for this job.

Specified by:
  `input` in interface `HadoopJob`
Returns:
  Input splits.

#### getTaskContext

    public abstract HadoopTaskContext getTaskContext(HadoopTaskInfo info)
                                              throws IgniteCheckedException

Returns context for task execution.

Parameters:
  `info` - Task info.
Returns:
  Task Context.
Throws:
  `IgniteCheckedException` - If failed.

#### initialize

    public abstract void initialize(boolean external,
                                    UUID locNodeId)
                             throws IgniteCheckedException

Does all the needed initialization for the job. Will be called on each node where tasks for this job must be executed.

If job is running in external mode this method will be called on instance in Ignite node with parameter `false` and on instance in external process with parameter `true`.

Parameters:
  `external` - If `true` then this job instance resides in external process.
  `locNodeId` - Local node ID.
Throws:
  `IgniteCheckedException` - If failed.

#### dispose

    public abstract void dispose(boolean external)
                          throws IgniteCheckedException

Release all the resources.

If job is running in external mode this method will be called on instance in Ignite node with parameter `false` and on instance in external process with parameter `true`.

Parameters:
  `external` - If `true` then this job instance resides in external process.
Throws:
  `IgniteCheckedException` - If failed.

#### prepareTaskEnvironment

    public abstract void prepareTaskEnvironment(HadoopTaskInfo info)
                                         throws IgniteCheckedException

Prepare local environment for the task.

Parameters:
  `info` - Task info.
Throws:
  `IgniteCheckedException` - If failed.

#### cleanupTaskEnvironment

    public abstract void cleanupTaskEnvironment(HadoopTaskInfo info)
                                         throws IgniteCheckedException

Cleans up local environment of the task.

Parameters:
  `info` - Task info.
Throws:
  `IgniteCheckedException` - If failed.

#### cleanupStagingDirectory

    public abstract void cleanupStagingDirectory()

Cleans up the job staging directory.

#### igniteWorkDirectory

    public abstract String igniteWorkDirectory()

Returns:
  Ignite work directory.

#### property

    @Nullable
    public String property(String name)

Gets optional configuration property for the job.

Specified by:
  `property` in interface `HadoopJob`
Parameters:
  `name` - Property name.
Returns:
  Value or `null` if none.

#### hasCombiner

    public boolean hasCombiner()

Checks whether job has combiner.

Specified by:
  `hasCombiner` in interface `HadoopJob`
Returns:
  `true` If job has combiner.

#### hasReducer

    public boolean hasReducer()

Checks whether job has reducer. Actual number of reducers will be in `HadoopMapReducePlan.reducers()`.

Specified by:
  `hasReducer` in interface `HadoopJob`
Returns:
  Number of reducer.

#### reducers

    public int reducers()

Specified by:
  `reducers` in interface `HadoopJob`
Returns:
  Number of reducers configured for job.

#### jobName

    public String jobName()

Gets job name.

Specified by:
  `jobName` in interface `HadoopJob`
Returns:
  Job name.

#### user

    public String user()

Gets user name.

Specified by:
  `user` in interface `HadoopJob`
Returns:
  User name.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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