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
Modifier and TypeFieldDescriptionprivate int
Datanode port to be used for Favored Nodes.private final FavoredNodesPlan
private static final org.slf4j.Logger
private final MasterServices
private final Map<ServerName,
List<RegionInfo>> private final RackManager
private final Map<ServerName,
List<RegionInfo>> private final Map<ServerName,
List<RegionInfo>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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
getFavoredNodes
(RegionInfo regionInfo) getFavoredNodesWithDNPort
(RegionInfo regionInfo) getRegionsOfFavoredNode
(ServerName serverName) getReplicaLoad
(List<ServerName> servers) void
initialize
(SnapshotOfRegionAssignmentFromMeta snapshot) static boolean
isFavoredNodeApplicable
(RegionInfo regionInfo) void
updateFavoredNodes
(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
-