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 * @return List of region server threads. Does not return the master even though it is also
* a region server. * a region server.

View File

@ -356,7 +356,7 @@ public class TestAdmin extends TestAdminBase {
private void verifyRoundRobinDistribution(RegionLocator regionLocator, int expectedRegions) private void verifyRoundRobinDistribution(RegionLocator regionLocator, int expectedRegions)
throws IOException { throws IOException {
int numRS = TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().size(); int numRS = TEST_UTIL.getMiniHBaseCluster().getNumLiveRegionServers();
List<HRegionLocation> regions = regionLocator.getAllRegionLocations(); List<HRegionLocation> regions = regionLocator.getAllRegionLocations();
Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>(); Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>();
for (HRegionLocation loc : regions) { 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.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -52,7 +50,7 @@ import org.junit.runners.Parameterized;
/** /**
* Class to test asynchronous table admin operations. * Class to test asynchronous table admin operations.
* @see TestAsyncTableAdminApi2 This test and it used to be joined it was taking longer than our * @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. * @see TestAsyncTableAdminApi3 Another split out from this class so each runs under ten minutes.
*/ */
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
@ -268,9 +266,8 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
} }
} }
private void verifyRoundRobinDistribution(List<HRegionLocation> regions, int expectedRegions) private void verifyRoundRobinDistribution(List<HRegionLocation> regions, int expectedRegions) {
throws IOException { int numRS = TEST_UTIL.getMiniHBaseCluster().getNumLiveRegionServers();
int numRS = TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().size();
Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>(); Map<ServerName, List<RegionInfo>> server2Regions = new HashMap<>();
regions.stream().forEach((loc) -> { regions.stream().forEach((loc) -> {