@InterfaceAudience.Private public class RegionStateStore extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RegionStateStore.RegionStateVisitor |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private MasterServices |
master |
private MasterRegion |
masterRegion |
protected static char |
META_REPLICA_ID_DELIMITER
The delimiter for meta columns for replicaIds > 0
|
private static org.slf4j.Logger |
METALOG |
Constructor and Description |
---|
RegionStateStore(MasterServices master,
MasterRegion masterRegion) |
Modifier and Type | Method and Description |
---|---|
private static void |
debugLogMutation(Mutation p) |
private static void |
debugLogMutations(List<? extends Mutation> mutations) |
void |
deleteRegion(RegionInfo regionInfo) |
private List<Delete> |
deleteRegionReplicas(ResultScanner scanner,
int oldReplicaCount,
int newReplicaCount,
long now) |
void |
deleteRegions(List<RegionInfo> regions) |
private Table |
getMetaTable() |
private long |
getOpenSeqNumForParentRegion(RegionInfo region) |
private int |
getRegionReplication(TableDescriptor htd) |
static RegionState.State |
getRegionState(Result r,
RegionInfo regionInfo)
Pull the region state from a catalog table
Result . |
private Scan |
getScanForUpdateRegionReplicas(TableName tableName) |
static byte[] |
getStateColumn(int replicaId) |
private TableDescriptor |
getTableDescriptor(TableName tableName) |
private boolean |
hasGlobalReplicationScope(TableDescriptor htd) |
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 |
visitMeta(RegionStateStore.RegionStateVisitor visitor) |
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 the
RegionStateVisitor passed as second parameter. |
private static final org.slf4j.Logger LOG
private static final org.slf4j.Logger METALOG
protected static final char META_REPLICA_ID_DELIMITER
private final MasterServices master
private final MasterRegion masterRegion
public RegionStateStore(MasterServices master, MasterRegion masterRegion)
public void visitMeta(RegionStateStore.RegionStateVisitor visitor) throws IOException
IOException
public void visitMetaForRegion(String regionEncodedName, RegionStateStore.RegionStateVisitor visitor) throws IOException
RegionStateVisitor
passed as second parameter.regionEncodedName
- encoded name for the Region we want to query META for.visitor
- The RegionStateVisitor
instance to react over the query
results.IOException
- If some error occurs while querying META or parsing results.public static void visitMetaEntry(RegionStateStore.RegionStateVisitor visitor, Result result) throws IOException
IOException
void updateRegionLocation(RegionStateNode regionStateNode) throws IOException
IOException
private void mirrorMetaLocation(RegionInfo regionInfo, ServerName serverName, RegionState.State state) throws IOException
IOException
private void removeMirrorMetaLocation(int oldReplicaCount, int newReplicaCount) throws IOException
IOException
private void updateRegionLocation(RegionInfo regionInfo, RegionState.State state, Put put) throws IOException
IOException
private long getOpenSeqNumForParentRegion(RegionInfo region) throws IOException
IOException
private Table getMetaTable() throws IOException
IOException
public void splitRegion(RegionInfo parent, RegionInfo hriA, RegionInfo hriB, ServerName serverName) throws IOException
IOException
public void mergeRegions(RegionInfo child, RegionInfo[] parents, ServerName serverName) throws IOException
IOException
public void deleteRegion(RegionInfo regionInfo) throws IOException
IOException
public void deleteRegions(List<RegionInfo> regions) throws IOException
IOException
private Scan getScanForUpdateRegionReplicas(TableName tableName)
private List<Delete> deleteRegionReplicas(ResultScanner scanner, int oldReplicaCount, int newReplicaCount, long now) throws IOException
IOException
public void removeRegionReplicas(TableName tableName, int oldReplicaCount, int newReplicaCount) throws IOException
IOException
private boolean hasGlobalReplicationScope(TableName tableName) throws IOException
IOException
private boolean hasGlobalReplicationScope(TableDescriptor htd)
private int getRegionReplication(TableDescriptor htd)
private TableDescriptor getTableDescriptor(TableName tableName) throws IOException
IOException
public static RegionState.State getRegionState(Result r, RegionInfo regionInfo)
Result
.public static byte[] getStateColumn(int replicaId)
private static void debugLogMutations(List<? extends Mutation> mutations) throws IOException
IOException
private static void debugLogMutation(Mutation p) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.