@InterfaceAudience.Private public class RegionStates extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RegionStates.RegionFailedOpen |
| Modifier and Type | Field and Description |
|---|---|
static org.apache.hadoop.hbase.master.assignment.RegionStates.RegionStateStampComparator |
REGION_STATE_STAMP_COMPARATOR |
| Constructor and Description |
|---|
RegionStates() |
public static final org.apache.hadoop.hbase.master.assignment.RegionStates.RegionStateStampComparator REGION_STATE_STAMP_COMPARATOR
public void clear()
public boolean isRegionInRegionStates(RegionInfo hri)
public RegionStateNode getOrCreateRegionStateNode(RegionInfo regionInfo)
public RegionStateNode getRegionStateNodeFromName(byte[] regionName)
public RegionStateNode getRegionStateNodeFromEncodedRegionName(String encodedRegionName)
public RegionStateNode getRegionStateNode(RegionInfo regionInfo)
public void deleteRegion(RegionInfo regionInfo)
public void deleteRegions(List<RegionInfo> regionInfos)
public Collection<RegionStateNode> getRegionStateNodes()
public ArrayList<RegionState> getRegionStates()
public RegionState getRegionState(RegionInfo regionInfo)
public RegionState getRegionState(String encodedRegionName)
public boolean hasTableRegionStates(TableName tableName)
public List<RegionInfo> getRegionsOfTable(TableName table)
public List<HRegionLocation> getRegionsOfTableForReopen(TableName tableName)
openSeqNum in the returned HRegionLocation is also used to indicate the
state of this region, positive means the region is in RegionState.State.OPEN, -1 means
RegionState.State.OPENING. And for regions in other states we do not need reopen them.public HRegionLocation checkReopened(HRegionLocation oldLoc)
HRegionLocation is the
same with getRegionsOfTableForReopen(TableName).
For a region which is in RegionState.State.OPEN before, if the region state is changed or the open
seq num is changed, we can confirm that it has been reopened.
For a region which is in RegionState.State.OPENING before, usually it will be in RegionState.State.OPEN
now and we will schedule a MRP to reopen it. But there are several exceptions:
RegionState.State.OPEN or RegionState.State.OPENING.RegionState.State.OPENING state and still on the same
server, then here we will still return a HRegionLocation for it, just like
getRegionsOfTableForReopen(TableName).oldLoc - the previous state/location of this regionHRegionLocation which
means we still need to reopen the region.getRegionsOfTableForReopen(TableName)public List<RegionInfo> getRegionsOfTableForEnabling(TableName table)
public List<RegionInfo> getRegionsOfTableForDeleting(TableName table)
public void metaLogSplitting(ServerName serverName)
metaLogSplit(ServerName)public void metaLogSplit(ServerName serverName)
metaLogSplitting(ServerName)public void logSplitting(ServerName serverName)
logSplit(ServerName)public void logSplit(ServerName serverName)
logSplitting(ServerName)public void updateRegionState(RegionInfo regionInfo, RegionState.State state)
public List<RegionInfo> getAssignedRegions()
public boolean isRegionInState(RegionInfo regionInfo, RegionState.State... state)
public boolean isRegionOnline(RegionInfo regionInfo)
public boolean isRegionOffline(RegionInfo regionInfo)
public Map<ServerName,List<RegionInfo>> getSnapShotOfAssignment(Collection<RegionInfo> regions)
public Map<RegionInfo,ServerName> getRegionAssignments()
public Map<RegionState.State,List<RegionInfo>> getRegionByStateOfTable(TableName tableName)
public ServerName getRegionServerOfRegion(RegionInfo regionInfo)
public Map<TableName,Map<ServerName,List<RegionInfo>>> getAssignmentsForBalancer(TableStateManager tableStateManager, List<ServerName> onlineServers)
public boolean hasRegionsInTransition()
public boolean isRegionInTransition(RegionInfo regionInfo)
public RegionState getRegionTransitionState(RegionInfo hri)
public List<RegionStateNode> getRegionsInTransition()
public int getRegionsInTransitionCount()
public List<RegionState> getRegionsStateInTransition()
public SortedSet<RegionState> getRegionsInTransitionOrderedByTimestamp()
public void addToOfflineRegions(RegionStateNode regionNode)
public RegionStates.RegionFailedOpen addToFailedOpen(RegionStateNode regionNode)
public RegionStates.RegionFailedOpen getFailedOpen(RegionInfo regionInfo)
public void removeFromFailedOpen(RegionInfo regionInfo)
public List<RegionState> getRegionFailedOpen()
public void createServer(ServerName serverName)
public void removeServer(ServerName serverName)
public ServerStateNode getServerNode(ServerName serverName)
public double getAverageLoad()
public void addRegionToServer(RegionStateNode regionNode)
public void removeRegionFromServer(ServerName serverName, RegionStateNode regionNode)
public static String regionNamesToString(Collection<byte[]> regions)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.