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.


Nested Class Summary
static class TaskTrackerStatus.ResourceStatus
          Class representing a collection of resources on this tasktracker.
 
Constructor Summary
TaskTrackerStatus()
           
TaskTrackerStatus(String trackerName, String host, int httpPort, List<TaskStatus> taskReports, int failures, int maxMapTasks, int maxReduceTasks)
           
 
Method Summary
 int countMapTasks()
          Return the current MapTask count
 int countReduceTasks()
          Return the current ReduceTask count
 int getFailures()
          Get the number of tasks that have failed on this tracker.
 String getHost()
           
 int getHttpPort()
          Get the port that this task tracker is serving http requests on.
 long getLastSeen()
           
 int getMaxMapTasks()
          Get the maximum concurrent tasks for this node.
 int getMaxReduceTasks()
           
 TaskTrackerStatus.ResourceStatus getResourceStatus()
          Return the TaskTrackerStatus.ResourceStatus object configured with this status.
 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
 

Constructor Detail

TaskTrackerStatus

public TaskTrackerStatus()

TaskTrackerStatus

public TaskTrackerStatus(String trackerName,
                         String host,
                         int httpPort,
                         List<TaskStatus> taskReports,
                         int failures,
                         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

getFailures

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

Returns:
The number of failed tasks

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()
Return the current MapTask count


countReduceTasks

public int countReduceTasks()
Return the current ReduceTask count


getLastSeen

public long getLastSeen()

setLastSeen

public void setLastSeen(long lastSeen)

getMaxMapTasks

public int getMaxMapTasks()
Get the maximum concurrent tasks for this node. (This applies per type of task - a node with maxTasks==1 will run up to 1 map and 1 reduce concurrently).

Returns:
maximum tasks this node supports

getMaxReduceTasks

public int getMaxReduceTasks()

getResourceStatus

public TaskTrackerStatus.ResourceStatus getResourceStatus()
Return the TaskTrackerStatus.ResourceStatus object configured with this status.

Returns:
the resource status

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