@InterfaceAudience.Private abstract class CandidateGenerator extends Object
Constructor and Description |
---|
CandidateGenerator() |
Modifier and Type | Method and Description |
---|---|
(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) |
CandidateGenerator()
abstract BalanceAction generate(BalancerClusterState cluster)
int pickRandomRegion(BalancerClusterState cluster, int server, double chanceOfNoSwap)
BaseLoadBalancer.balanceCluster(Map)
recognize as signal to try a region move
rather than swap.cluster
- The state of the clusterserver
- index of the serverchanceOfNoSwap
- Chance that this will decide to try a move rather than a swap.RegionInfo
or null if an asymmetrical move is suggested.int pickRandomServer(BalancerClusterState cluster)
int pickRandomRack(BalancerClusterState cluster)
int pickOtherRandomServer(BalancerClusterState cluster, int serverIndex)
int pickOtherRandomRack(BalancerClusterState cluster, int rackIndex)
BalanceAction pickRandomRegions(BalancerClusterState cluster, int thisServer, int otherServer)
protected BalanceAction getAction(int fromServer, int fromRegion, int toServer, int toRegion)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.