abstract static class StochasticLoadBalancer.CandidateGenerator extends Object
Constructor and Description |
---|
StochasticLoadBalancer.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 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) |
StochasticLoadBalancer.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.HRegionInfo
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)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.