This is an automated email from the ASF dual-hosted git repository.
busbey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new b38446c HBASE-23575 Remove dead code in AsyncRegistry (addendum)
b38446c is described below
commit b38446c0177fe2b7a86ccd2db94cb50e655b48df
Author: Bharath Vissapragada <[email protected]>
AuthorDate: Wed Dec 11 17:44:56 2019 -0800
HBASE-23575 Remove dead code in AsyncRegistry (addendum)
Additions to MiniHBaseCluster needed for branch-2.
Signed-off-by: Jan Hentschel <[email protected]>
Signed-off-by: Xu Cang <[email protected]>
Signed-off-by: Sean Busbey <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>
---
.../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 7 +++++++
.../src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java | 2 +-
.../org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java | 9 +++------
3 files changed, 11 insertions(+), 7 deletions(-)
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 948ba1f..84e6f8f 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
@@ -765,6 +765,13 @@ public class MiniHBaseCluster extends HBaseCluster {
}
/**
+ * @return Number of live region servers in the cluster currently.
+ */
+ public int getNumLiveRegionServers() {
+ return this.hbaseCluster.getLiveRegionServers().size();
+ }
+
+ /**
* @return List of region server threads. Does not return the master even
though it is also
* a region server.
*/
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
index d1ba1a7..1de4635 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
@@ -356,7 +356,7 @@ public class TestAdmin extends TestAdminBase {
private void verifyRoundRobinDistribution(RegionLocator regionLocator, int
expectedRegions)
throws IOException {
- int numRS =
TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().size();
+ int numRS = TEST_UTIL.getMiniHBaseCluster().getNumLiveRegionServers();
List<HRegionLocation> regions = regionLocator.getAllRegionLocations();
Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>();
for (HRegionLocation loc : regions) {
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
index 053618f..5b03591 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
@@ -22,8 +22,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -52,7 +50,7 @@ import org.junit.runners.Parameterized;
/**
* Class to test asynchronous table admin operations.
* @see TestAsyncTableAdminApi2 This test and it used to be joined it was
taking longer than our
- * ten minute timeout so they were split.
+ * ten minute timeout so they were split.
* @see TestAsyncTableAdminApi3 Another split out from this class so each runs
under ten minutes.
*/
@RunWith(Parameterized.class)
@@ -268,9 +266,8 @@ public class TestAsyncTableAdminApi extends
TestAsyncAdminBase {
}
}
- private void verifyRoundRobinDistribution(List<HRegionLocation> regions, int
expectedRegions)
- throws IOException {
- int numRS =
TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().size();
+ private void verifyRoundRobinDistribution(List<HRegionLocation> regions, int
expectedRegions) {
+ int numRS = TEST_UTIL.getMiniHBaseCluster().getNumLiveRegionServers();
Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>();
regions.stream().forEach((loc) -> {