Package org.apache.hadoop.hbase.master
Class RegionState
java.lang.Object
org.apache.hadoop.hbase.master.RegionState
State of a Region while undergoing transitions. This class is immutable.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final RegionInfo
private long
private final ServerName
private final long
private final RegionState.State
-
Constructor Summary
ConstructorDescriptionRegionState
(RegionInfo region, RegionState.State state, long stamp, ServerName serverName) RegionState
(RegionInfo region, RegionState.State state, long stamp, ServerName serverName, long ritDuration) RegionState
(RegionInfo region, RegionState.State state, ServerName serverName) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState
convert()
Convert a RegionState to an HBaseProtos.RegionStatestatic RegionState
convert
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState proto) Convert a protobuf HBaseProtos.RegionState to a RegionStatestatic RegionState
createForTesting
(RegionInfo region, RegionState.State state) boolean
Check if two states are the same, except timestamplong
long
getStamp()
getState()
int
hashCode()
Don't count timestamp in hash code calculationboolean
isClosed()
boolean
boolean
boolean
boolean
boolean
boolean
isMerged()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isOnServer
(ServerName sn) boolean
isOpened()
boolean
boolean
boolean
boolean
boolean
Check if a region state can transition to offlineboolean
Check if a region state can transition to onlineboolean
isSplit()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Check if a region state is one of offline states that can't transition to pending_close/closing (unassign/offline)static boolean
isUnassignable
(RegionState.State state) Check if a region state is one of offline states that can't transition to pending_close/closing (unassign/offline)A slower (but more easy-to-read) stringificationtoString()
(package private) void
updateRitDuration
(long previousStamp) Update the duration of region in transition
-
Field Details
-
stamp
-
hri
-
serverName
-
state
-
ritDuration
-
-
Constructor Details
-
RegionState
-
RegionState
-
RegionState
public RegionState(RegionInfo region, RegionState.State state, long stamp, ServerName serverName, long ritDuration)
-
-
Method Details
-
createForTesting
-
getState
-
getStamp
-
getRegion
-
getServerName
-
getRitDuration
-
updateRitDuration
Update the duration of region in transition- Parameters:
previousStamp
- previous RegionState's timestamp
-
isClosing
-
isClosed
-
isClosedOrAbnormallyClosed
-
isOpening
-
isOpened
-
isOffline
-
isSplitting
-
isSplit
-
isSplittingNew
-
isFailedOpen
-
isFailedClose
-
isMerging
-
isMerged
-
isMergingNew
-
isOnServer
-
isMergingOnServer
-
isMergingNewOnServer
-
isMergingNewOrOpenedOnServer
-
isMergingNewOrOfflineOnServer
-
isSplittingOnServer
-
isSplittingNewOnServer
-
isSplittingOrOpenedOnServer
-
isSplittingOrSplitOnServer
-
isClosingOrClosedOnServer
-
isOpeningOrFailedOpenOnServer
-
isOpeningOrOpenedOnServer
-
isOpenedOnServer
-
isReadyToOffline
Check if a region state can transition to offline -
isReadyToOnline
Check if a region state can transition to online -
isUnassignable
Check if a region state is one of offline states that can't transition to pending_close/closing (unassign/offline) -
isUnassignable
Check if a region state is one of offline states that can't transition to pending_close/closing (unassign/offline) -
toString
-
toDescriptiveString
A slower (but more easy-to-read) stringification -
convert
Convert a RegionState to an HBaseProtos.RegionState- Returns:
- the converted HBaseProtos.RegionState
-
convert
public static RegionState convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState proto) Convert a protobuf HBaseProtos.RegionState to a RegionState- Returns:
- the RegionState
-
equals
Check if two states are the same, except timestamp -
hashCode
Don't count timestamp in hash code calculation
-