HBASE-14291 NPE On StochasticLoadBalancer Balance Involving RS With No Regions
This commit is contained in:
parent
902cd172f8
commit
e95cf8fdb4
|
@ -860,7 +860,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