Class RegionStateStore
java.lang.Object
org.apache.hadoop.hbase.master.assignment.RegionStateStore
Store Region State to hbase:meta table.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final MasterServicesprivate final MasterRegionprotected static final charThe delimiter for meta columns for replicaIds > 0private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate static voiddebugLogMutations(List<? extends Mutation> mutations) voiddeleteRegion(RegionInfo regionInfo) deleteRegionReplicas(ResultScanner scanner, int oldReplicaCount, int newReplicaCount, long now) voiddeleteRegions(List<RegionInfo> regions) private Tableprivate longprivate intstatic RegionState.StategetRegionState(Result r, RegionInfo regionInfo) Pull the region state from a catalog tableResult.private ScangetScanForUpdateRegionReplicas(TableName tableName) static byte[]getStateColumn(int replicaId) private TableDescriptorgetTableDescriptor(TableName tableName) private booleanprivate booleanhasGlobalReplicationScope(TableName tableName) voidmergeRegions(RegionInfo child, RegionInfo[] parents, ServerName serverName) private voidmirrorMetaLocation(RegionInfo regionInfo, ServerName serverName, RegionState.State state) private voidremoveMirrorMetaLocation(int oldReplicaCount, int newReplicaCount) voidremoveRegionReplicas(TableName tableName, int oldReplicaCount, int newReplicaCount) voidsplitRegion(RegionInfo parent, RegionInfo hriA, RegionInfo hriB, ServerName serverName) private voidupdateRegionLocation(RegionInfo regionInfo, RegionState.State state, Put put) (package private) voidupdateRegionLocation(RegionStateNode regionStateNode) voidstatic voidvisitMetaEntry(RegionStateStore.RegionStateVisitor visitor, Result result) voidvisitMetaForRegion(String regionEncodedName, RegionStateStore.RegionStateVisitor visitor) Queries META table for the passed region encoded name, delegating action upon results to theRegionStateVisitorpassed 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 theRegionStateVisitorpassed as second parameter.- Parameters:
regionEncodedName- encoded name for the Region we want to query META for.visitor- TheRegionStateVisitorinstance 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
-