org.apache.hadoop.mapred
Class ReduceTask

java.lang.Object
  extended by org.apache.hadoop.mapred.Task
      extended by org.apache.hadoop.mapred.ReduceTask
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class ReduceTask
extends Task

A Reduce task.


Nested Class Summary
 
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 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, PROGRESS_INTERVAL, shuffleSecret, spilledRecordsCounter, taskCleanup, taskContext, tokenSecret, umbilical
 
Constructor Summary
ReduceTask()
           
ReduceTask(String jobFile, TaskAttemptID taskId, int partition, int numMaps, int numSlotsRequired)
           
 
Method Summary
 int getNumMaps()
           
 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, getFileSystemCounterNames, getFsStatistics, getJobFile, getJobID, getJobTokenSecret, getMapOutputFile, getNumSlotsRequired, getPartition, getPhase, getProgress, getShuffleSecret, getSkipRanges, getTaskID, initialize, isSkipping, keepTaskFiles, normalizeStatus, reportFatalError, reportNextRecordRange, runJobCleanupTask, runJobSetupTask, runTaskCleanupTask, setConf, 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
 

Constructor Detail

ReduceTask

public ReduceTask()

ReduceTask

public ReduceTask(String jobFile,
                  TaskAttemptID taskId,
                  int partition,
                  int numMaps,
                  int numSlotsRequired)
Method Detail

isMapTask

public boolean isMapTask()
Specified by:
isMapTask in class Task

getNumMaps

public int getNumMaps()

localizeConfiguration

public void localizeConfiguration(JobConf conf)
                           throws IOException
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,
                InterruptedException,
                ClassNotFoundException
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
InterruptedException
ClassNotFoundException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.