Class CandidateGenerator
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CandidateGenerator
- Direct Known Subclasses:
CacheAwareLoadBalancer.CacheAwareCandidateGenerator
,FavoredStochasticBalancer.FavoredNodeLoadPicker
,FavoredStochasticBalancer.FavoredNodeLocalityPicker
,LoadCandidateGenerator
,LocalityBasedCandidateGenerator
,RandomCandidateGenerator
,RegionReplicaCandidateGenerator
Generates a candidate action to be applied to the cluster for cost function search
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) abstract BalanceAction
generate
(BalancerClusterState cluster) protected BalanceAction
getAction
(int fromServer, int fromRegion, int toServer, int toRegion) (package private) int
pickOtherRandomRack
(BalancerClusterState cluster, int rackIndex) (package private) int
pickOtherRandomServer
(BalancerClusterState cluster, int serverIndex) (package private) int
pickRandomRack
(BalancerClusterState cluster) (package private) int
pickRandomRegion
(BalancerClusterState cluster, int server, double chanceOfNoSwap) From a list of regions pick a random one.(package private) BalanceAction
pickRandomRegions
(BalancerClusterState cluster, int thisServer, int otherServer) (package private) int
pickRandomServer
(BalancerClusterState cluster)
-
Constructor Details
-
CandidateGenerator
-
-
Method Details
-
generate
-
pickRandomRegion
From 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 clusterserver
- index of the serverchanceOfNoSwap
- Chance that this will decide to try a move rather than a swap.- Returns:
- a random
RegionInfo
or null if an asymmetrical move is suggested.
-
pickRandomServer
-
pickRandomRack
-
pickOtherRandomServer
-
pickOtherRandomRack
-
pickRandomRegions
-
getAction
-