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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RegionInfoprivate longprivate final ServerNameprivate final longprivate final RegionState.State -
Constructor Summary
ConstructorsConstructorDescriptionRegionState(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.RegionStateconvert()Convert a RegionState to an HBaseProtos.RegionStatestatic RegionStateconvert(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState proto) Convert a protobuf HBaseProtos.RegionState to a RegionStatestatic RegionStatecreateForTesting(RegionInfo region, RegionState.State state) booleanCheck if two states are the same, except timestamplonglonggetStamp()getState()inthashCode()Don't count timestamp in hash code calculationbooleanisClosed()booleanbooleanbooleanbooleanbooleanbooleanisMerged()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisOnServer(ServerName sn) booleanisOpened()booleanbooleanbooleanbooleanbooleanCheck if a region state can transition to offlinebooleanCheck if a region state can transition to onlinebooleanisSplit()booleanbooleanbooleanbooleanbooleanbooleanbooleanCheck if a region state is one of offline states that can't transition to pending_close/closing (unassign/offline)static booleanisUnassignable(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) voidupdateRitDuration(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
-