HBASE-16552 MiniHBaseCluster#getServerWith() does not ignore stopped RSs

This commit is contained in:
Matteo Bertozzi 2016-09-02 16:49:17 -07:00
parent 2fcc691b16
commit 008091fe8a
1 changed files with 6 additions and 4 deletions

View File

@ -696,11 +696,13 @@ public class MiniHBaseCluster extends HBaseCluster {
int count = 0; int count = 0;
for (JVMClusterUtil.RegionServerThread rst: getRegionServerThreads()) { for (JVMClusterUtil.RegionServerThread rst: getRegionServerThreads()) {
HRegionServer hrs = rst.getRegionServer(); HRegionServer hrs = rst.getRegionServer();
if (!hrs.isStopped()) {
Region region = hrs.getOnlineRegion(regionName); Region region = hrs.getOnlineRegion(regionName);
if (region != null) { if (region != null) {
index = count; index = count;
break; break;
} }
}
count++; count++;
} }
return index; return index;