HBASE-9555 Reset loadbalancer back to StochasticLoadBalancer
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1523914 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3d55d10714
commit
161832243a
|
@ -1057,9 +1057,13 @@ possible configurations would overwhelm and obscure the important.
|
|||
</property>
|
||||
<property>
|
||||
<name>hbase.master.loadbalancer.class</name>
|
||||
<value>org.apache.hadoop.hbase.master.balancer.DefaultLoadBalancer</value>
|
||||
<value>org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer</value>
|
||||
<description>
|
||||
Class used to execute the regions balancing when the period occurs.
|
||||
See the class comment for more on how it works
|
||||
http://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.html
|
||||
It replaces the DefaultLoadBalancer as the default (since renamed
|
||||
as the SimpleLoadBalancer).
|
||||
</description>
|
||||
</property>
|
||||
</configuration>
|
||||
|
|
|
@ -54,8 +54,8 @@ import com.google.common.collect.MinMaxPriorityQueue;
|
|||
* <p>This classes produces plans for the {@link AssignmentManager} to execute.
|
||||
*/
|
||||
@InterfaceAudience.Private
|
||||
public class DefaultLoadBalancer extends BaseLoadBalancer {
|
||||
private static final Log LOG = LogFactory.getLog(DefaultLoadBalancer.class);
|
||||
public class SimpleLoadBalancer extends BaseLoadBalancer {
|
||||
private static final Log LOG = LogFactory.getLog(SimpleLoadBalancer.class);
|
||||
private static final Random RANDOM = new Random(System.currentTimeMillis());
|
||||
|
||||
private RegionInfoComparator riComparator = new RegionInfoComparator();
|
|
@ -45,7 +45,7 @@ import org.apache.hadoop.hbase.client.ResultScanner;
|
|||
import org.apache.hadoop.hbase.client.Scan;
|
||||
import org.apache.hadoop.hbase.master.HMaster;
|
||||
import org.apache.hadoop.hbase.master.LoadBalancer;
|
||||
import org.apache.hadoop.hbase.master.balancer.DefaultLoadBalancer;
|
||||
import org.apache.hadoop.hbase.master.balancer.SimpleLoadBalancer;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
import org.apache.hadoop.hbase.util.Threads;
|
||||
import org.apache.hadoop.hbase.zookeeper.EmptyWatcher;
|
||||
|
@ -556,7 +556,7 @@ public class TestZooKeeper {
|
|||
}
|
||||
}
|
||||
|
||||
static class MockLoadBalancer extends DefaultLoadBalancer {
|
||||
static class MockLoadBalancer extends SimpleLoadBalancer {
|
||||
static boolean retainAssignCalled = false;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,7 +56,7 @@ import org.apache.hadoop.hbase.executor.ExecutorType;
|
|||
import org.apache.hadoop.hbase.ipc.PayloadCarryingRpcController;
|
||||
import org.apache.hadoop.hbase.master.RegionState.State;
|
||||
import org.apache.hadoop.hbase.master.TableLockManager.NullTableLockManager;
|
||||
import org.apache.hadoop.hbase.master.balancer.DefaultLoadBalancer;
|
||||
import org.apache.hadoop.hbase.master.balancer.SimpleLoadBalancer;
|
||||
import org.apache.hadoop.hbase.master.balancer.LoadBalancerFactory;
|
||||
import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
|
||||
import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
|
||||
|
@ -797,7 +797,7 @@ public class TestAssignmentManager {
|
|||
Mocking.waitForRegionPendingOpenInRIT(am, REGIONINFO.getEncodedName());
|
||||
} finally {
|
||||
this.server.getConfiguration().setClass(
|
||||
HConstants.HBASE_MASTER_LOADBALANCER_CLASS, DefaultLoadBalancer.class,
|
||||
HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SimpleLoadBalancer.class,
|
||||
LoadBalancer.class);
|
||||
am.getExecutorService().shutdown();
|
||||
am.shutdown();
|
||||
|
@ -808,7 +808,7 @@ public class TestAssignmentManager {
|
|||
* Mocked load balancer class used in the testcase to make sure that the testcase waits until
|
||||
* random assignment is called and the gate variable is set to true.
|
||||
*/
|
||||
public static class MockedLoadBalancer extends DefaultLoadBalancer {
|
||||
public static class MockedLoadBalancer extends SimpleLoadBalancer {
|
||||
private AtomicBoolean gate;
|
||||
|
||||
public void setGateVariable(AtomicBoolean gate) {
|
||||
|
@ -899,7 +899,7 @@ public class TestAssignmentManager {
|
|||
am.getZKTable().isDisabledTable(REGIONINFO.getTable()));
|
||||
} finally {
|
||||
this.server.getConfiguration().setClass(
|
||||
HConstants.HBASE_MASTER_LOADBALANCER_CLASS, DefaultLoadBalancer.class,
|
||||
HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SimpleLoadBalancer.class,
|
||||
LoadBalancer.class);
|
||||
am.getZKTable().setEnabledTable(REGIONINFO.getTable());
|
||||
am.shutdown();
|
||||
|
|
|
@ -46,7 +46,7 @@ public class TestDefaultLoadBalancer extends BalancerTestBase {
|
|||
public static void beforeAllTests() throws Exception {
|
||||
Configuration conf = HBaseConfiguration.create();
|
||||
conf.set("hbase.regions.slop", "0");
|
||||
loadBalancer = new DefaultLoadBalancer();
|
||||
loadBalancer = new SimpleLoadBalancer();
|
||||
loadBalancer.setConf(conf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue