@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 |
protected static char |
META_REPLICA_ID_DELIMITER
The delimiter for meta columns for replicaIds > 0
|
Constructor and Description |
---|
RegionStateStore(MasterServices master) |
Modifier and Type | Method and Description |
---|---|
void |
deleteRegion(RegionInfo regionInfo) |
void |
deleteRegions(List<RegionInfo> regions) |
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 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) |
void |
splitRegion(RegionInfo parent,
RegionInfo hriA,
RegionInfo hriB,
ServerName serverName) |
private void |
updateMetaLocation(RegionInfo regionInfo,
ServerName serverName,
RegionState.State state) |
private void |
updateRegionLocation(RegionInfo regionInfo,
RegionState.State state,
Put put) |
(package private) void |
updateRegionLocation(RegionStateNode regionStateNode) |
private void |
updateUserRegionLocation(RegionInfo regionInfo,
RegionState.State state,
ServerName regionLocation,
long openSeqNum,
long pid) |
void |
visitMeta(RegionStateStore.RegionStateVisitor visitor) |
private 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
protected static final char META_REPLICA_ID_DELIMITER
private final MasterServices master
public RegionStateStore(MasterServices master)
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.private void visitMetaEntry(RegionStateStore.RegionStateVisitor visitor, Result result) throws IOException
IOException
void updateRegionLocation(RegionStateNode regionStateNode) throws IOException
IOException
private void updateMetaLocation(RegionInfo regionInfo, ServerName serverName, RegionState.State state) throws IOException
IOException
private void updateUserRegionLocation(RegionInfo regionInfo, RegionState.State state, ServerName regionLocation, long openSeqNum, long pid) throws IOException
IOException
private void updateRegionLocation(RegionInfo regionInfo, RegionState.State state, Put put) throws IOException
IOException
private long getOpenSeqNumForParentRegion(RegionInfo region) 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 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
.private static byte[] getStateColumn(int replicaId)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.