public class TaskTracker extends Object
TaskTracker as seen by
the JobTracker.| 构造器和说明 |
|---|
TaskTracker(String trackerName)
Create a new
TaskTracker. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancelAllReservations()
Cleanup when the
TaskTracker is declared as 'lost/blacklisted'
by the JobTracker. |
int |
getAvailableSlots(TaskType taskType)
Get the number of currently available slots on this tasktracker for the
given type of the task.
|
JobInProgress |
getJobForFallowSlot(TaskType taskType)
Get the
JobInProgress for which the fallow slot(s) are held. |
TaskTrackerStatus |
getStatus()
Get the current
TaskTrackerStatus of the TaskTracker. |
String |
getTrackerName()
Get the unique identifier for the
TaskTracker |
void |
reserveSlots(TaskType taskType,
JobInProgress job,
int numSlots)
Reserve specified number of slots for a given
job. |
void |
setStatus(TaskTrackerStatus status)
Set the current
TaskTrackerStatus of the TaskTracker. |
void |
unreserveSlots(TaskType taskType,
JobInProgress job)
Free map slots on this
TaskTracker which were reserved for
taskType. |
public TaskTracker(String trackerName)
TaskTracker.trackerName - Unique identifier for the TaskTrackerpublic String getTrackerName()
TaskTrackerTaskTrackerpublic TaskTrackerStatus getStatus()
TaskTrackerStatus of the TaskTracker.TaskTrackerStatus of the
TaskTrackerpublic void setStatus(TaskTrackerStatus status)
TaskTrackerStatus of the TaskTracker.status - the current TaskTrackerStatus of the
TaskTrackerpublic int getAvailableSlots(TaskType taskType)
taskType - the TaskType to check for number of available slotstaskTypepublic JobInProgress getJobForFallowSlot(TaskType taskType)
JobInProgress for which the fallow slot(s) are held.taskType - TaskType of the tasknull if there are no fallow slotspublic void reserveSlots(TaskType taskType, JobInProgress job, int numSlots)
job.taskType - TaskType of the taskjob - the job for which slots on this TaskTracker
are to be reservednumSlots - number of slots to be reservedpublic void unreserveSlots(TaskType taskType, JobInProgress job)
TaskTracker which were reserved for
taskType.taskType - TaskType of the taskjob - job whose slots are being un-reservedpublic void cancelAllReservations()
TaskTracker is declared as 'lost/blacklisted'
by the JobTracker.
The method assumes that the lock on the JobTracker is obtained
by the caller.Copyright © 2009 The Apache Software Foundation