HBASE-16910 Avoid NPE when starting StochasticLoadBalancer (Guanghao Zhang)
This commit is contained in:
parent
0ae211eb39
commit
e223639671
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue