org.apache.hadoop.mapred
Class TaskTrackerStatus

java.lang.Object
  extended by org.apache.hadoop.mapred.TaskTrackerStatus
All Implemented Interfaces:
Writable

public class TaskTrackerStatus
extends Object
implements Writable

A TaskTrackerStatus is a MapReduce primitive. Keeps info on a TaskTracker. The JobTracker maintains a set of the most recent TaskTrackerStatus objects for each unique TaskTracker it knows about. This is NOT a public interface!


Field Summary
static org.apache.commons.logging.Log LOG
           
static int UNAVAILABLE
           
 
Constructor Summary
TaskTrackerStatus()
           
TaskTrackerStatus(String trackerName, String host, int httpPort, List<TaskStatus> taskReports, int taskFailures, int dirFailures, int maxMapTasks, int maxReduceTasks)
           
 
Method Summary
 int countMapTasks()
          Get the number of running map tasks.
 int countOccupiedMapSlots()
          Get the number of occupied map slots.
 int countOccupiedReduceSlots()
          Get the number of occupied reduce slots.
 int countReduceTasks()
          Get the number of running reduce tasks.
 int getAvailableMapSlots()
          Get available map slots.
 int getAvailableReduceSlots()
          Get available reduce slots.
 int getDirFailures()
          Get the number of local directories that have failed on this tracker.
 org.apache.hadoop.mapred.TaskTrackerStatus.TaskTrackerHealthStatus getHealthStatus()
          Returns health status of the task tracker.
 String getHost()
           
 int getHttpPort()
          Get the port that this task tracker is serving http requests on.
 long getLastSeen()
           
 int getMaxMapSlots()
          Get the maximum map slots for this node.
 int getMaxReduceSlots()
          Get the maximum reduce slots for this node.
 int getTaskFailures()
          Get the number of tasks that have failed on this tracker.
 List<TaskStatus> getTaskReports()
          Get the current tasks at the TaskTracker.
 String getTrackerName()
           
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 void setLastSeen(long lastSeen)
           
 void write(DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

UNAVAILABLE

public static final int UNAVAILABLE
See Also:
Constant Field Values
Constructor Detail

TaskTrackerStatus

public TaskTrackerStatus()

TaskTrackerStatus

public TaskTrackerStatus(String trackerName,
                         String host,
                         int httpPort,
                         List<TaskStatus> taskReports,
                         int taskFailures,
                         int dirFailures,
                         int maxMapTasks,
                         int maxReduceTasks)
Method Detail

getTrackerName

public String getTrackerName()

getHost

public String getHost()

getHttpPort

public int getHttpPort()
Get the port that this task tracker is serving http requests on.

Returns:
the http port

getTaskFailures

public int getTaskFailures()
Get the number of tasks that have failed on this tracker.

Returns:
The number of failed tasks

getDirFailures

public int getDirFailures()
Get the number of local directories that have failed on this tracker.

Returns:
The number of failed local directories

getTaskReports

public List<TaskStatus> getTaskReports()
Get the current tasks at the TaskTracker. Tasks are tracked by a TaskStatus object.

Returns:
a list of TaskStatus representing the current tasks at the TaskTracker.

countMapTasks

public int countMapTasks()
Get the number of running map tasks.

Returns:
the number of running map tasks

countOccupiedMapSlots

public int countOccupiedMapSlots()
Get the number of occupied map slots.

Returns:
the number of occupied map slots

getAvailableMapSlots

public int getAvailableMapSlots()
Get available map slots.

Returns:
available map slots

countReduceTasks

public int countReduceTasks()
Get the number of running reduce tasks.

Returns:
the number of running reduce tasks

countOccupiedReduceSlots

public int countOccupiedReduceSlots()
Get the number of occupied reduce slots.

Returns:
the number of occupied reduce slots

getAvailableReduceSlots

public int getAvailableReduceSlots()
Get available reduce slots.

Returns:
available reduce slots

getLastSeen

public long getLastSeen()

setLastSeen

public void setLastSeen(long lastSeen)

getMaxMapSlots

public int getMaxMapSlots()
Get the maximum map slots for this node.

Returns:
the maximum map slots for this node

getMaxReduceSlots

public int getMaxReduceSlots()
Get the maximum reduce slots for this node.

Returns:
the maximum reduce slots for this node

getHealthStatus

public org.apache.hadoop.mapred.TaskTrackerStatus.TaskTrackerHealthStatus getHealthStatus()
Returns health status of the task tracker.

Returns:
health status of Task Tracker

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Serialize the fields of this object to out.

Specified by:
write in interface Writable
Parameters:
out - DataOuput to serialize this object into.
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Deserialize the fields of this object from in.

For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
IOException


Copyright © 2009 The Apache Software Foundation