diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
deleted file mode 100644
index 33c30ddbb816..000000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hbase;
-
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import org.apache.hadoop.hbase.master.RegionState;
-import org.apache.yetus.audience.InterfaceAudience;
-
-import org.apache.hbase.thirdparty.com.google.common.base.Objects;
-
-/**
- * Status information on the HBase cluster.
- *
- * ClusterStatus 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
- *
- * {@link 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();
- * ClusterStatus status = admin.getClusterStatus();
- * // or below, a new version which has the same effects
- * ClusterStatus status = admin.getClusterStatus(EnumSet.allOf(Option.class));
- * }
- *
- * If information about live servers is the only wanted.
- * then codes in the following way:
- *
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link ClusterMetrics} instead.
- */
-@InterfaceAudience.Public
-@Deprecated
-public class ClusterStatus implements ClusterMetrics {
-
- // TODO: remove this in 3.0
- private static final byte VERSION = 2;
-
- private final ClusterMetrics metrics;
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- */
- @Deprecated
- public ClusterStatus(final String hbaseVersion, final String clusterid,
- final Map servers,
- final Collection deadServers,
- final ServerName master,
- final Collection backupMasters,
- final List rit,
- final String[] masterCoprocessors,
- final Boolean balancerOn,
- final int masterInfoPort) {
- // TODO: make this constructor private
- this(ClusterMetricsBuilder.newBuilder().setHBaseVersion(hbaseVersion)
- .setDeadServerNames(new ArrayList<>(deadServers))
- .setLiveServerMetrics(servers.entrySet().stream()
- .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())))
- .setBackerMasterNames(new ArrayList<>(backupMasters)).setBalancerOn(balancerOn)
- .setClusterId(clusterid)
- .setMasterCoprocessorNames(Arrays.asList(masterCoprocessors))
- .setMasterName(master)
- .setMasterInfoPort(masterInfoPort)
- .setRegionsInTransition(rit)
- .build());
- }
-
- @InterfaceAudience.Private
- public ClusterStatus(ClusterMetrics metrics) {
- this.metrics = metrics;
- }
-
- /**
- * @return the names of region servers on the dead list
- */
- @Override
- public List getDeadServerNames() {
- return metrics.getDeadServerNames();
- }
-
- @Override
- public Map getLiveServerMetrics() {
- return metrics.getLiveServerMetrics();
- }
-
- /**
- * @return the number of region servers in the cluster
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLiveServerMetrics()}.
- */
- @Deprecated
- public int getServersSize() {
- return metrics.getLiveServerMetrics().size();
- }
-
- /**
- * @return the number of dead region servers in the cluster
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * (HBASE-13656).
- * Use {@link #getDeadServerNames()}.
- */
- @Deprecated
- public int getDeadServers() {
- return getDeadServersSize();
- }
-
- /**
- * @return the number of dead region servers in the cluster
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getDeadServerNames()}.
- */
- @Deprecated
- public int getDeadServersSize() {
- return metrics.getDeadServerNames().size();
- }
-
- /**
- * @return the number of regions deployed on the cluster
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionCount()}.
- */
- @Deprecated
- public int getRegionsCount() {
- return getRegionCount();
- }
-
- /**
- * @return the number of requests since last report
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRequestCount()} instead.
- */
- @Deprecated
- public int getRequestsCount() {
- return (int) getRequestCount();
- }
-
- @Nullable
- @Override
- public ServerName getMasterName() {
- return metrics.getMasterName();
- }
-
- @Override
- public List getBackupMasterNames() {
- return metrics.getBackupMasterNames();
- }
-
- @Override
- public List getRegionStatesInTransition() {
- return metrics.getRegionStatesInTransition();
- }
-
- /**
- * @return the HBase version string as reported by the HMaster
- */
- public String getHBaseVersion() {
- return metrics.getHBaseVersion();
- }
-
- private Map getLiveServerLoads() {
- return metrics.getLiveServerMetrics().entrySet().stream()
- .collect(Collectors.toMap(e -> e.getKey(), e -> new ServerLoad(e.getValue())));
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof ClusterStatus)) {
- return false;
- }
- ClusterStatus other = (ClusterStatus) o;
- return Objects.equal(getHBaseVersion(), other.getHBaseVersion()) &&
- Objects.equal(getLiveServerLoads(), other.getLiveServerLoads()) &&
- getDeadServerNames().containsAll(other.getDeadServerNames()) &&
- Arrays.equals(getMasterCoprocessors(), other.getMasterCoprocessors()) &&
- Objects.equal(getMaster(), other.getMaster()) &&
- getBackupMasters().containsAll(other.getBackupMasters()) &&
- Objects.equal(getClusterId(), other.getClusterId()) &&
- getMasterInfoPort() == other.getMasterInfoPort();
- }
-
- @Override
- public int hashCode() {
- return metrics.hashCode();
- }
-
- /**
- * @return the object version number
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- */
- @Deprecated
- public byte getVersion() {
- return VERSION;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLiveServerMetrics()} instead.
- */
- @Deprecated
- public Collection getServers() {
- return metrics.getLiveServerMetrics().keySet();
- }
-
- /**
- * Returns detailed information about the current master {@link ServerName}.
- * @return current master information if it exists
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getMasterName} instead.
- */
- @Deprecated
- public ServerName getMaster() {
- return metrics.getMasterName();
- }
-
- /**
- * @return the number of backup masters in the cluster
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getBackupMasterNames} instead.
- */
- @Deprecated
- public int getBackupMastersSize() {
- return metrics.getBackupMasterNames().size();
- }
-
- /**
- * @return the names of backup masters
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getBackupMasterNames} instead.
- */
- @Deprecated
- public List getBackupMasters() {
- return metrics.getBackupMasterNames();
- }
-
- /**
- * @param sn
- * @return Server's load or null if not found.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLiveServerMetrics} instead.
- */
- @Deprecated
- public ServerLoad getLoad(final ServerName sn) {
- ServerMetrics serverMetrics = metrics.getLiveServerMetrics().get(sn);
- return serverMetrics == null ? null : new ServerLoad(serverMetrics);
- }
-
- public String getClusterId() {
- return metrics.getClusterId();
- }
-
- @Override
- public List getMasterCoprocessorNames() {
- return metrics.getMasterCoprocessorNames();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getMasterCoprocessorNames} instead.
- */
- @Deprecated
- public String[] getMasterCoprocessors() {
- List rval = metrics.getMasterCoprocessorNames();
- return rval.toArray(new String[rval.size()]);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLastMajorCompactionTimestamp(TableName)} instead.
- */
- @Deprecated
- public long getLastMajorCompactionTsForTable(TableName table) {
- return metrics.getLastMajorCompactionTimestamp(table);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLastMajorCompactionTimestamp(byte[])} instead.
- */
- @Deprecated
- public long getLastMajorCompactionTsForRegion(final byte[] region) {
- return metrics.getLastMajorCompactionTimestamp(region);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * No flag in 2.0
- */
- @Deprecated
- public boolean isBalancerOn() {
- return metrics.getBalancerOn() != null && metrics.getBalancerOn();
- }
-
- @Override
- public Boolean getBalancerOn() {
- return metrics.getBalancerOn();
- }
-
- @Override
- public int getMasterInfoPort() {
- return metrics.getMasterInfoPort();
- }
-
- @Override
- public List getServersName() {
- return metrics.getServersName();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(1024);
- sb.append("Master: " + metrics.getMasterName());
-
- int backupMastersSize = getBackupMastersSize();
- sb.append("\nNumber of backup masters: " + backupMastersSize);
- if (backupMastersSize > 0) {
- for (ServerName serverName: metrics.getBackupMasterNames()) {
- sb.append("\n " + serverName);
- }
- }
-
- int serversSize = getServersSize();
- int serversNameSize = getServersName().size();
- sb.append("\nNumber of live region servers: "
- + (serversSize > 0 ? serversSize : serversNameSize));
- if (serversSize > 0) {
- for (ServerName serverName : metrics.getLiveServerMetrics().keySet()) {
- sb.append("\n " + serverName.getServerName());
- }
- } else if (serversNameSize > 0) {
- for (ServerName serverName : getServersName()) {
- sb.append("\n " + serverName.getServerName());
- }
- }
-
- int deadServerSize = metrics.getDeadServerNames().size();
- sb.append("\nNumber of dead region servers: " + deadServerSize);
- if (deadServerSize > 0) {
- for (ServerName serverName : metrics.getDeadServerNames()) {
- sb.append("\n " + serverName);
- }
- }
-
- sb.append("\nAverage load: " + getAverageLoad());
- sb.append("\nNumber of requests: " + getRequestCount());
- sb.append("\nNumber of regions: " + getRegionsCount());
-
- int ritSize = metrics.getRegionStatesInTransition().size();
- sb.append("\nNumber of regions in transition: " + ritSize);
- if (ritSize > 0) {
- for (RegionState state: metrics.getRegionStatesInTransition()) {
- sb.append("\n " + state.toDescriptiveString());
- }
- }
- return sb.toString();
- }
-}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
deleted file mode 100644
index efcd20ba7374..000000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hbase;
-
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import org.apache.hadoop.hbase.util.Strings;
-import org.apache.yetus.audience.InterfaceAudience;
-
-import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos;
-
-/**
- * Encapsulates per-region load metrics.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link RegionMetrics} instead.
- */
-@InterfaceAudience.Public
-@Deprecated
-public class RegionLoad implements RegionMetrics {
- // DONT use this pb object since the byte array backed may be modified in rpc layer
- // we keep this pb object for BC.
- protected ClusterStatusProtos.RegionLoad regionLoadPB;
- private final RegionMetrics metrics;
-
- @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
- public RegionLoad(ClusterStatusProtos.RegionLoad regionLoadPB) {
- this.regionLoadPB = regionLoadPB;
- this.metrics = RegionMetricsBuilder.toRegionMetrics(regionLoadPB);
- }
-
- RegionLoad(RegionMetrics metrics) {
- this.metrics = metrics;
- this.regionLoadPB = RegionMetricsBuilder.toRegionLoad(metrics);
- }
-
- /**
- * @return the region name
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionName} instead.
- */
- @Deprecated
- public byte[] getName() {
- return metrics.getRegionName();
- }
-
- @Override
- public byte[] getRegionName() {
- return metrics.getRegionName();
- }
-
- @Override
- public int getStoreCount() {
- return metrics.getStoreCount();
- }
-
- @Override
- public int getStoreFileCount() {
- return metrics.getStoreFileCount();
- }
-
- @Override
- public Size getStoreFileSize() {
- return metrics.getStoreFileSize();
- }
-
- @Override
- public Size getMemStoreSize() {
- return metrics.getMemStoreSize();
- }
-
- @Override
- public long getReadRequestCount() {
- return metrics.getReadRequestCount();
- }
-
- @Override
- public long getCpRequestCount() {
- return metrics.getCpRequestCount();
- }
-
- @Override
- public long getFilteredReadRequestCount() {
- return metrics.getFilteredReadRequestCount();
- }
-
- @Override
- public Size getStoreFileIndexSize() {
- return metrics.getStoreFileIndexSize();
- }
-
- @Override
- public long getWriteRequestCount() {
- return metrics.getWriteRequestCount();
- }
-
- @Override
- public Size getStoreFileRootLevelIndexSize() {
- return metrics.getStoreFileRootLevelIndexSize();
- }
-
- @Override
- public Size getStoreFileUncompressedDataIndexSize() {
- return metrics.getStoreFileUncompressedDataIndexSize();
- }
-
- @Override
- public Size getBloomFilterSize() {
- return metrics.getBloomFilterSize();
- }
-
- @Override
- public long getCompactingCellCount() {
- return metrics.getCompactingCellCount();
- }
-
- @Override
- public long getCompactedCellCount() {
- return metrics.getCompactedCellCount();
- }
-
- @Override
- public long getCompletedSequenceId() {
- return metrics.getCompletedSequenceId();
- }
-
- @Override
- public Map getStoreSequenceId() {
- return metrics.getStoreSequenceId();
- }
-
- @Override
- public Size getUncompressedStoreFileSize() {
- return metrics.getUncompressedStoreFileSize();
- }
-
- /**
- * @return the number of stores
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreCount} instead.
- */
- @Deprecated
- public int getStores() {
- return metrics.getStoreCount();
- }
-
- /**
- * @return the number of storefiles
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreFileCount} instead.
- */
- @Deprecated
- public int getStorefiles() {
- return metrics.getStoreFileCount();
- }
-
- /**
- * @return the total size of the storefiles, in MB
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreFileSize} instead.
- */
- @Deprecated
- public int getStorefileSizeMB() {
- return (int) metrics.getStoreFileSize().get(Size.Unit.MEGABYTE);
- }
-
- /**
- * @return the memstore size, in MB
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getMemStoreSize} instead.
- */
- @Deprecated
- public int getMemStoreSizeMB() {
- return (int) metrics.getMemStoreSize().get(Size.Unit.MEGABYTE);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * ((HBASE-3935)).
- * Use {@link #getStoreFileRootLevelIndexSize} instead.
- */
- @Deprecated
- public int getStorefileIndexSizeMB() {
- // Return value divided by 1024
- return (getRootIndexSizeKB() >> 10);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreFileRootLevelIndexSize()} instead.
- */
- @Deprecated
- public int getStorefileIndexSizeKB() {
- return getRootIndexSizeKB();
- }
-
- /**
- * @return the number of requests made to region
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRequestCount()} instead.
- */
- @Deprecated
- public long getRequestsCount() {
- return metrics.getRequestCount();
- }
-
- /**
- * @return the number of read requests made to region
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getReadRequestCount} instead.
- */
- @Deprecated
- public long getReadRequestsCount() {
- return metrics.getReadRequestCount();
- }
-
- /**
- * @return the number of filtered read requests made to region
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getFilteredReadRequestCount} instead.
- */
- @Deprecated
- public long getFilteredReadRequestsCount() {
- return metrics.getFilteredReadRequestCount();
- }
-
- /**
- * @return the number of write requests made to region
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getWriteRequestCount} instead.
- */
- @Deprecated
- public long getWriteRequestsCount() {
- return metrics.getWriteRequestCount();
- }
-
- /**
- * @return The current total size of root-level indexes for the region, in KB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreFileRootLevelIndexSize} instead.
- */
- @Deprecated
- public int getRootIndexSizeKB() {
- return (int) metrics.getStoreFileRootLevelIndexSize().get(Size.Unit.KILOBYTE);
- }
-
- /**
- * @return The total size of all index blocks, not just the root level, in KB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreFileUncompressedDataIndexSize} instead.
- */
- @Deprecated
- public int getTotalStaticIndexSizeKB() {
- return (int) metrics.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
- }
-
- /**
- * @return The total size of all Bloom filter blocks, not just loaded into the
- * block cache, in KB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getBloomFilterSize} instead.
- */
- @Deprecated
- public int getTotalStaticBloomSizeKB() {
- return (int) metrics.getBloomFilterSize().get(Size.Unit.KILOBYTE);
- }
-
- /**
- * @return the total number of kvs in current compaction
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getCompactingCellCount} instead.
- */
- @Deprecated
- public long getTotalCompactingKVs() {
- return metrics.getCompactingCellCount();
- }
-
- /**
- * @return the number of already compacted kvs in current compaction
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getCompactedCellCount} instead.
- */
- @Deprecated
- public long getCurrentCompactedKVs() {
- return metrics.getCompactedCellCount();
- }
-
- /**
- * This does not really belong inside RegionLoad but its being done in the name of expediency.
- * @return the completed sequence Id for the region
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getCompletedSequenceId} instead.
- */
- @Deprecated
- public long getCompleteSequenceId() {
- return metrics.getCompletedSequenceId();
- }
-
- /**
- * @return completed sequence id per store.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getStoreSequenceId} instead.
- */
- @Deprecated
- public List getStoreCompleteSequenceId() {
- return metrics.getStoreSequenceId().entrySet().stream()
- .map(s -> ClusterStatusProtos.StoreSequenceId.newBuilder()
- .setFamilyName(UnsafeByteOperations.unsafeWrap(s.getKey()))
- .setSequenceId(s.getValue())
- .build())
- .collect(Collectors.toList());
- }
-
- /**
- * @return the uncompressed size of the storefiles in MB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getUncompressedStoreFileSize} instead.
- */
- @Deprecated
- public int getStoreUncompressedSizeMB() {
- return (int) metrics.getUncompressedStoreFileSize().get(Size.Unit.KILOBYTE);
- }
-
- /**
- * @return the data locality of region in the regionserver.
- */
- @Override
- public float getDataLocality() {
- return metrics.getDataLocality();
- }
-
- @Override
- public long getLastMajorCompactionTimestamp() {
- return metrics.getLastMajorCompactionTimestamp();
- }
-
- /**
- * @return the timestamp of the oldest hfile for any store of this region.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getLastMajorCompactionTimestamp} instead.
- */
- @Deprecated
- public long getLastMajorCompactionTs() {
- return metrics.getLastMajorCompactionTimestamp();
- }
-
- /**
- * @return the reference count for the stores of this region
- */
- public int getStoreRefCount() {
- return metrics.getStoreRefCount();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "numberOfStores",
- this.getStores());
- Strings.appendKeyValue(sb, "numberOfStorefiles", this.getStorefiles());
- Strings.appendKeyValue(sb, "storeRefCount", this.getStoreRefCount());
- Strings.appendKeyValue(sb, "storefileUncompressedSizeMB",
- this.getStoreUncompressedSizeMB());
- Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp",
- this.getLastMajorCompactionTs());
- Strings.appendKeyValue(sb, "storefileSizeMB", this.getStorefileSizeMB());
- if (this.getStoreUncompressedSizeMB() != 0) {
- Strings.appendKeyValue(sb, "compressionRatio",
- String.format("%.4f", (float) this.getStorefileSizeMB() /
- (float) this.getStoreUncompressedSizeMB()));
- }
- Strings.appendKeyValue(sb, "memstoreSizeMB",
- this.getMemStoreSizeMB());
- Strings.appendKeyValue(sb, "readRequestsCount",
- this.getReadRequestsCount());
- Strings.appendKeyValue(sb, "writeRequestsCount",
- this.getWriteRequestsCount());
- Strings.appendKeyValue(sb, "rootIndexSizeKB",
- this.getRootIndexSizeKB());
- Strings.appendKeyValue(sb, "totalStaticIndexSizeKB",
- this.getTotalStaticIndexSizeKB());
- Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
- this.getTotalStaticBloomSizeKB());
- Strings.appendKeyValue(sb, "totalCompactingKVs",
- this.getTotalCompactingKVs());
- Strings.appendKeyValue(sb, "currentCompactedKVs",
- this.getCurrentCompactedKVs());
- float compactionProgressPct = Float.NaN;
- if (this.getTotalCompactingKVs() > 0) {
- compactionProgressPct = ((float) this.getCurrentCompactedKVs() /
- (float) this.getTotalCompactingKVs());
- }
- Strings.appendKeyValue(sb, "compactionProgressPct",
- compactionProgressPct);
- Strings.appendKeyValue(sb, "completeSequenceId",
- this.getCompleteSequenceId());
- Strings.appendKeyValue(sb, "dataLocality",
- this.getDataLocality());
- return sb.toString();
- }
-}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
deleted file mode 100644
index f7f3204ac9d1..000000000000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
+++ /dev/null
@@ -1,596 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hbase;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.stream.Collectors;
-import org.apache.hadoop.hbase.replication.ReplicationLoadSink;
-import org.apache.hadoop.hbase.replication.ReplicationLoadSource;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Strings;
-import org.apache.yetus.audience.InterfaceAudience;
-
-import org.apache.hbase.thirdparty.com.google.common.base.Objects;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos;
-
-/**
- * This class is used for exporting current state of load on a RegionServer.
- *
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link ServerMetrics} instead.
- */
-@InterfaceAudience.Public
-@Deprecated
-public class ServerLoad implements ServerMetrics {
- private final ServerMetrics metrics;
- private int stores = 0;
- private int storefiles = 0;
- private int storeUncompressedSizeMB = 0;
- private int storefileSizeMB = 0;
- private int memstoreSizeMB = 0;
- private long storefileIndexSizeKB = 0;
- private long readRequestsCount = 0;
- private long cpRequestsCount = 0;
- private long filteredReadRequestsCount = 0;
- private long writeRequestsCount = 0;
- private int rootIndexSizeKB = 0;
- private int totalStaticIndexSizeKB = 0;
- private int totalStaticBloomSizeKB = 0;
- private long totalCompactingKVs = 0;
- private long currentCompactedKVs = 0;
-
- /**
- * DONT USE this construction. It make a fake server name;
- */
- @InterfaceAudience.Private
- public ServerLoad(ClusterStatusProtos.ServerLoad serverLoad) {
- this(ServerName.valueOf("localhost,1,1"), serverLoad);
- }
-
- @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
- @InterfaceAudience.Private
- public ServerLoad(ServerName name, ClusterStatusProtos.ServerLoad serverLoad) {
- this(ServerMetricsBuilder.toServerMetrics(name, serverLoad));
- this.serverLoad = serverLoad;
- }
-
- @InterfaceAudience.Private
- public ServerLoad(ServerMetrics metrics) {
- this.metrics = metrics;
- this.serverLoad = ServerMetricsBuilder.toServerLoad(metrics);
- for (RegionMetrics rl : metrics.getRegionMetrics().values()) {
- stores += rl.getStoreCount();
- storefiles += rl.getStoreFileCount();
- storeUncompressedSizeMB += rl.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE);
- storefileSizeMB += rl.getStoreFileSize().get(Size.Unit.MEGABYTE);
- memstoreSizeMB += rl.getMemStoreSize().get(Size.Unit.MEGABYTE);
- readRequestsCount += rl.getReadRequestCount();
- cpRequestsCount += rl.getCpRequestCount();
- filteredReadRequestsCount += rl.getFilteredReadRequestCount();
- writeRequestsCount += rl.getWriteRequestCount();
- storefileIndexSizeKB += rl.getStoreFileIndexSize().get(Size.Unit.KILOBYTE);
- rootIndexSizeKB += rl.getStoreFileRootLevelIndexSize().get(Size.Unit.KILOBYTE);
- totalStaticIndexSizeKB += rl.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
- totalStaticBloomSizeKB += rl.getBloomFilterSize().get(Size.Unit.KILOBYTE);
- totalCompactingKVs += rl.getCompactingCellCount();
- currentCompactedKVs += rl.getCompactedCellCount();
- }
- }
-
- /**
- * NOTE: Function name cannot start with "get" because then an OpenDataException is thrown because
- * HBaseProtos.ServerLoad cannot be converted to an open data type(see HBASE-5967).
- * @return the underlying ServerLoad protobuf object
- * @deprecated DONT use this pb object since the byte array backed may be modified in rpc layer
- */
- @InterfaceAudience.Private
- @Deprecated
- public ClusterStatusProtos.ServerLoad obtainServerLoadPB() {
- return serverLoad;
- }
-
- protected ClusterStatusProtos.ServerLoad serverLoad;
-
- /**
- * @return number of requests since last report.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
- * Use {@link #getRequestCountPerSecond} instead.
- */
- @Deprecated
- public long getNumberOfRequests() {
- return getRequestCountPerSecond();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * No flag in 2.0
- */
- @Deprecated
- public boolean hasNumberOfRequests() {
- return true;
- }
-
- /**
- * @return total Number of requests from the start of the region server.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
- * Use {@link #getRequestCount} instead.
- */
- @Deprecated
- public long getTotalNumberOfRequests() {
- return getRequestCount();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * No flag in 2.0
- */
- @Deprecated
- public boolean hasTotalNumberOfRequests() {
- return true;
- }
-
- /**
- * @return the amount of used heap, in MB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
- * Use {@link #getUsedHeapSize} instead.
- */
- @Deprecated
- public int getUsedHeapMB() {
- return (int) getUsedHeapSize().get(Size.Unit.MEGABYTE);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * No flag in 2.0
- */
- @Deprecated
- public boolean hasUsedHeapMB() {
- return true;
- }
-
- /**
- * @return the maximum allowable size of the heap, in MB.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getMaxHeapSize} instead.
- */
- @Deprecated
- public int getMaxHeapMB() {
- return (int) getMaxHeapSize().get(Size.Unit.MEGABYTE);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * No flag in 2.0
- */
- @Deprecated
- public boolean hasMaxHeapMB() {
- return true;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStores() {
- return stores;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStorefiles() {
- return storefiles;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStoreUncompressedSizeMB() {
- return storeUncompressedSizeMB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStorefileSizeInMB() {
- return storefileSizeMB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStorefileSizeMB() {
- return storefileSizeMB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getMemstoreSizeInMB() {
- return memstoreSizeMB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getMemStoreSizeMB() {
- return memstoreSizeMB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getStorefileIndexSizeInMB() {
- // Return value divided by 1024
- return (int) (getStorefileIndexSizeKB() >> 10);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getStorefileIndexSizeKB() {
- return storefileIndexSizeKB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getReadRequestsCount() {
- return readRequestsCount;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getCpRequestsCount() {
- return cpRequestsCount;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getFilteredReadRequestsCount() {
- return filteredReadRequestsCount;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getWriteRequestsCount() {
- return writeRequestsCount;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getRootIndexSizeKB() {
- return rootIndexSizeKB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getTotalStaticIndexSizeKB() {
- return totalStaticIndexSizeKB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getTotalStaticBloomSizeKB() {
- return totalStaticBloomSizeKB;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getTotalCompactingKVs() {
- return totalCompactingKVs;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public long getCurrentCompactedKVs() {
- return currentCompactedKVs;
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public int getNumberOfRegions() {
- return metrics.getRegionMetrics().size();
- }
-
- @Override
- public ServerName getServerName() {
- return metrics.getServerName();
- }
-
- @Override
- public long getRequestCountPerSecond() {
- return metrics.getRequestCountPerSecond();
- }
-
- @Override
- public long getRequestCount() {
- return metrics.getRequestCount();
- }
-
- @Override
- public Size getUsedHeapSize() {
- return metrics.getUsedHeapSize();
- }
-
- @Override
- public Size getMaxHeapSize() {
- return metrics.getMaxHeapSize();
- }
-
- @Override
- public int getInfoServerPort() {
- return metrics.getInfoServerPort();
- }
-
- /**
- * Call directly from client such as hbase shell
- * @return the list of ReplicationLoadSource
- */
- @Override
- public List getReplicationLoadSourceList() {
- return metrics.getReplicationLoadSourceList();
- }
-
- /**
- * Call directly from client such as hbase shell
- * @return a map of ReplicationLoadSource list per peer id
- */
- @Override
- public Map> getReplicationLoadSourceMap() {
- return metrics.getReplicationLoadSourceMap();
- }
-
- /**
- * Call directly from client such as hbase shell
- * @return ReplicationLoadSink
- */
- @Override
- public ReplicationLoadSink getReplicationLoadSink() {
- return metrics.getReplicationLoadSink();
- }
-
- @Override
- public Map getRegionMetrics() {
- return metrics.getRegionMetrics();
- }
-
- @Override
- public Set getCoprocessorNames() {
- return metrics.getCoprocessorNames();
- }
-
- @Override
- public long getReportTimestamp() {
- return metrics.getReportTimestamp();
- }
-
- @Override
- public long getLastReportTimestamp() {
- return metrics.getLastReportTimestamp();
- }
-
- /**
- * Originally, this method factored in the effect of requests going to the
- * server as well. However, this does not interact very well with the current
- * region rebalancing code, which only factors number of regions. For the
- * interim, until we can figure out how to make rebalancing use all the info
- * available, we're just going to make load purely the number of regions.
- *
- * @return load factor for this server.
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getNumberOfRegions} instead.
- */
- @Deprecated
- public int getLoad() {
- // See above comment
- // int load = numberOfRequests == 0 ? 1 : numberOfRequests;
- // load *= numberOfRegions == 0 ? 1 : numberOfRegions;
- // return load;
- return getNumberOfRegions();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRegionMetrics} instead.
- */
- @Deprecated
- public Map getRegionsLoad() {
- return getRegionMetrics().entrySet().stream()
- .collect(Collectors.toMap(Map.Entry::getKey, e -> new RegionLoad(e.getValue()),
- (v1, v2) -> {
- throw new RuntimeException("key collisions?");
- }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR)));
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getCoprocessorNames} instead.
- */
- @Deprecated
- public String[] getRegionServerCoprocessors() {
- return getCoprocessorNames().toArray(new String[getCoprocessorNames().size()]);
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getCoprocessorNames} instead.
- */
- @Deprecated
- public String[] getRsCoprocessors() {
- return getRegionServerCoprocessors();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getRequestCountPerSecond} instead.
- */
- @Deprecated
- public double getRequestsPerSecond() {
- return getRequestCountPerSecond();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond",
- Double.valueOf(getRequestsPerSecond()));
- Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(getNumberOfRegions()));
- Strings.appendKeyValue(sb, "usedHeapMB", Integer.valueOf(this.getUsedHeapMB()));
- Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(getMaxHeapMB()));
- Strings.appendKeyValue(sb, "numberOfStores", Integer.valueOf(this.stores));
- Strings.appendKeyValue(sb, "numberOfStorefiles", Integer.valueOf(this.storefiles));
- Strings.appendKeyValue(sb, "storefileUncompressedSizeMB",
- Integer.valueOf(this.storeUncompressedSizeMB));
- Strings.appendKeyValue(sb, "storefileSizeMB", Integer.valueOf(this.storefileSizeMB));
- if (this.storeUncompressedSizeMB != 0) {
- Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f",
- (float) this.storefileSizeMB / (float) this.storeUncompressedSizeMB));
- }
- Strings.appendKeyValue(sb, "memstoreSizeMB", Integer.valueOf(this.memstoreSizeMB));
- Strings.appendKeyValue(sb, "storefileIndexSizeKB",
- Long.valueOf(this.storefileIndexSizeKB));
- Strings.appendKeyValue(sb, "readRequestsCount", Long.valueOf(this.readRequestsCount));
- Strings.appendKeyValue(sb, "cpRequestsCount", Long.valueOf(this.cpRequestsCount));
- Strings.appendKeyValue(sb, "filteredReadRequestsCount",
- Long.valueOf(this.filteredReadRequestsCount));
- Strings.appendKeyValue(sb, "writeRequestsCount", Long.valueOf(this.writeRequestsCount));
- Strings.appendKeyValue(sb, "rootIndexSizeKB", Integer.valueOf(this.rootIndexSizeKB));
- Strings.appendKeyValue(sb, "totalStaticIndexSizeKB",
- Integer.valueOf(this.totalStaticIndexSizeKB));
- Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
- Integer.valueOf(this.totalStaticBloomSizeKB));
- Strings.appendKeyValue(sb, "totalCompactingKVs", Long.valueOf(this.totalCompactingKVs));
- Strings.appendKeyValue(sb, "currentCompactedKVs", Long.valueOf(this.currentCompactedKVs));
- float compactionProgressPct = Float.NaN;
- if (this.totalCompactingKVs > 0) {
- compactionProgressPct =
- Float.valueOf((float) this.currentCompactedKVs / this.totalCompactingKVs);
- }
- Strings.appendKeyValue(sb, "compactionProgressPct", compactionProgressPct);
-
- String[] coprocessorStrings = getRsCoprocessors();
- if (coprocessorStrings != null) {
- Strings.appendKeyValue(sb, "coprocessors", Arrays.toString(coprocessorStrings));
- }
- return sb.toString();
- }
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link ServerMetricsBuilder#of(ServerName)} instead.
- */
- @Deprecated
- public static final ServerLoad EMPTY_SERVERLOAD =
- new ServerLoad(ServerName.valueOf("localhost,1,1"),
- ClusterStatusProtos.ServerLoad.newBuilder().build());
-
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getReportTimestamp} instead.
- */
- @Deprecated
- public long getReportTime() {
- return getReportTimestamp();
- }
-
- @Override
- public int hashCode() {
- return Objects
- .hashCode(stores, storefiles, storeUncompressedSizeMB, storefileSizeMB, memstoreSizeMB,
- storefileIndexSizeKB, readRequestsCount, cpRequestsCount, filteredReadRequestsCount,
- writeRequestsCount, rootIndexSizeKB, totalStaticIndexSizeKB, totalStaticBloomSizeKB,
- totalCompactingKVs, currentCompactedKVs);
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (other instanceof ServerLoad) {
- ServerLoad sl = ((ServerLoad) other);
- return stores == sl.stores && storefiles == sl.storefiles
- && storeUncompressedSizeMB == sl.storeUncompressedSizeMB
- && storefileSizeMB == sl.storefileSizeMB && memstoreSizeMB == sl.memstoreSizeMB
- && storefileIndexSizeKB == sl.storefileIndexSizeKB
- && readRequestsCount == sl.readRequestsCount
- && cpRequestsCount == sl.cpRequestsCount
- && filteredReadRequestsCount == sl.filteredReadRequestsCount
- && writeRequestsCount == sl.writeRequestsCount && rootIndexSizeKB == sl.rootIndexSizeKB
- && totalStaticIndexSizeKB == sl.totalStaticIndexSizeKB
- && totalStaticBloomSizeKB == sl.totalStaticBloomSizeKB
- && totalCompactingKVs == sl.totalCompactingKVs
- && currentCompactedKVs == sl.currentCompactedKVs;
- }
- return false;
- }
-}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
index f31d8e418662..353801f5a3ab 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
@@ -131,7 +131,6 @@
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerInfoRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerInfoResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileRequest;
@@ -1734,16 +1733,6 @@ public static org.apache.hadoop.hbase.client.RegionInfo getRegionInfo(final RpcC
}
}
- public static List getRegionLoadInfo(
- GetRegionLoadResponse regionLoadResponse) {
- List regionLoadList =
- new ArrayList<>(regionLoadResponse.getRegionLoadsCount());
- for (RegionLoad regionLoad : regionLoadResponse.getRegionLoadsList()) {
- regionLoadList.add(new org.apache.hadoop.hbase.RegionLoad(regionLoad));
- }
- return regionLoadList;
- }
-
/**
* A helper to close a region given a region name
* using admin protocol.
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
index 5e4c2d7d1592..92091208d1ee 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
@@ -100,7 +100,7 @@ public static void setUpBeforeClass() throws Exception {
TEST_UTIL.waitFor(6000, new Waiter.Predicate() {
@Override
public boolean evaluate() throws IOException {
- return TEST_UTIL.getMiniHBaseCluster().getClusterStatus().getAverageLoad() > 0;
+ return TEST_UTIL.getMiniHBaseCluster().getClusterMetrics().getAverageLoad() > 0;
}
});
}
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index c3c1e721e3e7..99dca1df66b0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -110,7 +110,7 @@ public MiniHBaseCluster(Configuration conf, int numMasters, int numRegionServers
CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();
init(numMasters, numRegionServers, rsPorts, masterClass, regionserverClass);
- this.initialClusterStatus = getClusterStatus();
+ this.initialClusterStatus = getClusterMetrics();
}
public Configuration getConfiguration() {
@@ -435,9 +435,9 @@ public JVMClusterUtil.RegionServerThread startRegionServerAndWait(long timeout)
ServerName rsServerName = t.getRegionServer().getServerName();
long start = System.currentTimeMillis();
- ClusterStatus clusterStatus = getClusterStatus();
+ ClusterMetrics clusterStatus = getClusterMetrics();
while ((System.currentTimeMillis() - start) < timeout) {
- if (clusterStatus != null && clusterStatus.getServers().contains(rsServerName)) {
+ if (clusterStatus != null && clusterStatus.getLiveServerMetrics().containsKey(rsServerName)) {
return t;
}
Threads.sleep(100);
@@ -659,16 +659,6 @@ public void shutdown() throws IOException {
public void close() throws IOException {
}
- /**
- * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
- * Use {@link #getClusterMetrics()} instead.
- */
- @Deprecated
- public ClusterStatus getClusterStatus() throws IOException {
- HMaster master = getMaster();
- return master == null ? null : new ClusterStatus(master.getClusterMetrics());
- }
-
@Override
public ClusterMetrics getClusterMetrics() throws IOException {
HMaster master = getMaster();
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
index 635ba8b5ed04..f7de667832fe 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java
@@ -89,8 +89,6 @@ public void testNone() throws Exception {
// or more requests than expected.
Assert.assertEquals(status0.getLiveServerMetrics().size(),
status1.getLiveServerMetrics().size());
- checkPbObjectNotNull(new ClusterStatus(status0));
- checkPbObjectNotNull(new ClusterStatus(status1));
}
@Test
@@ -109,28 +107,26 @@ public void testLiveAndDeadServersStatus() throws Exception {
Waiter.waitFor(CLUSTER.getConfiguration(), 10 * 1000, 100, new Predicate() {
@Override
public boolean evaluate() throws Exception {
- ClusterStatus status
- = new ClusterStatus(ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)));
+ ClusterMetrics status = ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS));
Assert.assertNotNull(status);
- return status.getRegionsCount() > 0;
+ return status.getRegionCount() > 0;
}
});
// Retrieve live servers and dead servers info.
EnumSet