@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 |
---|---|
(package private) static Put |
addMergeRegions(Put put,
Collection<RegionInfo> mergeRegions) |
private static Put |
addSequenceNum(Put p,
long openSeqNum,
int replicaId) |
private static void |
debugLogMutation(Mutation p) |
private static void |
debugLogMutations(List<? extends Mutation> mutations) |
void |
deleteMergeQualifiers(RegionInfo mergeRegion)
Deletes merge qualifiers for the specified merge region.
|
void |
deleteRegion(RegionInfo regionInfo)
Deletes the specified region.
|
private List<Delete> |
deleteRegionReplicas(ResultScanner scanner,
int oldReplicaCount,
int newReplicaCount,
long now) |
void |
deleteRegions(List<RegionInfo> regions)
Deletes the specified regions.
|
private void |
deleteRegions(List<RegionInfo> regions,
long ts) |
private Put |
generateUpdateRegionLocationPut(RegionStateNode regionStateNode) |
private TableDescriptor |
getDescriptor(TableName tableName) |
List<RegionInfo> |
getMergeRegions(RegionInfo region)
Returns Return all regioninfos listed in the 'info:merge*' columns of the given
region . |
private Table |
getMetaTable() |
private long |
getOpenSeqNumForParentRegion(RegionInfo region) |
private Result |
getRegionCatalogResult(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 boolean |
hasGlobalReplicationScope(TableDescriptor htd) |
private boolean |
hasGlobalReplicationScope(TableName tableName) |
boolean |
hasMergeRegions(RegionInfo region)
Check whether the given
region has any 'info:merge*' columns. |
void |
mergeRegions(RegionInfo child,
RegionInfo[] parents,
ServerName serverName,
TableDescriptor htd) |
private void |
mirrorMetaLocation(RegionInfo regionInfo,
ServerName serverName,
RegionState.State state) |
private void |
multiMutate(RegionInfo ri,
List<Mutation> mutations)
Performs an atomic multi-mutate operation against the given table.
|
void |
overwriteRegions(List<RegionInfo> regionInfos,
int regionReplication)
Overwrites the specified regions from hbase:meta.
|
private void |
removeMirrorMetaLocation(int oldReplicaCount,
int newReplicaCount) |
void |
removeRegionReplicas(TableName tableName,
int oldReplicaCount,
int newReplicaCount) |
void |
splitRegion(RegionInfo parent,
RegionInfo splitA,
RegionInfo splitB,
ServerName serverName,
TableDescriptor htd)
Splits the region into two in an atomic operation.
|
private CompletableFuture<Void> |
updateRegionLocation(RegionInfo regionInfo,
RegionState.State state,
Put put) |
(package private) CompletableFuture<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
private Put generateUpdateRegionLocationPut(RegionStateNode regionStateNode) throws IOException
IOException
CompletableFuture<Void> updateRegionLocation(RegionStateNode regionStateNode)
private void mirrorMetaLocation(RegionInfo regionInfo, ServerName serverName, RegionState.State state) throws IOException
IOException
private void removeMirrorMetaLocation(int oldReplicaCount, int newReplicaCount) throws IOException
IOException
private CompletableFuture<Void> updateRegionLocation(RegionInfo regionInfo, RegionState.State state, Put put)
private long getOpenSeqNumForParentRegion(RegionInfo region) throws IOException
IOException
private void multiMutate(RegionInfo ri, List<Mutation> mutations) throws IOException
IOException
private Table getMetaTable() throws IOException
IOException
private Result getRegionCatalogResult(RegionInfo region) throws IOException
IOException
private static Put addSequenceNum(Put p, long openSeqNum, int replicaId) throws IOException
IOException
public void splitRegion(RegionInfo parent, RegionInfo splitA, RegionInfo splitB, ServerName serverName, TableDescriptor htd) throws IOException
IOException
public void mergeRegions(RegionInfo child, RegionInfo[] parents, ServerName serverName, TableDescriptor htd) throws IOException
IOException
public boolean hasMergeRegions(RegionInfo region) throws IOException
region
has any 'info:merge*' columns.IOException
public List<RegionInfo> getMergeRegions(RegionInfo region) throws IOException
region
.IOException
public void deleteMergeQualifiers(RegionInfo mergeRegion) throws IOException
connection
- connection we're usingmergeRegion
- the merged regionIOException
static Put addMergeRegions(Put put, Collection<RegionInfo> mergeRegions) throws IOException
IOException
public void deleteRegion(RegionInfo regionInfo) throws IOException
IOException
public void deleteRegions(List<RegionInfo> regions) throws IOException
IOException
private void deleteRegions(List<RegionInfo> regions, long ts) throws IOException
IOException
public void overwriteRegions(List<RegionInfo> regionInfos, int regionReplication) throws IOException
connection
- connection we're usingregionInfos
- list of regions to be added to METAIOException
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 getDescriptor(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.