abstract static class StochasticLoadBalancer.LocalityBasedCostFunction extends StochasticLoadBalancer.CostFunction
HStoreFile
s 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 |
---|---|
(package private) 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, setMultiplier
private 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.CostFunction
init
in class StochasticLoadBalancer.CostFunction
protected void regionMoved(int region, int oldServer, int newServer)
regionMoved
in class StochasticLoadBalancer.CostFunction
double cost()
cost
in class StochasticLoadBalancer.CostFunction
private int getMostLocalEntityForRegion(int region)
private double getWeightedLocality(int region, int entity)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.