|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.mapred.TaskInProgress
public class TaskInProgress
TaskInProgress maintains all the info needed for a
Task in the lifetime of its owning Job. A given Task
might be speculatively executed or reexecuted, so we
need a level of indirection above the running-id itself.
A given TaskInProgress contains multiple taskids,
0 or more of which might be executing at any one time.
(That's what allows speculative execution.) A taskid
is now *never* recycled. A TIP allocates enough taskids
to account for all the speculation and failures it will
ever have to handle. Once those are up, the TIP is dead.
**************************************************************
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
TaskInProgress(JobID jobid,
String jobFile,
int numMaps,
int partition,
JobTracker jobtracker,
JobConf conf,
JobInProgress job,
int numSlotsRequired)
Constructor for ReduceTask |
|
TaskInProgress(JobID jobid,
String jobFile,
JobSplit.TaskSplitMetaInfo split,
JobTracker jobtracker,
JobConf conf,
JobInProgress job,
int partition,
int numSlotsRequired)
Constructor for MapTask |
Method Summary | |
---|---|
void |
addDiagnosticInfo(TaskAttemptID taskId,
String diagInfo)
Save diagnostic information for a given task. |
Task |
addRunningTask(TaskAttemptID taskid,
String taskTracker)
|
Task |
addRunningTask(TaskAttemptID taskid,
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 |
List<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 |
String[] |
getSplitLocations()
Get the split locations |
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(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(String trackerHost)
Has this task already failed on this machine? |
boolean |
hasRunOnMachine(String trackerHost,
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? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public TaskInProgress(JobID jobid, String jobFile, JobSplit.TaskSplitMetaInfo split, JobTracker jobtracker, JobConf conf, JobInProgress job, int partition, int numSlotsRequired)
public TaskInProgress(JobID jobid, String jobFile, int numMaps, int partition, JobTracker jobtracker, JobConf conf, JobInProgress job, int numSlotsRequired)
Method Detail |
---|
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 completion
true
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 List<String> getDiagnosticInfo(TaskAttemptID taskId)
taskId
- the id of the required task
public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo)
taskId
- id of the taskdiagInfo
- diagnostic information for the taskpublic void incompleteSubTask(TaskAttemptID taskid, JobStatus jobStatus)
public void completed(TaskAttemptID taskid)
public String[] getSplitLocations()
public TaskStatus[] getTaskStatuses()
public TaskStatus getTaskStatus(TaskAttemptID taskid)
taskid
- public void kill()
public boolean wasKilled()
public Task getTaskToRun(String taskTracker) throws IOException
IOException
public Task addRunningTask(TaskAttemptID taskid, String taskTracker)
public Task addRunningTask(TaskAttemptID taskid, String taskTracker, boolean taskCleanup)
public boolean hasFailedOnMachine(String trackerHost)
trackerHost
- The task tracker hostname
public boolean hasRunOnMachine(String trackerHost, String trackerName)
trackerHost
- The task tracker hostnametrackerName
- The tracker name
public int getNumberOfFailedMachines()
public int getIdWithinJob()
public void setSuccessEventNumber(int eventNumber)
public int getSuccessEventNumber()
public String getSplitNodes()
public long getMapInputSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |