@InterfaceAudience.Private public class FavoredNodesPlan extends Object
FavoredNodeLoadBalancer
set
of classes and from unit tests (hence the class is public)
All the access to this class is thread-safe.Modifier and Type | Class and Description |
---|---|
static class |
FavoredNodesPlan.Position |
Modifier and Type | Field and Description |
---|---|
private Map<String,List<ServerName>> |
favoredNodesMap
The map between each region name and its favored region server list
|
Constructor and Description |
---|
FavoredNodesPlan() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<String,List<ServerName>> |
getAssignmentMap() |
List<ServerName> |
getFavoredNodes(RegionInfo region) |
static 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 assignment
|
int |
size() |
(package private) void |
updateFavoredNodesMap(FavoredNodesPlan fnp)
Add to existing Map of FavoredNodes.
|
void |
updateFavoredNodesMap(RegionInfo region,
List<ServerName> servers)
Update an assignment to the plan
|
private final Map<String,List<ServerName>> favoredNodesMap
public FavoredNodesPlan()
void updateFavoredNodesMap(FavoredNodesPlan fnp)
public void updateFavoredNodesMap(RegionInfo region, List<ServerName> servers)
List<ServerName> removeFavoredNodes(RegionInfo region)
public List<ServerName> getFavoredNodes(RegionInfo region)
public static FavoredNodesPlan.Position getFavoredServerPosition(List<ServerName> favoredNodes, ServerName server)
public Map<String,List<ServerName>> getAssignmentMap()
public int size()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.