Package org.apache.hadoop.hbase
Interface ClusterMetrics
- All Known Implementing Classes:
ClusterMetricsBuilder.ClusterMetricsImpl
Metrics information on the HBase cluster.
ClusterMetrics provides clients with information such as:
- The count and names of region servers in the cluster.
- The count and names of dead region servers in the cluster.
- The name of the active master for the cluster.
- The name(s) of the backup master(s) for the cluster, if they exist.
- The average cluster load.
- The number of regions deployed on the cluster.
- The number of requests since last report.
- Detailed region server loading and resource usage information, per server and per region.
- Regions in transition at master
- The unique cluster ID
ClusterMetrics.Option
provides a way to get desired ClusterStatus information. The following
codes will get all the cluster information.
{ @code // Original version still works Admin admin = connection.getAdmin(); ClusterMetrics metrics = admin.getClusterStatus(); // or below, a new version which has the same effects ClusterMetrics metrics = admin.getClusterStatus(EnumSet.allOf(Option.class)); }If information about live servers is the only wanted. then codes in the following way:
{ @code Admin admin = connection.getAdmin(); ClusterMetrics metrics = admin.getClusterStatus(EnumSet.of(Option.LIVE_SERVERS)); }
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault double
Returns the average cluster loadReturns the names of backup mastersReturns the names of region servers on the dead listReturns the names of region servers on the decommissioned listReturns the HBase version string as reported by the HMasterdefault long
getLastMajorCompactionTimestamp
(byte[] regionName) default long
Returns the names of region servers on the live listint
Returns detailed information about the current masterServerName
.Provide the list of master tasksdefault int
Returns the number of regions deployed on the clusterdefault long
Returns the number of requests since last reportProvide region states count for given table.Returns the names of region servers on the unknown list
-
Method Details
-
getHBaseVersion
Returns the HBase version string as reported by the HMaster -
getDeadServerNames
Returns the names of region servers on the dead list -
getUnknownServerNames
Returns the names of region servers on the unknown list -
getDecommissionedServerNames
Returns the names of region servers on the decommissioned list -
getLiveServerMetrics
Returns the names of region servers on the live list -
getRegionCount
Returns the number of regions deployed on the cluster -
getRequestCount
Returns the number of requests since last report -
getMasterName
Returns detailed information about the current masterServerName
.- Returns:
- current master information if it exists
-
getBackupMasterNames
Returns the names of backup masters -
getRegionStatesInTransition
-
getClusterId
-
getMasterCoprocessorNames
-
getLastMajorCompactionTimestamp
-
getLastMajorCompactionTimestamp
-
getBalancerOn
-
getMasterInfoPort
int getMasterInfoPort() -
getServersName
-
getAverageLoad
Returns the average cluster load -
getTableRegionStatesCount
Provide region states count for given table. e.g howmany regions of give table are opened/closed/rit etc- Returns:
- map of table to region states count
-
getMasterTasks
Provide the list of master tasks
-