Package org.apache.hadoop.mapreduce
Class ClusterMetrics
java.lang.Object
org.apache.hadoop.mapreduce.ClusterMetrics
- All Implemented Interfaces:
Writable
Status information on the current state of the Map-Reduce cluster.
ClusterMetrics provides clients with information such as:
- Size of the cluster.
- Number of blacklisted and decommissioned trackers.
- Slot capacity of the cluster.
- The number of currently occupied/reserved map and reduce slots.
- The number of currently running map and reduce tasks.
- The number of job submissions.
Clients can query for the latest ClusterMetrics, via
Cluster.getClusterStatus().
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClusterMetrics(int runningMaps, int runningReduces, int occupiedMapSlots, int occupiedReduceSlots, int reservedMapSlots, int reservedReduceSlots, int mapSlots, int reduceSlots, int totalJobSubmissions, int numTrackers, int numBlacklistedTrackers, int numDecommissionedNodes) ClusterMetrics(int runningMaps, int runningReduces, int occupiedMapSlots, int occupiedReduceSlots, int reservedMapSlots, int reservedReduceSlots, int mapSlots, int reduceSlots, int totalJobSubmissions, int numTrackers, int numBlacklistedTrackers, int numGraylistedTrackers, int numDecommissionedNodes) -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of blacklisted trackers in the cluster.intGet the number of decommissioned trackers in the cluster.intGet the number of graylisted trackers in the cluster.intGet the total number of map slots in the cluster.intGet number of occupied map slots in the cluster.intGet the number of occupied reduce slots in the cluster.intGet the total number of reduce slots in the cluster.intGet number of reserved map slots in the cluster.intGet the number of reserved reduce slots in the cluster.intGet the number of running map tasks in the cluster.intGet the number of running reduce tasks in the cluster.intGet the number of active trackers in the cluster.intGet the total number of job submissions in the cluster.voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
ClusterMetrics
public ClusterMetrics() -
ClusterMetrics
public ClusterMetrics(int runningMaps, int runningReduces, int occupiedMapSlots, int occupiedReduceSlots, int reservedMapSlots, int reservedReduceSlots, int mapSlots, int reduceSlots, int totalJobSubmissions, int numTrackers, int numBlacklistedTrackers, int numDecommissionedNodes) -
ClusterMetrics
public ClusterMetrics(int runningMaps, int runningReduces, int occupiedMapSlots, int occupiedReduceSlots, int reservedMapSlots, int reservedReduceSlots, int mapSlots, int reduceSlots, int totalJobSubmissions, int numTrackers, int numBlacklistedTrackers, int numGraylistedTrackers, int numDecommissionedNodes)
-
-
Method Details
-
getRunningMaps
public int getRunningMaps()Get the number of running map tasks in the cluster.- Returns:
- running maps
-
getRunningReduces
public int getRunningReduces()Get the number of running reduce tasks in the cluster.- Returns:
- running reduces
-
getOccupiedMapSlots
public int getOccupiedMapSlots()Get number of occupied map slots in the cluster.- Returns:
- occupied map slot count
-
getOccupiedReduceSlots
public int getOccupiedReduceSlots()Get the number of occupied reduce slots in the cluster.- Returns:
- occupied reduce slot count
-
getReservedMapSlots
public int getReservedMapSlots()Get number of reserved map slots in the cluster.- Returns:
- reserved map slot count
-
getReservedReduceSlots
public int getReservedReduceSlots()Get the number of reserved reduce slots in the cluster.- Returns:
- reserved reduce slot count
-
getMapSlotCapacity
public int getMapSlotCapacity()Get the total number of map slots in the cluster.- Returns:
- map slot capacity
-
getReduceSlotCapacity
public int getReduceSlotCapacity()Get the total number of reduce slots in the cluster.- Returns:
- reduce slot capacity
-
getTotalJobSubmissions
public int getTotalJobSubmissions()Get the total number of job submissions in the cluster.- Returns:
- total number of job submissions
-
getTaskTrackerCount
public int getTaskTrackerCount()Get the number of active trackers in the cluster.- Returns:
- active tracker count.
-
getBlackListedTaskTrackerCount
public int getBlackListedTaskTrackerCount()Get the number of blacklisted trackers in the cluster.- Returns:
- blacklisted tracker count
-
getGrayListedTaskTrackerCount
public int getGrayListedTaskTrackerCount()Get the number of graylisted trackers in the cluster.- Returns:
- graylisted tracker count
-
getDecommissionedTaskTrackerCount
public int getDecommissionedTaskTrackerCount()Get the number of decommissioned trackers in the cluster.- Returns:
- decommissioned tracker count
-
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.
-
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.
-