@InterfaceAudience.Private public class MaintenanceLoadBalancer extends Object implements LoadBalancer
BOGUS_SERVER_NAME, SYSTEM_TABLES_ON_MASTER, TABLES_ON_MASTER| Constructor and Description |
|---|
MaintenanceLoadBalancer() |
| Modifier and Type | Method and Description |
|---|---|
List<RegionPlan> |
balanceCluster(Map<TableName,Map<ServerName,List<RegionInfo>>> loadOfAllTable)
Perform the major balance operation for cluster.
|
void |
initialize()
Initialize the load balancer.
|
boolean |
isStopped() |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf) |
void |
postMasterStartupInitialize()
If balancer needs to do initialization after Master has started up, lets do that here.
|
ServerName |
randomAssignment(RegionInfo regionInfo,
List<ServerName> servers)
Get a random region server from the list
|
void |
regionOffline(RegionInfo regionInfo)
Marks the region as offline at balancer.
|
void |
regionOnline(RegionInfo regionInfo,
ServerName sn)
Marks the region as online at balancer.
|
Map<ServerName,List<RegionInfo>> |
retainAssignment(Map<RegionInfo,ServerName> regions,
List<ServerName> servers)
Assign regions to the previously hosting region server
|
Map<ServerName,List<RegionInfo>> |
roundRobinAssignment(List<RegionInfo> regions,
List<ServerName> servers)
Perform a Round Robin assignment of regions.
|
void |
setMasterServices(MasterServices masterServices)
Set the master service.
|
void |
stop(String why) |
void |
updateBalancerStatus(boolean status) |
void |
updateClusterMetrics(ClusterMetrics st)
Set the current cluster status.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisMasterCanHostUserRegions, isSystemTablesOnlyOnMaster, isTablesOnMaster, updateBalancerLoadInfopublic void updateClusterMetrics(ClusterMetrics st)
LoadBalancerupdateClusterMetrics in interface LoadBalancerpublic void setMasterServices(MasterServices masterServices)
LoadBalancersetMasterServices in interface LoadBalancerpublic List<RegionPlan> balanceCluster(Map<TableName,Map<ServerName,List<RegionInfo>>> loadOfAllTable) throws IOException
LoadBalancerbalanceCluster in interface LoadBalancerloadOfAllTable - region load of servers for all tableIOExceptionpublic Map<ServerName,List<RegionInfo>> roundRobinAssignment(List<RegionInfo> regions, List<ServerName> servers)
LoadBalancerroundRobinAssignment in interface LoadBalancerpublic Map<ServerName,List<RegionInfo>> retainAssignment(Map<RegionInfo,ServerName> regions, List<ServerName> servers)
LoadBalancerretainAssignment in interface LoadBalancerpublic ServerName randomAssignment(RegionInfo regionInfo, List<ServerName> servers)
LoadBalancerrandomAssignment in interface LoadBalancerregionInfo - Region for which this selection is being done.public void initialize()
LoadBalancerinitialize in interface LoadBalancerpublic void regionOnline(RegionInfo regionInfo, ServerName sn)
LoadBalancerregionOnline in interface LoadBalancerpublic void regionOffline(RegionInfo regionInfo)
LoadBalancerregionOffline in interface LoadBalancerpublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
onConfigurationChange in interface ConfigurationObserveronConfigurationChange in interface LoadBalancerpublic void postMasterStartupInitialize()
LoadBalancerpostMasterStartupInitialize in interface LoadBalancerpublic void updateBalancerStatus(boolean status)
updateBalancerStatus in interface LoadBalancerCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.