org.apache.hadoop.hbase.master.balancer
Class FavoredNodesPlan
java.lang.Object
org.apache.hadoop.hbase.master.balancer.FavoredNodesPlan
@InterfaceAudience.Private
public class FavoredNodesPlan
- extends Object
This class contains the mapping information between each region and
its favored region server list. Used by FavoredNodeLoadBalancer
set
of classes and from unit tests (hence the class is public)
All the access to this class is thread-safe.
Field Summary |
protected static org.apache.commons.logging.Log |
LOG
|
LOG
protected static final org.apache.commons.logging.Log LOG
FavoredNodesPlan
public FavoredNodesPlan()
updateFavoredNodesMap
public void updateFavoredNodesMap(HRegionInfo region,
List<ServerName> servers)
- Add an assignment to the plan
- Parameters:
region
- servers
-
getFavoredNodes
public List<ServerName> getFavoredNodes(HRegionInfo region)
- Parameters:
region
-
- Returns:
- the list of favored region server for this region based on the plan
getFavoredServerPosition
public static FavoredNodesPlan.Position getFavoredServerPosition(List<ServerName> favoredNodes,
ServerName server)
- Return the position of the server in the favoredNodes list. Assumes the
favoredNodes list is of size 3.
- Parameters:
favoredNodes
- server
-
- Returns:
- position
getAssignmentMap
public Map<HRegionInfo,List<ServerName>> getAssignmentMap()
- Returns:
- the mapping between each region to its favored region server list
updateAssignmentPlan
public void updateAssignmentPlan(HRegionInfo region,
List<ServerName> servers)
- Add an assignment to the plan
- Parameters:
region
- servers
-
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.