Package org.apache.hadoop.hbase.favored
Class FavoredNodesManager
java.lang.Object
org.apache.hadoop.hbase.favored.FavoredNodesManager
FavoredNodesManager is responsible for maintaining favored nodes info in internal cache and META
table. Its the centralized store for all favored nodes information. All reads and updates should
be done through this class. There should only be one instance of
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intDatanode port to be used for Favored Nodes.private final FavoredNodesPlanprivate static final org.slf4j.Loggerprivate final MasterServicesprivate final Map<ServerName,List<RegionInfo>> private final RackManagerprivate final Map<ServerName,List<RegionInfo>> private final Map<ServerName,List<RegionInfo>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToReplicaLoad(RegionInfo hri, List<ServerName> servers) voiddeleteFavoredNodesForRegion(RegionInfo regionInfo) voiddeleteFavoredNodesForRegions(Collection<RegionInfo> regionInfoList) static Set<RegionInfo>filterNonFNApplicableRegions(Collection<RegionInfo> regions) Filter and return regions for which favored nodes is not applicable.intgetFavoredNodes(RegionInfo regionInfo) getFavoredNodesWithDNPort(RegionInfo regionInfo) getRegionsOfFavoredNode(ServerName serverName) getReplicaLoad(List<ServerName> servers) voidinitialize(SnapshotOfRegionAssignmentFromMeta snapshot) static booleanisFavoredNodeApplicable(RegionInfo regionInfo) voidupdateFavoredNodes(Map<RegionInfo, List<ServerName>> regionFNMap)
-
Field Details
-
LOG
-
globalFavoredNodesAssignmentPlan
-
-
secondaryRSToRegionMap
-
teritiaryRSToRegionMap
-
masterServices
-
rackManager
-
datanodeDataTransferPort
Datanode port to be used for Favored Nodes.
-
-
Constructor Details
-
FavoredNodesManager
-
-
Method Details
-
initialize
-
getDataNodePort
-
getFavoredNodes
-
isFavoredNodeApplicable
-
filterNonFNApplicableRegions
Filter and return regions for which favored nodes is not applicable.- Returns:
- set of regions for which favored nodes is not applicable
-
getFavoredNodesWithDNPort
-
updateFavoredNodes
- Throws:
IOException
-
addToReplicaLoad
-
getReplicaLoad
-
deleteFavoredNodesForRegion
-
deleteFavoredNodesForRegions
-
getRegionsOfFavoredNode
-
getRackManager
-