@InterfaceAudience.Private
public class TaskInProgress
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
TaskInProgress(JobID jobid,
java.lang.String jobFile,
int numMaps,
int partition,
JobTracker jobtracker,
JobConf conf,
JobInProgress job,
int numSlotsRequired)
Constructor for ReduceTask
|
TaskInProgress(JobID jobid,
java.lang.String jobFile,
JobSplit.TaskSplitMetaInfo split,
JobTracker jobtracker,
JobConf conf,
JobInProgress job,
int partition,
int numSlotsRequired)
Constructor for MapTask
|
Modifier and Type | Method and Description |
---|---|
void |
addDiagnosticInfo(TaskAttemptID taskId,
java.lang.String diagInfo)
Save diagnostic information for a given task.
|
Task |
addRunningTask(TaskAttemptID taskid,
java.lang.String taskTracker) |
Task |
addRunningTask(TaskAttemptID taskid,
java.lang.String taskTracker,
boolean taskCleanup)
Adds a previously running task to this tip.
|
void |
completed(TaskAttemptID taskid)
Indicate that one of the taskids in this TaskInProgress
has successfully completed!
|
void |
doCommit(TaskAttemptID taskid)
Commit this task attempt for the tip.
|
TaskReport |
generateSingleReport()
Creates a "status report" for this task.
|
Counters |
getCounters()
Get the task's counters
|
java.util.List<java.lang.String> |
getDiagnosticInfo(TaskAttemptID taskId)
Get the diagnostic messages for a given task within this tip.
|
long |
getExecFinishTime()
Return the exec finish time
|
long |
getExecStartTime()
Return the exec start time
|
int |
getIdWithinJob()
Get the id of this map or reduce task.
|
JobInProgress |
getJob()
Return the parent job
|
long |
getMapInputSize() |
int |
getNumberOfFailedMachines()
Get the number of machines where this task has failed.
|
double |
getProgress()
Get the overall progress (from 0 to 1.0) for this TIP
|
java.lang.String[] |
getSplitLocations()
Get the split locations
|
java.lang.String |
getSplitNodes()
Gets the Node list of input split locations sorted in rack order.
|
long |
getStartTime()
Return the start time
|
int |
getSuccessEventNumber()
Get the event number that was raised for this tip
|
TaskStatus |
getTaskStatus(TaskAttemptID taskid)
Get the status of the specified task
|
TaskStatus[] |
getTaskStatuses()
Get the Status of the tasks managed by this TIP
|
Task |
getTaskToRun(java.lang.String taskTracker)
Return a Task that can be sent to a TaskTracker for execution.
|
TaskID |
getTIPId()
Return an ID for this task, not its component taskid-threads
|
boolean |
hasFailedOnMachine(java.lang.String trackerHost)
Has this task already failed on this machine?
|
boolean |
hasRunOnMachine(java.lang.String trackerHost,
java.lang.String trackerName)
Was this task ever scheduled to run on this machine?
|
int |
idWithinJob()
Return the index of the tip within the job, so
"task_200707121733_1313_0002_m_012345" would return 12345;
|
void |
incompleteSubTask(TaskAttemptID taskid,
JobStatus jobStatus)
Indicate that one of the taskids in this TaskInProgress
has failed.
|
boolean |
isCommitPending(TaskAttemptID taskId) |
boolean |
isComplete()
Is this tip complete?
|
boolean |
isComplete(TaskAttemptID taskid)
Is the given taskid the one that took this tip to completion?
|
boolean |
isFailed()
Is the tip a failure?
|
boolean |
isFirstAttempt(TaskAttemptID taskId)
Is the Task associated with taskid is the first attempt of the tip?
|
boolean |
isJobCleanupTask() |
boolean |
isJobSetupTask() |
boolean |
isMapTask()
Whether this is a map task
|
boolean |
isOnlyCommitPending() |
boolean |
isRunning()
Is this tip currently running any tasks?
|
void |
kill()
The TIP's been ordered kill()ed.
|
int |
numKilledTasks()
Number of times the TaskInProgress has been killed by the framework.
|
int |
numTaskFailures()
Number of times the TaskInProgress has failed.
|
void |
setExecFinishTime(long finishTime)
Set the exec finish time
|
void |
setExecStartTime(long startTime)
Set the exec start time
|
void |
setJobCleanupTask() |
void |
setJobSetupTask() |
void |
setSuccessEventNumber(int eventNumber)
Set the event number that was raised for this tip
|
boolean |
shouldClose(TaskAttemptID taskid)
Returns whether a component task-thread should be
closed because the containing JobInProgress has completed
or the task is killed by the user
|
boolean |
shouldCommit(TaskAttemptID taskid)
Returns whether the task attempt should be committed or not
|
boolean |
wasKilled()
Was the task killed?
|
public TaskInProgress(JobID jobid, java.lang.String jobFile, JobSplit.TaskSplitMetaInfo split, JobTracker jobtracker, JobConf conf, JobInProgress job, int partition, int numSlotsRequired)
public TaskInProgress(JobID jobid, java.lang.String jobFile, int numMaps, int partition, JobTracker jobtracker, JobConf conf, JobInProgress job, int numSlotsRequired)
public int idWithinJob()
public boolean isJobCleanupTask()
public void setJobCleanupTask()
public boolean isJobSetupTask()
public void setJobSetupTask()
public boolean isOnlyCommitPending()
public boolean isCommitPending(TaskAttemptID taskId)
public long getStartTime()
public long getExecStartTime()
public void setExecStartTime(long startTime)
public long getExecFinishTime()
public void setExecFinishTime(long finishTime)
public JobInProgress getJob()
public TaskID getTIPId()
public boolean isMapTask()
public boolean isFirstAttempt(TaskAttemptID taskId)
taskId
- public boolean isRunning()
public boolean isComplete()
true
if the tip is complete, else false
public boolean isComplete(TaskAttemptID taskid)
taskid
- taskid of attempt to check for completiontrue
if taskid is complete, else false
public boolean isFailed()
true
if tip has failed, else false
public int numTaskFailures()
public int numKilledTasks()
public double getProgress()
public Counters getCounters()
public boolean shouldClose(TaskAttemptID taskid)
public void doCommit(TaskAttemptID taskid)
taskid
- public boolean shouldCommit(TaskAttemptID taskid)
public TaskReport generateSingleReport()
public java.util.List<java.lang.String> getDiagnosticInfo(TaskAttemptID taskId)
taskId
- the id of the required taskpublic void addDiagnosticInfo(TaskAttemptID taskId, java.lang.String diagInfo)
taskId
- id of the taskdiagInfo
- diagnostic information for the taskpublic void incompleteSubTask(TaskAttemptID taskid, JobStatus jobStatus)
public void completed(TaskAttemptID taskid)
public java.lang.String[] getSplitLocations()
public TaskStatus[] getTaskStatuses()
public TaskStatus getTaskStatus(TaskAttemptID taskid)
taskid
- public void kill()
public boolean wasKilled()
public Task getTaskToRun(java.lang.String taskTracker) throws java.io.IOException
java.io.IOException
public Task addRunningTask(TaskAttemptID taskid, java.lang.String taskTracker)
public Task addRunningTask(TaskAttemptID taskid, java.lang.String taskTracker, boolean taskCleanup)
public boolean hasFailedOnMachine(java.lang.String trackerHost)
trackerHost
- The task tracker hostnamepublic boolean hasRunOnMachine(java.lang.String trackerHost, java.lang.String trackerName)
trackerHost
- The task tracker hostnametrackerName
- The tracker namepublic int getNumberOfFailedMachines()
public int getIdWithinJob()
public void setSuccessEventNumber(int eventNumber)
public int getSuccessEventNumber()
public java.lang.String getSplitNodes()
public long getMapInputSize()
Copyright © 2009 The Apache Software Foundation