HBASE-16910 Avoid NPE when starting StochasticLoadBalancer (Guanghao Zhang)

This commit is contained in:
tedyu 2016-10-21 10:25:42 -07:00
parent 0ae211eb39
commit e223639671
3 changed files with 3 additions and 3 deletions

View File

@ -391,8 +391,8 @@ public class RSGroupBasedLoadBalancer implements RSGroupableBalancer, LoadBalanc
HBASE_GROUP_LOADBALANCER_CLASS,
StochasticLoadBalancer.class, LoadBalancer.class);
internalBalancer = ReflectionUtils.newInstance(balancerKlass, config);
internalBalancer.setClusterStatus(clusterStatus);
internalBalancer.setMasterServices(masterServices);
internalBalancer.setClusterStatus(clusterStatus);
internalBalancer.setConf(config);
internalBalancer.initialize();
}

View File

@ -742,8 +742,8 @@ public class HMaster extends HRegionServer implements MasterServices {
}
//initialize load balancer
this.balancer.setClusterStatus(getClusterStatus());
this.balancer.setMasterServices(this);
this.balancer.setClusterStatus(getClusterStatus());
this.balancer.initialize();
// Check if master is shutting down because of some issue

View File

@ -233,7 +233,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
updateMetricsSize(tablesCount * (functionsCount + 1)); // +1 for overall
} catch (Exception e) {
LOG.error("failed to get the size of all tables, exception = " + e.getMessage());
LOG.error("failed to get the size of all tables", e);
}
}