|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.master.balancer.BaseLoadBalancer
org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer
@InterfaceAudience.Private public class StochasticLoadBalancer
This is a best effort load balancer. Given a Cost function F(C) => x It will randomly try and mutate the cluster to Cprime. If F(Cprime) < F(C) then the new cluster state becomes the plan. It includes costs functions to compute the cost of:
Every cost function returns a number between 0 and 1 inclusive; where 0 is the lowest cost best solution, and 1 is the highest possible cost and the worst solution. The computed costs are scaled by their respective multipliers:
In addition to the above configurations, the balancer can be tuned by the following configuration values:
This balancer is best used with hbase.master.loadbalance.bytable set to false so that the balancer gets the full picture of all loads on the cluster.
| Field Summary |
|---|
| Fields inherited from class org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer |
|---|
services |
| Constructor Summary | |
|---|---|
StochasticLoadBalancer()
|
|
| Method Summary | |
|---|---|
List<RegionPlan> |
balanceCluster(Map<ServerName,List<HRegionInfo>> clusterState)
Given the cluster state this will try and approach an optimal balance. |
protected double |
computeCost(Map<HRegionInfo,ServerName> initialRegionMapping,
Map<ServerName,List<HRegionInfo>> clusterState)
This is the main cost function. |
void |
setClusterStatus(ClusterStatus st)
Set the current cluster status. |
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
void |
setMasterServices(MasterServices masterServices)
Set the master service. |
| Methods inherited from class org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer |
|---|
getConf, immediateAssignment, needsBalance, randomAssignment, retainAssignment, roundRobinAssignment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StochasticLoadBalancer()
| Method Detail |
|---|
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class BaseLoadBalancerpublic void setClusterStatus(ClusterStatus st)
LoadBalancer
setClusterStatus in interface LoadBalancersetClusterStatus in class BaseLoadBalancerpublic void setMasterServices(MasterServices masterServices)
LoadBalancer
setMasterServices in interface LoadBalancersetMasterServices in class BaseLoadBalancerpublic List<RegionPlan> balanceCluster(Map<ServerName,List<HRegionInfo>> clusterState)
protected double computeCost(Map<HRegionInfo,ServerName> initialRegionMapping,
Map<ServerName,List<HRegionInfo>> clusterState)
initialRegionMapping - Map of where the regions started.clusterState - Map of ServerName to list of regions.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||