Skip to content

Commit

Permalink
HBASE-24151 The master server aborted for IllegalThreadStateException (
Browse files Browse the repository at this point in the history
…#1507)

Signed-off-by: Jan Hentschel <jan.hentschel@ultratendency.com>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
  • Loading branch information
Gkkkk302 committed Apr 16, 2020
1 parent f401957 commit e460d0c
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.hadoop.hbase.master.LoadBalancer;
import org.apache.hadoop.hbase.master.MasterServices;
import org.apache.hadoop.hbase.master.RegionPlan;
import org.apache.hadoop.hbase.master.balancer.LoadBalancerFactory;
import org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer;
import org.apache.hadoop.hbase.net.Address;
import org.apache.hadoop.hbase.util.Pair;
Expand Down Expand Up @@ -354,9 +355,14 @@ public void initialize() throws HBaseIOException {
}

// Create the balancer
Class<? extends LoadBalancer> balancerKlass = config.getClass(HBASE_RSGROUP_LOADBALANCER_CLASS,
Class<? extends LoadBalancer> balancerClass = config.getClass(HBASE_RSGROUP_LOADBALANCER_CLASS,
StochasticLoadBalancer.class, LoadBalancer.class);
internalBalancer = ReflectionUtils.newInstance(balancerKlass, config);
if (this.getClass().isAssignableFrom(balancerClass)) {
LOG.warn("The internal balancer of RSGroupBasedLoadBalancer cannot be itself, " +
"falling back to the default LoadBalancer class");
balancerClass = LoadBalancerFactory.getDefaultLoadBalancerClass();
}
internalBalancer = ReflectionUtils.newInstance(balancerClass, config);
internalBalancer.setMasterServices(masterServices);
if (clusterStatus != null) {
internalBalancer.setClusterMetrics(clusterStatus);
Expand Down

0 comments on commit e460d0c

Please sign in to comment.