org.apache.hadoop.mapred
Class ClusterStatus

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

@InterfaceAudience.Public
@InterfaceStability.Stable
public class ClusterStatus
extends Object
implements org.apache.hadoop.io.Writable

Status information on the current state of the Map-Reduce cluster.

ClusterStatus provides clients with information such as:

  1. Size of the cluster.
  2. Name of the trackers.
  3. Task capacity of the cluster.
  4. The number of currently running map & reduce tasks.
  5. State of the JobTracker.
  6. Details regarding black listed trackers.

Clients can query for the latest ClusterStatus, via JobClient.getClusterStatus().

See Also:
JobClient

Nested Class Summary
static class ClusterStatus.BlackListInfo
          Class which encapsulates information about a blacklisted tasktracker.
 
Method Summary
 Collection<String> getActiveTrackerNames()
          Get the names of task trackers in the cluster.
 Collection<String> getBlacklistedTrackerNames()
          Get the names of task trackers in the cluster.
 int getBlacklistedTrackers()
          Get the number of blacklisted task trackers in the cluster.
 Collection<ClusterStatus.BlackListInfo> getBlackListedTrackersInfo()
          Gets the list of blacklisted trackers along with reasons for blacklisting.
 Cluster.JobTrackerStatus getJobTrackerStatus()
          Get the JobTracker's status.
 int getMapTasks()
          Get the number of currently running map tasks in the cluster.
 int getMaxMapTasks()
          Get the maximum capacity for running map tasks in the cluster.
 int getMaxReduceTasks()
          Get the maximum capacity for running reduce tasks in the cluster.
 int getNumExcludedNodes()
          Get the number of excluded hosts in the cluster.
 int getReduceTasks()
          Get the number of currently running reduce tasks in the cluster.
 int getTaskTrackers()
          Get the number of task trackers in the cluster.
 long getTTExpiryInterval()
          Get the tasktracker expiry interval for the cluster
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTaskTrackers

public int getTaskTrackers()
Get the number of task trackers in the cluster.

Returns:
the number of task trackers in the cluster.

getActiveTrackerNames

public Collection<String> getActiveTrackerNames()
Get the names of task trackers in the cluster.

Returns:
the active task trackers in the cluster.

getBlacklistedTrackerNames

public Collection<String> getBlacklistedTrackerNames()
Get the names of task trackers in the cluster.

Returns:
the blacklisted task trackers in the cluster.

getBlacklistedTrackers

public int getBlacklistedTrackers()
Get the number of blacklisted task trackers in the cluster.

Returns:
the number of blacklisted task trackers in the cluster.

getNumExcludedNodes

public int getNumExcludedNodes()
Get the number of excluded hosts in the cluster.

Returns:
the number of excluded hosts in the cluster.

getTTExpiryInterval

public long getTTExpiryInterval()
Get the tasktracker expiry interval for the cluster

Returns:
the expiry interval in msec

getMapTasks

public int getMapTasks()
Get the number of currently running map tasks in the cluster.

Returns:
the number of currently running map tasks in the cluster.

getReduceTasks

public int getReduceTasks()
Get the number of currently running reduce tasks in the cluster.

Returns:
the number of currently running reduce tasks in the cluster.

getMaxMapTasks

public int getMaxMapTasks()
Get the maximum capacity for running map tasks in the cluster.

Returns:
the maximum capacity for running map tasks in the cluster.

getMaxReduceTasks

public int getMaxReduceTasks()
Get the maximum capacity for running reduce tasks in the cluster.

Returns:
the maximum capacity for running reduce tasks in the cluster.

getJobTrackerStatus

public Cluster.JobTrackerStatus getJobTrackerStatus()
Get the JobTracker's status.

Returns:
Cluster.JobTrackerStatus of the JobTracker

getBlackListedTrackersInfo

public Collection<ClusterStatus.BlackListInfo> getBlackListedTrackersInfo()
Gets the list of blacklisted trackers along with reasons for blacklisting.

Returns:
the collection of ClusterStatus.BlackListInfo objects.

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2012 Apache Software Foundation. All Rights Reserved.