Package org.apache.hadoop.hbase.master
Class SnapshotOfRegionAssignmentFromMeta
java.lang.Object
org.apache.hadoop.hbase.master.SnapshotOfRegionAssignmentFromMeta
Used internally for reading meta and constructing datastructures that are then queried, for
things like regions to regionservers, table to regions, etc. It also records the favored nodes
mapping for regions.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Connection
private final Map<ServerName,
List<RegionInfo>> the regionServer to region mapprivate final boolean
private final FavoredNodesPlan
the existing assignment plan in the hbase:meta regionprivate static final org.slf4j.Logger
private final Map<ServerName,
List<RegionInfo>> private final Map<String,
RegionInfo> the region name to region info mapprivate Map<RegionInfo,
ServerName> the region to region server mapprivate final Map<ServerName,
List<RegionInfo>> private final Map<TableName,
List<RegionInfo>> the table name to region mapprivate final Map<ServerName,
List<RegionInfo>> -
Constructor Summary
ConstructorDescriptionSnapshotOfRegionAssignmentFromMeta
(Connection connection) SnapshotOfRegionAssignmentFromMeta
(Connection connection, Set<TableName> disabledTables, boolean excludeOfflinedSplitParents) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addAssignment
(RegionInfo regionInfo, ServerName server) private void
addPrimaryAssignment
(RegionInfo regionInfo, ServerName server) private void
addRegion
(RegionInfo regionInfo) private void
addSecondaryAssignment
(RegionInfo regionInfo, ServerName server) private void
addTeritiaryAssignment
(RegionInfo regionInfo, ServerName server) Get the favored nodes planGet the regioninfo for a regionGet regionserver to region mapGet region to region server mapGet the table setGet regions for tablesvoid
Initialize the region assignment snapshot by scanning the hbase:meta tableprivate void
processMetaRecord
(Result result)
-
Field Details
-
LOG
-
connection
-
tableToRegionMap
the table name to region map -
regionToRegionServerMap
the region to region server map -
regionNameToRegionInfoMap
the region name to region info map -
currentRSToRegionMap
the regionServer to region map -
secondaryRSToRegionMap
-
teritiaryRSToRegionMap
-
-
existingAssignmentPlan
the existing assignment plan in the hbase:meta region -
disabledTables
-
excludeOfflinedSplitParents
-
-
Constructor Details
-
SnapshotOfRegionAssignmentFromMeta
-
SnapshotOfRegionAssignmentFromMeta
public SnapshotOfRegionAssignmentFromMeta(Connection connection, Set<TableName> disabledTables, boolean excludeOfflinedSplitParents)
-
-
Method Details
-
processMetaRecord
- Throws:
IOException
-
initialize
Initialize the region assignment snapshot by scanning the hbase:meta table- Throws:
IOException
-
addRegion
-
addAssignment
-
addPrimaryAssignment
-
addSecondaryAssignment
-
addTeritiaryAssignment
-
getRegionNameToRegionInfoMap
Get the regioninfo for a region- Returns:
- the regioninfo
-
getTableToRegionMap
Get regions for tables- Returns:
- a mapping from table to regions
-
getRegionToRegionServerMap
Get region to region server map- Returns:
- region to region server map
-
getRegionServerToRegionMap
Get regionserver to region map- Returns:
- regionserver to region map
-
getExistingAssignmentPlan
Get the favored nodes plan- Returns:
- the existing favored nodes plan
-
getTableSet
Get the table set- Returns:
- the table set
-
getSecondaryToRegionInfoMap
-
getTertiaryToRegionInfoMap
-
getPrimaryToRegionInfoMap
-