org.apache.hadoop.mapreduce.v2.app.job.impl
Class TaskImpl
java.lang.Object
org.apache.hadoop.mapreduce.v2.app.job.impl.TaskImpl
- All Implemented Interfaces:
- Task, org.apache.hadoop.yarn.event.EventHandler<TaskEvent>
- Direct Known Subclasses:
- MapTaskImpl, ReduceTaskImpl
public abstract class TaskImpl
- extends Object
- implements Task, org.apache.hadoop.yarn.event.EventHandler<TaskEvent>
Implementation of Task interface.
|
Constructor Summary |
TaskImpl(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId,
org.apache.hadoop.mapreduce.v2.api.records.TaskType taskType,
int partition,
org.apache.hadoop.yarn.event.EventHandler eventHandler,
org.apache.hadoop.fs.Path remoteJobConfFile,
org.apache.hadoop.mapred.JobConf conf,
TaskAttemptListener taskAttemptListener,
org.apache.hadoop.mapreduce.OutputCommitter committer,
org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier> jobToken,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.yarn.Clock clock,
Map<org.apache.hadoop.mapreduce.v2.api.records.TaskId,org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskInfo> completedTasksFromPreviousRun,
int startCount,
MRAppMetrics metrics,
AppContext appContext)
|
| 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.v2.app.job.Task |
getType |
conf
protected final org.apache.hadoop.mapred.JobConf conf
jobFile
protected final org.apache.hadoop.fs.Path jobFile
committer
protected final org.apache.hadoop.mapreduce.OutputCommitter committer
partition
protected final int partition
taskAttemptListener
protected final TaskAttemptListener taskAttemptListener
eventHandler
protected final org.apache.hadoop.yarn.event.EventHandler eventHandler
clock
protected final org.apache.hadoop.yarn.Clock clock
appContext
protected final AppContext appContext
credentials
protected org.apache.hadoop.security.Credentials credentials
jobToken
protected org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier> jobToken
nextAttemptNumber
protected int nextAttemptNumber
TaskImpl
public TaskImpl(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId,
org.apache.hadoop.mapreduce.v2.api.records.TaskType taskType,
int partition,
org.apache.hadoop.yarn.event.EventHandler eventHandler,
org.apache.hadoop.fs.Path remoteJobConfFile,
org.apache.hadoop.mapred.JobConf conf,
TaskAttemptListener taskAttemptListener,
org.apache.hadoop.mapreduce.OutputCommitter committer,
org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier> jobToken,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.yarn.Clock clock,
Map<org.apache.hadoop.mapreduce.v2.api.records.TaskId,org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskInfo> completedTasksFromPreviousRun,
int startCount,
MRAppMetrics metrics,
AppContext appContext)
getState
public org.apache.hadoop.mapreduce.v2.api.records.TaskState getState()
- Specified by:
getState in interface Task
getAttempts
public Map<org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId,TaskAttempt> getAttempts()
- Specified by:
getAttempts in interface Task
getAttempt
public TaskAttempt getAttempt(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
- Specified by:
getAttempt in interface Task
getID
public org.apache.hadoop.mapreduce.v2.api.records.TaskId getID()
- Specified by:
getID in interface Task
isFinished
public boolean isFinished()
- Description copied from interface:
Task
- Has Task reached the final state or not.
- Specified by:
isFinished in interface Task
getReport
public org.apache.hadoop.mapreduce.v2.api.records.TaskReport getReport()
- Specified by:
getReport in interface Task
getCounters
public org.apache.hadoop.mapreduce.Counters getCounters()
- Specified by:
getCounters in interface Task
getProgress
public float getProgress()
- Specified by:
getProgress in interface Task
canCommit
public boolean canCommit(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId taskAttemptID)
- Description copied from interface:
Task
- Can the output of the taskAttempt be committed. Note that once the task
gives a go for a commit, further canCommit requests from any other attempts
should return false.
- Specified by:
canCommit in interface Task
- Returns:
- whether the attempt's output can be committed or not.
createAttempt
protected abstract TaskAttemptImpl createAttempt()
getMaxAttempts
protected abstract int getMaxAttempts()
getSuccessfulAttempt
protected TaskAttempt getSuccessfulAttempt()
handle
public void handle(TaskEvent event)
- Specified by:
handle in interface org.apache.hadoop.yarn.event.EventHandler<TaskEvent>
internalError
protected void internalError(TaskEventType type)
getSplitsAsString
protected String getSplitsAsString()
- Returns:
- a String representation of the splits.
Subclasses can override this method to provide their own representations
of splits (if any).
Copyright © 2012 Apache Software Foundation. All Rights Reserved.