abstract static class StochasticLoadBalancer.LocalityBasedCostFunction extends StochasticLoadBalancer.CostFunction
HStoreFiles are located.| Modifier and Type | Field and Description | 
|---|---|
| private double | bestLocality | 
| private double | locality | 
| private MasterServices | services | 
| private BaseLoadBalancer.Cluster.LocalityType | type | 
cluster| Constructor and Description | 
|---|
| LocalityBasedCostFunction(org.apache.hadoop.conf.Configuration conf,
                         MasterServices srv,
                         BaseLoadBalancer.Cluster.LocalityType type,
                         String localityCostKey,
                         float defaultLocalityCost) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected double | cost() | 
| private int | getMostLocalEntityForRegion(int region) | 
| private double | getWeightedLocality(int region,
                   int entity) | 
| (package private) void | init(BaseLoadBalancer.Cluster cluster)Called once per LB invocation to give the cost function
 to initialize it's state, and perform any costly calculation. | 
| (package private) abstract int | regionIndexToEntityIndex(int region)Maps region to the current entity (server or rack) on which it is stored | 
| protected void | regionMoved(int region,
           int oldServer,
           int newServer) | 
| void | setServices(MasterServices srvc) | 
costFromArray, getMultiplier, isNeeded, postAction, scale, setMultiplierprivate final BaseLoadBalancer.Cluster.LocalityType type
private double bestLocality
private double locality
private MasterServices services
LocalityBasedCostFunction(org.apache.hadoop.conf.Configuration conf, MasterServices srv, BaseLoadBalancer.Cluster.LocalityType type, String localityCostKey, float defaultLocalityCost)
abstract int regionIndexToEntityIndex(int region)
public void setServices(MasterServices srvc)
void init(BaseLoadBalancer.Cluster cluster)
StochasticLoadBalancer.CostFunctioninit in class StochasticLoadBalancer.CostFunctionprotected void regionMoved(int region, int oldServer, int newServer)
regionMoved in class StochasticLoadBalancer.CostFunctionprotected double cost()
cost in class StochasticLoadBalancer.CostFunctionprivate int getMostLocalEntityForRegion(int region)
private double getWeightedLocality(int region, int entity)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.