public static class RegionStates.RegionStateNode extends Object implements Comparable<RegionStates.RegionStateNode>
Modifier and Type | Field and Description |
---|---|
private ProcedureEvent<?> |
event |
private ServerName |
lastHost |
private long |
lastUpdate
Updated whenever a call to
setRegionLocation(ServerName)
or #setState(State, State...) . |
private long |
openSeqNum |
private RegionTransitionProcedure |
procedure |
private RegionInfo |
regionInfo |
private ServerName |
regionLocation |
private RegionState.State |
state
A Region-in-Transition (RIT) moves through states.
|
Constructor and Description |
---|
RegionStateNode(RegionInfo regionInfo) |
private final RegionInfo regionInfo
private final ProcedureEvent<?> event
private volatile RegionTransitionProcedure procedure
private volatile ServerName regionLocation
private volatile ServerName lastHost
private volatile RegionState.State state
RegionState.State
for complete list. A Region that
is opened moves from OFFLINE => OPENING => OPENED.private volatile long lastUpdate
setRegionLocation(ServerName)
or #setState(State, State...)
.private volatile long openSeqNum
public RegionStateNode(RegionInfo regionInfo)
public boolean setState(RegionState.State update, RegionState.State... expected)
update
- new region state this node should be assigned.expected
- current state should be in this given list of expected statespublic ServerName offline()
public void transitionState(RegionState.State update, RegionState.State... expected) throws UnexpectedStateException
RegionState.State
but only if currently in expected
State
(if not, throw UnexpectedStateException
.UnexpectedStateException
public boolean isInState(RegionState.State... expected)
public boolean isStuck()
public boolean isInTransition()
public long getLastUpdate()
public void setLastHost(ServerName serverName)
public void setOpenSeqNum(long seqId)
public ServerName setRegionLocation(ServerName serverName)
public boolean setProcedure(RegionTransitionProcedure proc)
public boolean unsetProcedure(RegionTransitionProcedure proc)
public RegionTransitionProcedure getProcedure()
public ProcedureEvent<?> getProcedureEvent()
public RegionInfo getRegionInfo()
public boolean isSystemTable()
public ServerName getLastHost()
public ServerName getRegionLocation()
public RegionState.State getState()
public long getOpenSeqNum()
public int getFormatVersion()
public RegionState toRegionState()
public int compareTo(RegionStates.RegionStateNode other)
compareTo
in interface Comparable<RegionStates.RegionStateNode>
public String toShortString()
public String toDescriptiveString()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.