@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
tools that only read or fortest cases). All other classes including Favored balancers and
FavoredNodeAssignmentHelper
should use FavoredNodesManager
for any
read/write/deletes to favored nodes.Modifier and Type | Field and Description |
---|---|
private int |
datanodeDataTransferPort
Datanode port to be used for Favored Nodes.
|
private FavoredNodesPlan |
globalFavoredNodesAssignmentPlan |
private static org.slf4j.Logger |
LOG |
private MasterServices |
masterServices |
private Map<ServerName,List<RegionInfo>> |
primaryRSToRegionMap |
private RackManager |
rackManager |
private Map<ServerName,List<RegionInfo>> |
secondaryRSToRegionMap |
private Map<ServerName,List<RegionInfo>> |
teritiaryRSToRegionMap |
Constructor and Description |
---|
FavoredNodesManager(MasterServices masterServices) |
Modifier and Type | Method and Description |
---|---|
private void |
addToReplicaLoad(RegionInfo hri,
List<ServerName> servers) |
void |
deleteFavoredNodesForRegion(RegionInfo regionInfo) |
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 snapshot) |
static boolean |
isFavoredNodeApplicable(RegionInfo regionInfo) |
void |
updateFavoredNodes(Map<RegionInfo,List<ServerName>> regionFNMap) |
private static final org.slf4j.Logger LOG
private final FavoredNodesPlan globalFavoredNodesAssignmentPlan
private final Map<ServerName,List<RegionInfo>> primaryRSToRegionMap
private final Map<ServerName,List<RegionInfo>> secondaryRSToRegionMap
private final Map<ServerName,List<RegionInfo>> teritiaryRSToRegionMap
private final MasterServices masterServices
private final RackManager rackManager
private int datanodeDataTransferPort
public FavoredNodesManager(MasterServices masterServices)
public void initialize(SnapshotOfRegionAssignmentFromMeta snapshot)
public int getDataNodePort()
public List<ServerName> getFavoredNodes(RegionInfo regionInfo)
public static boolean isFavoredNodeApplicable(RegionInfo regionInfo)
public static Set<RegionInfo> filterNonFNApplicableRegions(Collection<RegionInfo> regions)
public List<ServerName> getFavoredNodesWithDNPort(RegionInfo regionInfo)
public void updateFavoredNodes(Map<RegionInfo,List<ServerName>> regionFNMap) throws IOException
IOException
private void addToReplicaLoad(RegionInfo hri, List<ServerName> servers)
public Map<ServerName,List<Integer>> getReplicaLoad(List<ServerName> servers)
public void deleteFavoredNodesForRegion(RegionInfo regionInfo)
public void deleteFavoredNodesForRegions(Collection<RegionInfo> regionInfoList)
public Set<RegionInfo> getRegionsOfFavoredNode(ServerName serverName)
public RackManager getRackManager()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.