org.apache.hadoop.mapred

## Class MapTask

- java.lang.Object
- - org.apache.hadoop.mapred.Task
  - - org.apache.hadoop.mapred.MapTask

- All Implemented Interfaces:
    org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable

      @InterfaceAudience.LimitedPrivate(value="MapReduce")
       @InterfaceStability.Unstable
      public class MapTask
      extends Task

  A Map task.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MapTask.MapOutputBuffer<K,V>`

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapred.Task

      `Task.CombineOutputCollector<K,V>, Task.CombinerRunner<K,V>, Task.CombineValuesIterator<KEY,VALUE>, Task.Counter, Task.NewCombinerRunner<K,V>, Task.OldCombinerRunner<K,V>, Task.TaskReporter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MAP_OUTPUT_INDEX_RECORD_LENGTH` The size of each record in the index file for the map-outputs.

    - ### Fields inherited from class org.apache.hadoop.mapred.Task

      `committer, conf, DEFAULT_COMBINE_RECORDS_BEFORE_PROGRESS, extraData, failedShuffleCounter, FILESYSTEM_COUNTER_GROUP, gcUpdater, jobCleanup, jobContext, jobRunStateForCleanup, jobSetup, lDirAlloc, mapOutputFile, MERGED_OUTPUT_PREFIX, mergedMapOutputsCounter, outputFormat, shuffleSecret, spilledRecordsCounter, taskCleanup, taskContext, tokenSecret, umbilical`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapTask()`
    `MapTask(String jobFile, TaskAttemptID taskId, int partition, JobSplit.TaskSplitIndex splitIndex, int numSlotsRequired)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.hadoop.util.Progress` | `getSortPhase()`
    `boolean` | `isMapTask()`
    `void` | `localizeConfiguration(JobConf conf)` Localize the given JobConf to be specific for this task.
    `void` | `readFields(DataInput in)`
    `void` | `run(JobConf job, TaskUmbilicalProtocol umbilical)` Run this task as a part of the named job.
    `void` | `write(DataOutput out)`

    - ### Methods inherited from class org.apache.hadoop.mapred.Task

      `createReduceContext, done, getConf, getEncryptedSpillKey, getFileSystemCounterNames, getFsStatistics, getJobFile, getJobID, getJobTokenSecret, getMapOutputFile, getNumSlotsRequired, getPartition, getPhase, getProgress, getShuffleSecret, getSkipRanges, getTaskID, initialize, isSkipping, keepTaskFiles, normalizeStatus, reportFatalError, reportNextRecordRange, runJobCleanupTask, runJobSetupTask, runTaskCleanupTask, setConf, setEncryptedSpillKey, setJobFile, setJobTokenSecret, setPhase, setShuffleSecret, setSkipping, setSkipRanges, setWriteSkipRecs, statusUpdate, toString, toWriteSkipRecs`

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

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

- - ### Field Detail

    - #### MAP_OUTPUT_INDEX_RECORD_LENGTH

          public static final int MAP_OUTPUT_INDEX_RECORD_LENGTH

      The size of each record in the index file for the map-outputs.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MapTask

          public MapTask()

    - #### MapTask

          public MapTask(String jobFile,
                         TaskAttemptID taskId,
                         int partition,
                         JobSplit.TaskSplitIndex splitIndex,
                         int numSlotsRequired)

  - ### Method Detail

    - #### isMapTask

          public boolean isMapTask()

      Specified by:
        `isMapTask` in class `Task`

    - #### localizeConfiguration

          public void localizeConfiguration(JobConf conf)
                                     throws IOException

      Description copied from class: `Task`
      Localize the given JobConf to be specific for this task.
      Overrides:
        `localizeConfiguration` in class `Task`
      Throws:
        `IOException`

    - #### write

          public void write(DataOutput out)
                     throws IOException

      Specified by:
        `write` in interface `org.apache.hadoop.io.Writable`
      Overrides:
        `write` in class `Task`
      Throws:
        `IOException`

    - #### readFields

          public void readFields(DataInput in)
                          throws IOException

      Specified by:
        `readFields` in interface `org.apache.hadoop.io.Writable`
      Overrides:
        `readFields` in class `Task`
      Throws:
        `IOException`

    - #### run

          public void run(JobConf job,
                          TaskUmbilicalProtocol umbilical)
                   throws IOException,
                          ClassNotFoundException,
                          InterruptedException

      Description copied from class: `Task`
      Run this task as a part of the named job. This method is executed in the child process and is what invokes user-supplied map, reduce, etc. methods.
      Specified by:
        `run` in class `Task`
        `umbilical` - for progress reports
      Throws:
        `IOException`
        `ClassNotFoundException`
        `InterruptedException`

    - #### getSortPhase

          public org.apache.hadoop.util.Progress getSortPhase()

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.