protected static class BaseLoadBalancer.Cluster extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
BaseLoadBalancer.Cluster.Action
An action to move or swap a region 
 | 
static class  | 
BaseLoadBalancer.Cluster.AssignRegionAction  | 
static class  | 
BaseLoadBalancer.Cluster.MoveRegionAction  | 
static class  | 
BaseLoadBalancer.Cluster.SwapRegionsAction  | 
| Modifier and Type | Field and Description | 
|---|---|
static BaseLoadBalancer.Cluster.Action | 
NullAction  | 
protected RackManager | 
rackManager  | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
BaseLoadBalancer.Cluster(Collection<HRegionInfo> unassignedRegions,
                        Map<ServerName,List<HRegionInfo>> clusterState,
                        Map<String,Deque<RegionLoad>> loads,
                        org.apache.hadoop.hbase.master.balancer.RegionLocationFinder regionFinder,
                        RackManager rackManager)  | 
protected  | 
BaseLoadBalancer.Cluster(Map<ServerName,List<HRegionInfo>> clusterState,
                        Map<String,Deque<RegionLoad>> loads,
                        org.apache.hadoop.hbase.master.balancer.RegionLocationFinder regionFinder,
                        RackManager rackManager)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
doAction(BaseLoadBalancer.Cluster.Action action)  | 
float | 
getOrComputeLocality(int region,
                    int entity,
                    org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
Looks up locality from cache of localities. 
 | 
float[][] | 
getOrComputeRackLocalities()
Retrieves and lazily initializes a field storing the locality of
 every region/server combination 
 | 
int[] | 
getOrComputeRegionsToMostLocalEntities(org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
Lazily initializes and retrieves a mapping of region -> server for which region has
 the highest the locality 
 | 
double | 
getOrComputeWeightedLocality(int region,
                            int server,
                            org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
Returns locality weighted by region size in MB. 
 | 
int | 
getRackForRegion(int region)
Maps region index to rack index 
 | 
int | 
getRegionSizeMB(int region)
Returns the size in MB from the most recent RegionLoad for region 
 | 
boolean | 
serverHasTooFewRegions(int server)
Returns true iff a given server has less regions than the balanced amount 
 | 
protected void | 
setNumMovedRegions(int numMovedRegions)  | 
protected void | 
setNumRegions(int numRegions)  | 
String | 
toString()  | 
protected final RackManager rackManager
public static final BaseLoadBalancer.Cluster.Action NullAction
protected BaseLoadBalancer.Cluster(Map<ServerName,List<HRegionInfo>> clusterState, Map<String,Deque<RegionLoad>> loads, org.apache.hadoop.hbase.master.balancer.RegionLocationFinder regionFinder, RackManager rackManager)
protected BaseLoadBalancer.Cluster(Collection<HRegionInfo> unassignedRegions, Map<ServerName,List<HRegionInfo>> clusterState, Map<String,Deque<RegionLoad>> loads, org.apache.hadoop.hbase.master.balancer.RegionLocationFinder regionFinder, RackManager rackManager)
public boolean serverHasTooFewRegions(int server)
public float[][] getOrComputeRackLocalities()
public int[] getOrComputeRegionsToMostLocalEntities(org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
public float getOrComputeLocality(int region,
                         int entity,
                         org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
public double getOrComputeWeightedLocality(int region,
                                  int server,
                                  org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.LocalityType type)
public int getRegionSizeMB(int region)
public int getRackForRegion(int region)
public void doAction(BaseLoadBalancer.Cluster.Action action)
protected void setNumRegions(int numRegions)
protected void setNumMovedRegions(int numMovedRegions)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.