abstract static class StochasticLoadBalancer.CandidateGenerator extends Object
Constructor and Description |
---|
CandidateGenerator() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract BaseLoadBalancer.Cluster.Action |
generate(BaseLoadBalancer.Cluster cluster) |
protected BaseLoadBalancer.Cluster.Action |
getAction(int fromServer,
int fromRegion,
int toServer,
int toRegion) |
protected List<Integer> |
getRandomIterationOrder(int length)
Returns a random iteration order of indexes of an array with size length
|
protected int |
pickOtherRandomRack(BaseLoadBalancer.Cluster cluster,
int rackIndex) |
protected int |
pickOtherRandomServer(BaseLoadBalancer.Cluster cluster,
int serverIndex) |
protected int |
pickRandomRack(BaseLoadBalancer.Cluster cluster) |
protected int |
pickRandomRegion(BaseLoadBalancer.Cluster cluster,
int server,
double chanceOfNoSwap)
From a list of regions pick a random one.
|
protected BaseLoadBalancer.Cluster.Action |
pickRandomRegions(BaseLoadBalancer.Cluster cluster,
int thisServer,
int otherServer) |
protected int |
pickRandomServer(BaseLoadBalancer.Cluster cluster) |
CandidateGenerator()
abstract BaseLoadBalancer.Cluster.Action generate(BaseLoadBalancer.Cluster cluster)
protected int pickRandomRegion(BaseLoadBalancer.Cluster cluster, int server, double chanceOfNoSwap)
StochasticLoadBalancer.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.protected int pickRandomServer(BaseLoadBalancer.Cluster cluster)
protected int pickRandomRack(BaseLoadBalancer.Cluster cluster)
protected int pickOtherRandomServer(BaseLoadBalancer.Cluster cluster, int serverIndex)
protected int pickOtherRandomRack(BaseLoadBalancer.Cluster cluster, int rackIndex)
protected BaseLoadBalancer.Cluster.Action pickRandomRegions(BaseLoadBalancer.Cluster cluster, int thisServer, int otherServer)
protected BaseLoadBalancer.Cluster.Action getAction(int fromServer, int fromRegion, int toServer, int toRegion)
protected List<Integer> getRandomIterationOrder(int length)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.