@InterfaceAudience.Private public class RSGroupBasedLoadBalancer extends Object implements LoadBalancer
| Modifier and Type | Field and Description |
|---|---|
static String |
FALLBACK_GROUP_ENABLE_KEY
Set this key to
true to allow region fallback. |
BOGUS_SERVER_NAME, HBASE_RSGROUP_LOADBALANCER_CLASS| Constructor and Description |
|---|
RSGroupBasedLoadBalancer()
Used by reflection in
LoadBalancerFactory. |
public static final String FALLBACK_GROUP_ENABLE_KEY
true to allow region fallback. Fallback to the default rsgroup first,
then fallback to any group if no online servers in default rsgroup. Please keep balancer switch
on at the same time, which is relied on to correct misplaced regions@InterfaceAudience.Private public RSGroupBasedLoadBalancer()
LoadBalancerFactory.public void updateClusterMetrics(ClusterMetrics sm)
updateClusterMetrics in interface LoadBalancerpublic void updateBalancerLoadInfo(Map<TableName,Map<ServerName,List<RegionInfo>>> loadOfAllTable)
updateBalancerLoadInfo in interface LoadBalancerpublic void setMasterServices(MasterServices masterServices)
public List<RegionPlan> balanceCluster(Map<TableName,Map<ServerName,List<RegionInfo>>> loadOfAllTable) throws IOException
balanceCluster in interface LoadBalancerIOException@NonNull public Map<ServerName,List<RegionInfo>> roundRobinAssignment(List<RegionInfo> regions, List<ServerName> servers) throws IOException
roundRobinAssignment in interface LoadBalancerIOException@NonNull public Map<ServerName,List<RegionInfo>> retainAssignment(Map<RegionInfo,ServerName> regions, List<ServerName> servers) throws HBaseIOException
retainAssignment in interface LoadBalancerHBaseIOExceptionpublic ServerName randomAssignment(RegionInfo region, List<ServerName> servers) throws IOException
randomAssignment in interface LoadBalancerIOExceptionpublic void initialize()
throws IOException
initialize in interface LoadBalancerIOExceptionpublic boolean isOnline()
public boolean isFallbackEnabled()
public void regionOnline(RegionInfo regionInfo, ServerName sn)
regionOnline in interface LoadBalancerpublic void regionOffline(RegionInfo regionInfo)
regionOffline in interface LoadBalancerpublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
onConfigurationChange in interface ConfigurationObserveronConfigurationChange in interface LoadBalancerpublic LoadBalancer getInternalBalancer()
public FavoredNodesManager getFavoredNodesManager()
public void postMasterStartupInitialize()
postMasterStartupInitialize in interface LoadBalancerpublic void updateBalancerStatus(boolean status)
updateBalancerStatus in interface LoadBalancerpublic void setClusterInfoProvider(ClusterInfoProvider provider)
setClusterInfoProvider in interface LoadBalancerCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.