Interface ClusterMetrics

All Known Implementing Classes:
ClusterMetricsBuilder.ClusterMetricsImpl, ClusterStatus

@Public public interface ClusterMetrics
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));
 }