org.apache.hadoop.mapreduce.task
Class TaskAttemptContextImpl

java.lang.Object
  extended by org.apache.hadoop.mapreduce.task.JobContextImpl
      extended by org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl
All Implemented Interfaces:
JobContext, TaskAttemptContext, org.apache.hadoop.util.Progressable
Direct Known Subclasses:
TaskAttemptContextImpl, TaskInputOutputContextImpl

public class TaskAttemptContextImpl
extends JobContextImpl
implements TaskAttemptContext

The context for task attempts.


Nested Class Summary
static class TaskAttemptContextImpl.DummyReporter
           
 
Field Summary
 
Fields inherited from class org.apache.hadoop.mapreduce.task.JobContextImpl
conf, credentials, ugi
 
Fields inherited from interface org.apache.hadoop.mapreduce.JobContext
CACHE_ARCHIVES_VISIBILITIES, CACHE_FILE_VISIBILITIES, COMBINE_CLASS_ATTR, INPUT_FORMAT_CLASS_ATTR, JAR_UNPACK_PATTERN, JOB_ACL_MODIFY_JOB, JOB_ACL_VIEW_JOB, JOB_CANCEL_DELEGATION_TOKEN, JOB_NAMENODES, MAP_CLASS_ATTR, MAP_MEMORY_PHYSICAL_MB, MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MAPREDUCE_TASK_CLASSPATH_PRECEDENCE, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR, REDUCE_MEMORY_PHYSICAL_MB, SHUFFLE_CONSUMER_PLUGIN_ATTR, USER_LOG_RETAIN_HOURS
 
Constructor Summary
TaskAttemptContextImpl(org.apache.hadoop.conf.Configuration conf, TaskAttemptID taskId)
           
TaskAttemptContextImpl(org.apache.hadoop.conf.Configuration conf, TaskAttemptID taskId, StatusReporter reporter)
           
 
Method Summary
 Counter getCounter(java.lang.Enum<?> counterName)
          Get the Counter for the given counterName.
 Counter getCounter(java.lang.String groupName, java.lang.String counterName)
          Get the Counter for the given groupName and counterName.
 java.lang.String getStatus()
          Get the last set status message.
 TaskAttemptID getTaskAttemptID()
          Get the unique name for this task attempt.
 void progress()
          Report progress.
 void setStatus(java.lang.String status)
          Set the current status of the task to the given string.
protected  void setStatusString(java.lang.String status)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.task.JobContextImpl
getArchiveClassPaths, getArchiveTimestamps, getCacheArchives, getCacheFiles, getCombinerClass, getCombinerKeyGroupingComparator, getConfiguration, getCredentials, getFileClassPaths, getFileTimestamps, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getJobSetupCleanupNeeded, getLocalCacheArchives, getLocalCacheFiles, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getMaxMapAttempts, getMaxReduceAttempts, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getProfileEnabled, getProfileParams, getProfileTaskRange, getReducerClass, getSortComparator, getSymlink, getUser, getWorkingDirectory, setJobID, userClassesTakesPrecedence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapreduce.JobContext
getArchiveClassPaths, getArchiveTimestamps, getCacheArchives, getCacheFiles, getCombinerClass, getCombinerKeyGroupingComparator, getConfiguration, getCredentials, getFileClassPaths, getFileTimestamps, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getJobSetupCleanupNeeded, getLocalCacheArchives, getLocalCacheFiles, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getMaxMapAttempts, getMaxReduceAttempts, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getProfileEnabled, getProfileParams, getReducerClass, getSortComparator, getSymlink, getUser, getWorkingDirectory, userClassesTakesPrecedence
 

Constructor Detail

TaskAttemptContextImpl

public TaskAttemptContextImpl(org.apache.hadoop.conf.Configuration conf,
                              TaskAttemptID taskId)

TaskAttemptContextImpl

public TaskAttemptContextImpl(org.apache.hadoop.conf.Configuration conf,
                              TaskAttemptID taskId,
                              StatusReporter reporter)
Method Detail

getTaskAttemptID

public TaskAttemptID getTaskAttemptID()
Get the unique name for this task attempt.

Specified by:
getTaskAttemptID in interface TaskAttemptContext

getStatus

public java.lang.String getStatus()
Get the last set status message.

Specified by:
getStatus in interface TaskAttemptContext
Returns:
the current status message

getCounter

public Counter getCounter(java.lang.Enum<?> counterName)
Description copied from interface: TaskAttemptContext
Get the Counter for the given counterName.

Specified by:
getCounter in interface TaskAttemptContext
Parameters:
counterName - counter name
Returns:
the Counter for the given counterName

getCounter

public Counter getCounter(java.lang.String groupName,
                          java.lang.String counterName)
Description copied from interface: TaskAttemptContext
Get the Counter for the given groupName and counterName.

Specified by:
getCounter in interface TaskAttemptContext
counterName - counter name
Returns:
the Counter for the given groupName and counterName

progress

public void progress()
Report progress.

Specified by:
progress in interface org.apache.hadoop.util.Progressable

setStatusString

protected void setStatusString(java.lang.String status)

setStatus

public void setStatus(java.lang.String status)
Set the current status of the task to the given string.

Specified by:
setStatus in interface TaskAttemptContext


Copyright © 2009 The Apache Software Foundation