@InterfaceAudience.Public public interface ClusterMetrics
ClusterMetrics provides clients with information such as:
ClusterMetrics.Option
provides a way to get desired ClusterStatus information.
The following codes will get all the cluster information.
// 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:
Admin admin = connection.getAdmin();
ClusterMetrics metrics = admin.getClusterStatus(EnumSet.of(Option.LIVE_SERVERS));
Modifier and Type | Interface and Description |
---|---|
static class |
ClusterMetrics.Option
Kinds of ClusterMetrics
|
Modifier and Type | Method and Description |
---|---|
default double |
getAverageLoad() |
List<ServerName> |
getBackupMasterNames() |
Boolean |
getBalancerOn() |
String |
getClusterId() |
List<ServerName> |
getDeadServerNames() |
String |
getHBaseVersion() |
default long |
getLastMajorCompactionTimestamp(byte[] regionName) |
default long |
getLastMajorCompactionTimestamp(TableName table) |
Map<ServerName,ServerMetrics> |
getLiveServerMetrics() |
List<String> |
getMasterCoprocessorNames() |
int |
getMasterInfoPort() |
ServerName |
getMasterName()
Returns detailed information about the current master
ServerName . |
default int |
getRegionCount() |
List<RegionState> |
getRegionStatesInTransition() |
default long |
getRequestCount() |
@Nullable String getHBaseVersion()
List<ServerName> getDeadServerNames()
Map<ServerName,ServerMetrics> getLiveServerMetrics()
default int getRegionCount()
default long getRequestCount()
@Nullable ServerName getMasterName()
ServerName
.List<ServerName> getBackupMasterNames()
@InterfaceAudience.Private List<RegionState> getRegionStatesInTransition()
@Nullable String getClusterId()
List<String> getMasterCoprocessorNames()
default long getLastMajorCompactionTimestamp(TableName table)
default long getLastMajorCompactionTimestamp(byte[] regionName)
@Nullable Boolean getBalancerOn()
int getMasterInfoPort()
default double getAverageLoad()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.