Class CacheAwareLoadBalancer
java.lang.Object
org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer
org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer
org.apache.hadoop.hbase.master.balancer.CacheAwareLoadBalancer
- All Implemented Interfaces:
ConfigurationObserver,LoadBalancer,Stoppable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class(package private) static class(package private) static classprivate classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final floatprivate org.apache.hadoop.conf.Configurationprivate static final org.slf4j.Loggerprivate LongFields inherited from class org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer
candidateGenerators, COST_FUNCTIONS_COST_FUNCTIONS_KEY, costFunctions, DEFAULT_KEEP_REGION_LOADS, DEFAULT_MAX_RUNNING_TIME, DEFAULT_MAX_STEPS, DEFAULT_MIN_COST_NEED_BALANCE, DEFAULT_RUN_MAX_STEPS, DEFAULT_STEPS_PER_REGION, KEEP_REGION_LOADS, loads, MAX_RUNNING_TIME_KEY, MAX_STEPS_KEY, MIN_COST_NEED_BALANCE_KEY, OVERALL_COST_FUNCTION_NAME, regionCacheRatioOnOldServerMap, RUN_MAX_STEPS_KEY, shuffledGeneratorClasses, STEPS_PER_REGION_KEYFields inherited from class org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer
BALANCER_DECISION_BUFFER_ENABLED, BALANCER_REJECTION_BUFFER_ENABLED, clusterStatus, DEFAULT_BALANCER_DECISION_BUFFER_ENABLED, DEFAULT_BALANCER_REJECTION_BUFFER_ENABLED, DEFAULT_HBASE_MASTER_LOADBALANCE_BYTABLE, isByTable, masterServerName, metricsBalancer, MIN_SERVER_BALANCE, provider, rackManager, regionFinder, REGIONS_SLOP_DEFAULT, REGIONS_SLOP_KEY, slop, useRegionFinderFields inherited from interface org.apache.hadoop.hbase.master.LoadBalancer
BOGUS_SERVER_NAME, HBASE_RSGROUP_LOADBALANCER_CLASS, MOVE_THROTTLING, MOVE_THROTTLING_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddCostFunction(List<CostFunction> costFunctions, CostFunction costFunction) protected List<RegionPlan>balanceTable(TableName tableName, Map<ServerName, List<RegionInfo>> loadOfOneTable) Given the cluster state this will try and approach an optimal balance.protected Map<Class<? extends CandidateGenerator>,CandidateGenerator> createCandidateGenerators(org.apache.hadoop.conf.Configuration conf) protected List<CostFunction>createCostFunctions(org.apache.hadoop.conf.Configuration configuration) private RegionInfogetRegionInfoByEncodedName(BalancerClusterState cluster, String regionName) voidloadConf(org.apache.hadoop.conf.Configuration configuration) voidthrottle(RegionPlan plan) voidupdateClusterMetrics(ClusterMetrics clusterMetrics) Set the current cluster status.private voidCollect the amount of region cached for all the regions from all the active region servers.Methods inherited from class org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer
composeAttributeName, computeCost, functionCost, getCandidateGenerators, getCostFunctionNames, getCostFunctions, getRandomGenerator, initCosts, needsBalance, nextAction, sendRejectionReasonToRingBuffer, setRackManager, updateBalancerLoadInfo, updateCostsAndWeightsWithAction, updateMetricsSizeMethods inherited from class org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer
balanceCluster, getConf, getDefaultSlop, idleRegionServerExist, initialize, isStopped, onConfigurationChange, postMasterStartupInitialize, preBalanceCluster, randomAssignment, regionOffline, regionOnline, retainAssignment, roundRobinAssignment, setClusterInfoProvider, sloppyRegionServerExist, stop, toEnsumbleTableLoad, updateBalancerStatus
-
Field Details
-
LOG
-
CACHE_RATIO_THRESHOLD
- See Also:
-
CACHE_RATIO_THRESHOLD_DEFAULT
- See Also:
-
ratioThreshold
-
sleepTime
-
configuration
-
-
Constructor Details
-
CacheAwareLoadBalancer
public CacheAwareLoadBalancer()
-
-
Method Details
-
loadConf
- Overrides:
loadConfin classStochasticLoadBalancer
-
createCandidateGenerators
protected Map<Class<? extends CandidateGenerator>,CandidateGenerator> createCandidateGenerators(org.apache.hadoop.conf.Configuration conf) - Overrides:
createCandidateGeneratorsin classStochasticLoadBalancer
-
createCostFunctions
protected List<CostFunction> createCostFunctions(org.apache.hadoop.conf.Configuration configuration) - Overrides:
createCostFunctionsin classStochasticLoadBalancer
-
addCostFunction
-
updateClusterMetrics
Description copied from interface:LoadBalancerSet the current cluster status. This allows a LoadBalancer to map host name to a server- Specified by:
updateClusterMetricsin interfaceLoadBalancer- Overrides:
updateClusterMetricsin classStochasticLoadBalancer
-
updateRegionLoad
Collect the amount of region cached for all the regions from all the active region servers. -
getRegionInfoByEncodedName
-
throttle
-
balanceTable
protected List<RegionPlan> balanceTable(TableName tableName, Map<ServerName, List<RegionInfo>> loadOfOneTable) Description copied from class:StochasticLoadBalancerGiven the cluster state this will try and approach an optimal balance. This should always approach the optimal state given enough steps.- Overrides:
balanceTablein classStochasticLoadBalancer- Parameters:
tableName- the table to be balancedloadOfOneTable- region load of servers for the specific one table- Returns:
- List of plans
-