Package org.apache.hadoop.hbase.favored
Class FavoredNodesPlan
java.lang.Object
org.apache.hadoop.hbase.favored.FavoredNodesPlan
This class contains the mapping information between each region name 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.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<String,
List<ServerName>> The map between each region name and its favored region server list -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return the mapping between each region to its favored region server list.getFavoredNodes
(RegionInfo region) Returns the list of favored region server for this region based on the planstatic FavoredNodesPlan.Position
getFavoredServerPosition
(List<ServerName> favoredNodes, ServerName server) Return the position of the server in the favoredNodes list.int
hashCode()
(package private) List<ServerName>
removeFavoredNodes
(RegionInfo region) Remove a favored node assignmentint
size()
void
updateFavoredNodesMap
(RegionInfo region, List<ServerName> servers) Update an assignment to the plan(package private) void
Add to existing Map of FavoredNodes.
-
Field Details
-
favoredNodesMap
The map between each region name and its favored region server list
-
-
Constructor Details
-
FavoredNodesPlan
public FavoredNodesPlan()
-
-
Method Details
-
updateFavoredNodesMap
Add to existing Map of FavoredNodes. -
updateFavoredNodesMap
Update an assignment to the plan -
removeFavoredNodes
Remove a favored node assignment- Returns:
- the list of favored region server for this region based on the plan
-
getFavoredNodes
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. -
getAssignmentMap
Return the mapping between each region to its favored region server list. -
size
-
equals
-
hashCode
-