Class CandidateGenerator
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CandidateGenerator
- Direct Known Subclasses:
- CacheAwareLoadBalancer.CacheAwareCandidateGenerator,- FavoredStochasticBalancer.FavoredNodeLoadPicker,- FavoredStochasticBalancer.FavoredNodeLocalityPicker,- LoadCandidateGenerator,- LocalityBasedCandidateGenerator,- RandomCandidateGenerator,- RegionPlanConditionalCandidateGenerator,- RegionReplicaCandidateGenerator
Generates a candidate action to be applied to the cluster for cost function search
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription(package private) abstract BalanceActiongenerate(BalancerClusterState cluster) protected BalanceActiongetAction(int fromServer, int fromRegion, int toServer, int toRegion) (package private) intpickOtherRandomRack(BalancerClusterState cluster, int rackIndex) (package private) intpickOtherRandomServer(BalancerClusterState cluster, int serverIndex) (package private) intpickRandomRack(BalancerClusterState cluster) (package private) intpickRandomRegion(BalancerClusterState cluster, int server, double chanceOfNoSwap) From a list of regions pick a random one.(package private) BalanceActionpickRandomRegions(BalancerClusterState cluster, int thisServer, int otherServer) (package private) intpickRandomServer(BalancerClusterState cluster) 
- 
Field Details- 
MAX_WEIGHT- See Also:
 
 
- 
- 
Constructor Details- 
CandidateGenerator
 
- 
- 
Method Details- 
generate
- 
pickRandomRegionFrom a list of regions pick a random one. Null can be returned whichBaseLoadBalancer.balanceCluster(Map)recognize as signal to try a region move rather than swap.- Parameters:
- cluster- The state of the cluster
- server- index of the server
- chanceOfNoSwap- Chance that this will decide to try a move rather than a swap.
- Returns:
- a random RegionInfoor null if an asymmetrical move is suggested.
 
- 
pickRandomServer
- 
pickRandomRack
- 
pickOtherRandomServer
- 
pickOtherRandomRack
- 
pickRandomRegions
- 
getAction
 
-