HBASE-14291 NPE On StochasticLoadBalancer Balance Involving RS With No Regions
This commit is contained in:
parent
234a4632a4
commit
0b081303b9
|
@ -858,7 +858,13 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
|
|||
int leastLoadedServerIndex = -1;
|
||||
int load = Integer.MAX_VALUE;
|
||||
for (ServerName sn : topLocalServers) {
|
||||
int index = serversToIndex.get(sn);
|
||||
if (!serversToIndex.containsKey(sn.getHostAndPort())) {
|
||||
continue;
|
||||
}
|
||||
int index = serversToIndex.get(sn.getHostAndPort());
|
||||
if (regionsPerServer[index] == null) {
|
||||
continue;
|
||||
}
|
||||
int tempLoad = regionsPerServer[index].length;
|
||||
if (tempLoad <= load) {
|
||||
leastLoadedServerIndex = index;
|
||||
|
|
Loading…
Reference in New Issue