org.apache.hadoop.hbase.master.balancer
Class StochasticLoadBalancer.LoadPicker

java.lang.Object
  extended by org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.LoadPicker
Enclosing class:
StochasticLoadBalancer

public static class StochasticLoadBalancer.LoadPicker
extends Object


Constructor Summary
StochasticLoadBalancer.LoadPicker()
           
 
Method Summary
protected  int pickOtherRandomServer(BaseLoadBalancer.Cluster cluster, int serverIndex)
           
protected  int pickRandomRegion(BaseLoadBalancer.Cluster cluster, int server, double chanceOfNoSwap)
          From a list of regions pick a random one.
protected  Pair<Integer,Integer> pickRandomRegions(BaseLoadBalancer.Cluster cluster, int thisServer, int otherServer)
           
protected  int pickRandomServer(BaseLoadBalancer.Cluster cluster)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StochasticLoadBalancer.LoadPicker

public StochasticLoadBalancer.LoadPicker()
Method Detail

pickRandomRegion

protected int pickRandomRegion(BaseLoadBalancer.Cluster cluster,
                               int server,
                               double chanceOfNoSwap)
From a list of regions pick a random one. Null can be returned which StochasticLoadBalancer.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 HRegionInfo or null if an asymmetrical move is suggested.

pickRandomServer

protected int pickRandomServer(BaseLoadBalancer.Cluster cluster)

pickOtherRandomServer

protected int pickOtherRandomServer(BaseLoadBalancer.Cluster cluster,
                                    int serverIndex)

pickRandomRegions

protected Pair<Integer,Integer> pickRandomRegions(BaseLoadBalancer.Cluster cluster,
                                                  int thisServer,
                                                  int otherServer)


Copyright © 2015 The Apache Software Foundation. All rights reserved.