Class RegionStateStore
java.lang.Object
org.apache.hadoop.hbase.master.assignment.RegionStateStore
Store Region State to hbase:meta table.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final MasterServices
private final MasterRegion
protected static final char
The delimiter for meta columns for replicaIds > 0private static final org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
private static void
debugLogMutations
(List<? extends Mutation> mutations) void
deleteRegion
(RegionInfo regionInfo) deleteRegionReplicas
(ResultScanner scanner, int oldReplicaCount, int newReplicaCount, long now) void
deleteRegions
(List<RegionInfo> regions) private Table
private long
private int
static RegionState.State
getRegionState
(Result r, RegionInfo regionInfo) Pull the region state from a catalog tableResult
.private Scan
getScanForUpdateRegionReplicas
(TableName tableName) static byte[]
getStateColumn
(int replicaId) private TableDescriptor
getTableDescriptor
(TableName tableName) private boolean
private boolean
hasGlobalReplicationScope
(TableName tableName) void
mergeRegions
(RegionInfo child, RegionInfo[] parents, ServerName serverName) private void
mirrorMetaLocation
(RegionInfo regionInfo, ServerName serverName, RegionState.State state) private void
removeMirrorMetaLocation
(int oldReplicaCount, int newReplicaCount) void
removeRegionReplicas
(TableName tableName, int oldReplicaCount, int newReplicaCount) void
splitRegion
(RegionInfo parent, RegionInfo hriA, RegionInfo hriB, ServerName serverName) private void
updateRegionLocation
(RegionInfo regionInfo, RegionState.State state, Put put) (package private) void
updateRegionLocation
(RegionStateNode regionStateNode) void
static void
visitMetaEntry
(RegionStateStore.RegionStateVisitor visitor, Result result) void
visitMetaForRegion
(String regionEncodedName, RegionStateStore.RegionStateVisitor visitor) Queries META table for the passed region encoded name, delegating action upon results to theRegionStateVisitor
passed as second parameter.
-
Field Details
-
LOG
-
METALOG
-
META_REPLICA_ID_DELIMITER
The delimiter for meta columns for replicaIds > 0- See Also:
-
master
-
masterRegion
-
-
Constructor Details
-
RegionStateStore
-
-
Method Details
-
visitMeta
- Throws:
IOException
-
visitMetaForRegion
public void visitMetaForRegion(String regionEncodedName, RegionStateStore.RegionStateVisitor visitor) throws IOException Queries META table for the passed region encoded name, delegating action upon results to theRegionStateVisitor
passed as second parameter.- Parameters:
regionEncodedName
- encoded name for the Region we want to query META for.visitor
- TheRegionStateVisitor
instance to react over the query results.- Throws:
IOException
- If some error occurs while querying META or parsing results.
-
visitMetaEntry
public static void visitMetaEntry(RegionStateStore.RegionStateVisitor visitor, Result result) throws IOException - Throws:
IOException
-
updateRegionLocation
- Throws:
IOException
-
mirrorMetaLocation
private void mirrorMetaLocation(RegionInfo regionInfo, ServerName serverName, RegionState.State state) throws IOException - Throws:
IOException
-
removeMirrorMetaLocation
- Throws:
IOException
-
updateRegionLocation
private void updateRegionLocation(RegionInfo regionInfo, RegionState.State state, Put put) throws IOException - Throws:
IOException
-
getOpenSeqNumForParentRegion
- Throws:
IOException
-
getMetaTable
- Throws:
IOException
-
splitRegion
public void splitRegion(RegionInfo parent, RegionInfo hriA, RegionInfo hriB, ServerName serverName) throws IOException - Throws:
IOException
-
mergeRegions
public void mergeRegions(RegionInfo child, RegionInfo[] parents, ServerName serverName) throws IOException - Throws:
IOException
-
deleteRegion
- Throws:
IOException
-
deleteRegions
- Throws:
IOException
-
getScanForUpdateRegionReplicas
-
deleteRegionReplicas
private List<Delete> deleteRegionReplicas(ResultScanner scanner, int oldReplicaCount, int newReplicaCount, long now) throws IOException - Throws:
IOException
-
removeRegionReplicas
public void removeRegionReplicas(TableName tableName, int oldReplicaCount, int newReplicaCount) throws IOException - Throws:
IOException
-
hasGlobalReplicationScope
- Throws:
IOException
-
hasGlobalReplicationScope
-
getRegionReplication
-
getTableDescriptor
- Throws:
IOException
-
getRegionState
Pull the region state from a catalog tableResult
.- Returns:
- the region state, or null if unknown.
-
getStateColumn
-
debugLogMutations
- Throws:
IOException
-
debugLogMutation
- Throws:
IOException
-