HBASE-21055 NullPointerException when balanceOverall() but server balance info is null

Signed-off-by: huzheng <openinx@gmail.com>
This commit is contained in:
haxiaolin 2018-08-15 11:15:46 +08:00 committed by huzheng
parent e520399201
commit 92fdc8dd51
1 changed files with 3 additions and 0 deletions

View File

@ -479,6 +479,9 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
for (int i = 0; i < serverLoadList.size(); i++) {
ServerAndLoad serverload = serverLoadList.get(i);
BalanceInfo balanceInfo = serverBalanceInfo.get(serverload.getServerName());
if (balanceInfo == null) {
continue;
}
setLoad(serverLoadList, i, balanceInfo.getNumRegionsAdded());
if (balanceInfo.getHriList().size() + balanceInfo.getNumRegionsAdded() == max) {
RegionInfo hriToPlan;