HBASE-23575 Remove dead code in AsyncRegistry (addendum)

Additions to MiniHBaseCluster needed for branch-2.

Signed-off-by: Jan Hentschel <janh@apache.org>
Signed-off-by: Xu Cang <xucang@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Viraj Jasani <virajjasani007@gmail.com>
This commit is contained in:
Bharath Vissapragada 2019-12-11 17:44:56 -08:00 committed by Sean Busbey
parent 29d1a97482
commit b38446c017
3 changed files with 11 additions and 7 deletions

View File

@ -764,6 +764,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.

View File

@ -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) {

View File

@ -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;
@ -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) -> {