## org.apache.hadoop.mapreduce.server.jobtracker
Class TaskTracker

    java.lang.Object
      org.apache.hadoop.mapreduce.server.jobtracker.TaskTracker

    public class TaskTracker

extends Object

The representation of a single `TaskTracker` as seen by the `JobTracker`.

Constructor Summary
`TaskTracker(String trackerName)` Create a new `TaskTracker`.

Method Summary
`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`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TaskTracker

    public TaskTracker(String trackerName)

  Create a new `TaskTracker`.

  Parameters:
    `trackerName` - Unique identifier for the `TaskTracker`

Method Detail

### getTrackerName

    public String getTrackerName()

  Get the unique identifier for the `TaskTracker`

  Returns:
    the unique identifier for the `TaskTracker`

### getStatus

    public TaskTrackerStatus getStatus()

  Get the current `TaskTrackerStatus` of the `TaskTracker`.

  Returns:
    the current `TaskTrackerStatus` of the `TaskTracker`

### setStatus

    public void setStatus(TaskTrackerStatus status)

  Set the current `TaskTrackerStatus` of the `TaskTracker`.

  Parameters:
    `status` - the current `TaskTrackerStatus` of the `TaskTracker`

### getAvailableSlots

    public int getAvailableSlots(TaskType taskType)

  Get the number of currently available slots on this tasktracker for the given type of the task.

  Parameters:
    `taskType` - the `TaskType` to check for number of available slots
  Returns:
    the number of currently available slots for the given `taskType`

### getJobForFallowSlot

    public JobInProgress getJobForFallowSlot(TaskType taskType)

  Get the `JobInProgress` for which the fallow slot(s) are held.

  Parameters:
    `taskType` - `TaskType` of the task
  Returns:
    the task for which the fallow slot(s) are held, `null` if there are no fallow slots

### reserveSlots

    public void reserveSlots(TaskType taskType,
                             JobInProgress job,
                             int numSlots)

  Reserve specified number of slots for a given `job`.

  Parameters:
    `taskType` - `TaskType` of the task
    `job` - the job for which slots on this `TaskTracker` are to be reserved
    `numSlots` - number of slots to be reserved

### unreserveSlots

    public void unreserveSlots(TaskType taskType,
                               JobInProgress job)

  Free map slots on this `TaskTracker` which were reserved for `taskType`.

  Parameters:
    `taskType` - `TaskType` of the task
    `job` - job whose slots are being un-reserved

### cancelAllReservations

    public void cancelAllReservations()

  Cleanup when the `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