@InterfaceAudience.Private public class FavoredNodesManager extends Object
FavoredNodesManager in Master. FavoredNodesPlan and favored node information
from SnapshotOfRegionAssignmentFromMeta should not be used outside this class (except
for may be tools that only read or test cases). All other classes including Favored balancers
and FavoredNodeAssignmentHelper should use FavoredNodesManager for any
read/write/deletes to favored nodes.| Constructor and Description |
|---|
FavoredNodesManager(MasterServices masterServices) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteFavoredNodesForRegions(Collection<RegionInfo> regionInfoList) |
static Set<RegionInfo> |
filterNonFNApplicableRegions(Collection<RegionInfo> regions)
Filter and return regions for which favored nodes is not applicable.
|
int |
getDataNodePort() |
List<ServerName> |
getFavoredNodes(RegionInfo regionInfo) |
List<ServerName> |
getFavoredNodesWithDNPort(RegionInfo regionInfo) |
RackManager |
getRackManager() |
Set<RegionInfo> |
getRegionsOfFavoredNode(ServerName serverName) |
Map<ServerName,List<Integer>> |
getReplicaLoad(List<ServerName> servers) |
void |
initialize(SnapshotOfRegionAssignmentFromMeta snapshotOfRegionAssignment) |
static boolean |
isFavoredNodeApplicable(RegionInfo regionInfo) |
void |
updateFavoredNodes(Map<RegionInfo,List<ServerName>> regionFNMap) |
public FavoredNodesManager(MasterServices masterServices)
public void initialize(SnapshotOfRegionAssignmentFromMeta snapshotOfRegionAssignment) throws HBaseIOException
HBaseIOExceptionpublic int getDataNodePort()
public List<ServerName> getFavoredNodes(RegionInfo regionInfo)
public static boolean isFavoredNodeApplicable(RegionInfo regionInfo)
public static Set<RegionInfo> filterNonFNApplicableRegions(Collection<RegionInfo> regions)
regions - - collection of regionspublic List<ServerName> getFavoredNodesWithDNPort(RegionInfo regionInfo)
public void updateFavoredNodes(Map<RegionInfo,List<ServerName>> regionFNMap) throws IOException
IOExceptionpublic Map<ServerName,List<Integer>> getReplicaLoad(List<ServerName> servers)
public void deleteFavoredNodesForRegions(Collection<RegionInfo> regionInfoList)
public Set<RegionInfo> getRegionsOfFavoredNode(ServerName serverName)
public RackManager getRackManager()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.