@InterfaceAudience.Private public class RegionState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RegionState.State |
Modifier and Type | Field and Description |
---|---|
private RegionInfo |
hri |
private long |
ritDuration |
private ServerName |
serverName |
private long |
stamp |
private RegionState.State |
state |
Constructor and Description |
---|
RegionState(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) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState |
convert()
Convert a RegionState to an HBaseProtos.RegionState
|
static RegionState |
convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState proto)
Convert a protobuf HBaseProtos.RegionState to a RegionState
|
static RegionState |
createForTesting(RegionInfo region,
RegionState.State state) |
boolean |
equals(Object obj)
Check if two states are the same, except timestamp
|
RegionInfo |
getRegion() |
long |
getRitDuration() |
ServerName |
getServerName() |
long |
getStamp() |
RegionState.State |
getState() |
int |
hashCode()
Don't count timestamp in hash code calculation
|
boolean |
isClosed() |
boolean |
isClosedOrAbnormallyClosed() |
boolean |
isClosing() |
boolean |
isClosingOrClosedOnServer(ServerName sn) |
boolean |
isFailedClose() |
boolean |
isFailedOpen() |
boolean |
isMerged() |
boolean |
isMerging() |
boolean |
isMergingNew() |
boolean |
isMergingNewOnServer(ServerName sn) |
boolean |
isMergingNewOrOfflineOnServer(ServerName sn) |
boolean |
isMergingNewOrOpenedOnServer(ServerName sn) |
boolean |
isMergingOnServer(ServerName sn) |
boolean |
isOffline() |
boolean |
isOnServer(ServerName sn) |
boolean |
isOpened() |
boolean |
isOpenedOnServer(ServerName sn) |
boolean |
isOpening() |
boolean |
isOpeningOrFailedOpenOnServer(ServerName sn) |
boolean |
isOpeningOrOpenedOnServer(ServerName sn) |
boolean |
isReadyToOffline()
Check if a region state can transition to offline
|
boolean |
isReadyToOnline()
Check if a region state can transition to online
|
boolean |
isSplit() |
boolean |
isSplitting() |
boolean |
isSplittingNew() |
boolean |
isSplittingNewOnServer(ServerName sn) |
boolean |
isSplittingOnServer(ServerName sn) |
boolean |
isSplittingOrOpenedOnServer(ServerName sn) |
boolean |
isSplittingOrSplitOnServer(ServerName sn) |
boolean |
isUnassignable()
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)
|
String |
toDescriptiveString()
A slower (but more easy-to-read) stringification
|
String |
toString() |
(package private) void |
updateRitDuration(long previousStamp)
Update the duration of region in transition
|
private final long stamp
private final RegionInfo hri
private final ServerName serverName
private final RegionState.State state
private long ritDuration
public RegionState(RegionInfo region, RegionState.State state, ServerName serverName)
public RegionState(RegionInfo region, RegionState.State state, long stamp, ServerName serverName)
public RegionState(RegionInfo region, RegionState.State state, long stamp, ServerName serverName, long ritDuration)
public static RegionState createForTesting(RegionInfo region, RegionState.State state)
public RegionState.State getState()
public long getStamp()
public RegionInfo getRegion()
public ServerName getServerName()
public long getRitDuration()
@InterfaceAudience.Private void updateRitDuration(long previousStamp)
previousStamp
- previous RegionState's timestamppublic boolean isClosing()
public boolean isClosed()
public boolean isClosedOrAbnormallyClosed()
public boolean isOpening()
public boolean isOpened()
public boolean isOffline()
public boolean isSplitting()
public boolean isSplit()
public boolean isSplittingNew()
public boolean isFailedOpen()
public boolean isFailedClose()
public boolean isMerging()
public boolean isMerged()
public boolean isMergingNew()
public boolean isOnServer(ServerName sn)
public boolean isMergingOnServer(ServerName sn)
public boolean isMergingNewOnServer(ServerName sn)
public boolean isMergingNewOrOpenedOnServer(ServerName sn)
public boolean isMergingNewOrOfflineOnServer(ServerName sn)
public boolean isSplittingOnServer(ServerName sn)
public boolean isSplittingNewOnServer(ServerName sn)
public boolean isSplittingOrOpenedOnServer(ServerName sn)
public boolean isSplittingOrSplitOnServer(ServerName sn)
public boolean isClosingOrClosedOnServer(ServerName sn)
public boolean isOpeningOrFailedOpenOnServer(ServerName sn)
public boolean isOpeningOrOpenedOnServer(ServerName sn)
public boolean isOpenedOnServer(ServerName sn)
public boolean isReadyToOffline()
public boolean isReadyToOnline()
public boolean isUnassignable()
public static boolean isUnassignable(RegionState.State state)
public String toDescriptiveString()
public org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState convert()
public static RegionState convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionState proto)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.