org.apache.ignite.internal.processors.hadoop

## Class HadoopDefaultJobInfo

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

All Implemented Interfaces:
  Externalizable, Serializable, HadoopJobInfo

    public class HadoopDefaultJobInfo
    extends Object
    implements HadoopJobInfo, Externalizable

Hadoop job info based on default Hadoop configuration.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`HadoopDefaultJobInfo()` Default constructor required by `Externalizable`.
`HadoopDefaultJobInfo(String jobName, String user, boolean hasCombiner, int numReduces, Map<String,String> props)` Constructor.

### Method Summary

Methods
`HadoopJob` `createJob(Class<? extends HadoopJob> jobCls, HadoopJobId jobId, IgniteLogger log, String[] libNames, HadoopHelper helper)` Creates new job instance for the given ID.
`boolean` `hasCombiner()` Checks whether job has combiner.
`boolean` `hasReducer()` Checks whether job has reducer.
`String` `jobName()` Gets job name.
`Map<String,String>` `properties()`
`String` `property(String name)` Gets optional configuration property for the job.
`void` `readExternal(ObjectInput in)`
`int` `reducers()`
`String` `user()` Gets user name.
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### HadoopDefaultJobInfo

    public HadoopDefaultJobInfo()

Default constructor required by `Externalizable`.

#### HadoopDefaultJobInfo

    public HadoopDefaultJobInfo(String jobName,
                        String user,
                        boolean hasCombiner,
                        int numReduces,
                        Map<String,String> props)

Constructor.

Parameters:
  `jobName` - Job name.
  `user` - User name.
  `hasCombiner` - `true` If job has combiner.
  `numReduces` - Number of reducers configured for job.
  `props` - All other properties of the job.

### Method Detail

#### property

    @Nullable
    public String property(String name)

Gets optional configuration property for the job.

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

#### createJob

    public HadoopJob createJob(Class<? extends HadoopJob> jobCls,
                      HadoopJobId jobId,
                      IgniteLogger log,
                      @Nullable
                      String[] libNames,
                      HadoopHelper helper)
                        throws IgniteCheckedException

Creates new job instance for the given ID. `HadoopJobInfo` is reusable for multiple jobs while `HadoopJob` is for one job execution. This method will be called once for the same ID on one node, though it can be called on the same host multiple times from different processes (in case of multiple nodes on the same host or external execution).

Specified by:
  `createJob` in interface `HadoopJobInfo`
Parameters:
  `jobCls` - The job class.
  `jobId` - Job ID.
  `log` - Logger.
  `libNames` - Optional additional native library names.
  `helper` - HadoopHelper.
Returns:
  Job.
Throws:
  `IgniteCheckedException` - If failed.

#### hasCombiner

    public boolean hasCombiner()

Checks whether job has combiner.

Specified by:
  `hasCombiner` in interface `HadoopJobInfo`
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 `HadoopJobInfo`
Returns:
  Number of reducer.

#### reducers

    public int reducers()

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

#### jobName

    public String jobName()

Gets job name.

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

#### user

    public String user()

Gets user name.

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

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### properties

    public Map<String,String> properties()

Returns:
  Properties of the job.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016