|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@InterfaceAudience.Public public interface LoadBalancer
Makes decisions about the placement and movement of Regions across RegionServers.
Cluster-wide load balancing will occur only when there are no regions in
transition and according to a fixed period of a time using balanceCluster(Map)
.
Inline region placement with immediateAssignment(java.util.List
can be used when
the Master needs to handle closed regions that it currently does not have
a destination set for. This can happen during master failover.
On cluster startup, bulk assignment can be used to determine locations for all Regions in a cluster.
This classes produces plans for the AssignmentManager
to execute.
Method Summary | |
---|---|
List<RegionPlan> |
balanceCluster(Map<ServerName,List<HRegionInfo>> clusterState)
Perform the major balance operation |
Map<HRegionInfo,ServerName> |
immediateAssignment(List<HRegionInfo> regions,
List<ServerName> servers)
Sync assign a region |
ServerName |
randomAssignment(HRegionInfo regionInfo,
List<ServerName> servers)
Get a random region server from the list |
Map<ServerName,List<HRegionInfo>> |
retainAssignment(Map<HRegionInfo,ServerName> regions,
List<ServerName> servers)
Assign regions to the previously hosting region server |
Map<ServerName,List<HRegionInfo>> |
roundRobinAssignment(List<HRegionInfo> regions,
List<ServerName> servers)
Perform a Round Robin assignment of regions. |
void |
setClusterStatus(ClusterStatus st)
Set the current cluster status. |
void |
setMasterServices(MasterServices masterServices)
Set the master service. |
Methods inherited from interface org.apache.hadoop.conf.Configurable |
---|
getConf, setConf |
Method Detail |
---|
void setClusterStatus(ClusterStatus st)
st
- void setMasterServices(MasterServices masterServices)
masterServices
- List<RegionPlan> balanceCluster(Map<ServerName,List<HRegionInfo>> clusterState) throws HBaseIOException
clusterState
-
HBaseIOException
Map<ServerName,List<HRegionInfo>> roundRobinAssignment(List<HRegionInfo> regions, List<ServerName> servers) throws HBaseIOException
regions
- servers
-
HBaseIOException
Map<ServerName,List<HRegionInfo>> retainAssignment(Map<HRegionInfo,ServerName> regions, List<ServerName> servers) throws HBaseIOException
regions
- servers
-
HBaseIOException
Map<HRegionInfo,ServerName> immediateAssignment(List<HRegionInfo> regions, List<ServerName> servers) throws HBaseIOException
regions
- servers
-
HBaseIOException
ServerName randomAssignment(HRegionInfo regionInfo, List<ServerName> servers) throws HBaseIOException
regionInfo
- Region for which this selection is being done.servers
-
HBaseIOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |