@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() |
List<ServerName> |
removeFavoredNodes(RegionInfo region)
Remove a favored node assignment
|
void |
updateFavoredNodesMap(RegionInfo region,
List<ServerName> servers)
Update an assignment to the plan
|
private Map<String,List<ServerName>> favoredNodesMap
public FavoredNodesPlan()
public void updateFavoredNodesMap(RegionInfo region, List<ServerName> servers)
region
- servers
- public List<ServerName> removeFavoredNodes(RegionInfo region)
region
- regionpublic List<ServerName> getFavoredNodes(RegionInfo region)
region
- public static FavoredNodesPlan.Position getFavoredServerPosition(List<ServerName> favoredNodes, ServerName server)
favoredNodes
- server
- public Map<String,List<ServerName>> getAssignmentMap()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.