Package org.apache.hadoop.mapred
Class ClusterStatus
java.lang.Object
org.apache.hadoop.mapred.ClusterStatus
- All Implemented Interfaces:
Writable
Status information on the current state of the Map-Reduce cluster.
ClusterStatus provides clients with information such as:
- Size of the cluster.
- Name of the trackers.
- Task capacity of the cluster.
- The number of currently running map and reduce tasks.
-
State of the
JobTracker. - Details regarding black listed trackers.
Clients can query for the latest ClusterStatus, via
JobClient.getClusterStatus().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.mapred.ClusterStatus.BlackListInfoClass which encapsulates information about a blacklisted tasktracker. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet the names of task trackers in the cluster.Get the names of task trackers in the cluster.intGet the number of blacklisted task trackers in the cluster.Collection<org.apache.hadoop.mapred.ClusterStatus.BlackListInfo>Gets the list of blacklisted trackers along with reasons for blacklisting.Deprecated.intDeprecated.Deprecated.Get the JobTracker's status.intGet the number of currently running map tasks in the cluster.intGet the maximum capacity for running map tasks in the cluster.longDeprecated.intGet the maximum capacity for running reduce tasks in the cluster.intGet the number of excluded hosts in the cluster.intGet the number of currently running reduce tasks in the cluster.intGet the number of task trackers in the cluster.longGet the tasktracker expiry interval for the clusterlongDeprecated.voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Field Details
-
UNINITIALIZED_MEMORY_VALUE
public static final long UNINITIALIZED_MEMORY_VALUE- See Also:
-
-
Method Details
-
getTaskTrackers
public int getTaskTrackers()Get the number of task trackers in the cluster.- Returns:
- the number of task trackers in the cluster.
-
getActiveTrackerNames
Get the names of task trackers in the cluster.- Returns:
- the active task trackers in the cluster.
-
getBlacklistedTrackerNames
Get the names of task trackers in the cluster.- Returns:
- the blacklisted task trackers in the cluster.
-
getGraylistedTrackerNames
Deprecated.Get the names of graylisted task trackers in the cluster. The gray list of trackers is no longer available on M/R 2.x. The function is kept to be compatible with M/R 1.x applications.- Returns:
- an empty graylisted task trackers in the cluster.
-
getGraylistedTrackers
Deprecated.Get the number of graylisted task trackers in the cluster. The gray list of trackers is no longer available on M/R 2.x. The function is kept to be compatible with M/R 1.x applications.- Returns:
- 0 graylisted 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
Get the JobTracker's status.- Returns:
Cluster.JobTrackerStatusof the JobTracker
-
getMaxMemory
Deprecated.Returns UNINITIALIZED_MEMORY_VALUE (-1) -
getUsedMemory
Deprecated.Returns UNINITIALIZED_MEMORY_VALUE (-1) -
getBlackListedTrackersInfo
public Collection<org.apache.hadoop.mapred.ClusterStatus.BlackListInfo> getBlackListedTrackersInfo()Gets the list of blacklisted trackers along with reasons for blacklisting.- Returns:
- the collection of
ClusterStatus.BlackListInfoobjects.
-
getJobTrackerState
Deprecated.Get the current state of theJobTracker, asJobTracker.StateJobTracker.Stateshould no longer be used on M/R 2.x. The function is kept to be compatible with M/R 1.x applications.- Returns:
- the invalid state of the
JobTracker.
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-