ActiveState, BackupState, StandbyState@Private
public abstract class HAState
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected org.apache.hadoop.ha.HAServiceProtocol.HAServiceState |
state |
| Constructor | Description |
|---|---|
HAState(org.apache.hadoop.ha.HAServiceProtocol.HAServiceState state) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
checkOperation(HAContext context,
NameNode.OperationCategory op) |
Check if an operation is supported in a given state.
|
abstract void |
enterState(HAContext context) |
Method to be overridden by subclasses to perform steps necessary for
entering a state.
|
abstract void |
exitState(HAContext context) |
Method to be overridden by subclasses to perform steps necessary for
exiting a state.
|
long |
getLastHATransitionTime() |
Gets the most recent HA transition time in milliseconds from the epoch.
|
org.apache.hadoop.ha.HAServiceProtocol.HAServiceState |
getServiceState() |
|
void |
prepareToEnterState(HAContext context) |
Method to be overridden by subclasses to prepare to enter a state.
|
void |
prepareToExitState(HAContext context) |
Method to be overridden by subclasses to prepare to exit a state.
|
void |
setState(HAContext context,
HAState s) |
Move from the existing state to a new state
|
protected void |
setStateInternal(HAContext context,
HAState s) |
Internal method to move from the existing state to a new state.
|
abstract boolean |
shouldPopulateReplQueues() |
|
java.lang.String |
toString() |
public HAState(org.apache.hadoop.ha.HAServiceProtocol.HAServiceState state)
state - HA service state.public org.apache.hadoop.ha.HAServiceProtocol.HAServiceState getServiceState()
protected final void setStateInternal(HAContext context, HAState s) throws org.apache.hadoop.ha.ServiceFailedException
context - HA contexts - new stateorg.apache.hadoop.ha.ServiceFailedException - on failure to transition to new state.public long getLastHATransitionTime()
public void prepareToEnterState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
prepareToExitState(HAContext) has been called
for the previous state, but before exitState(HAContext)
has been called for the previous state.context - HA contextorg.apache.hadoop.ha.ServiceFailedException - on precondition failurepublic abstract void enterState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
context - HA contextorg.apache.hadoop.ha.ServiceFailedException - on failure to enter the state.public void prepareToExitState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
prepareToEnterState(HAContext)
may subsequently cancel the state transition.context - HA contextorg.apache.hadoop.ha.ServiceFailedException - on precondition failurepublic abstract void exitState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
context - HA contextorg.apache.hadoop.ha.ServiceFailedException - on failure to enter the state.public void setState(HAContext context, HAState s) throws org.apache.hadoop.ha.ServiceFailedException
context - HA contexts - new stateorg.apache.hadoop.ha.ServiceFailedException - on failure to transition to new state.public abstract void checkOperation(HAContext context, NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException
context - HA contextop - Type of the operation.org.apache.hadoop.ipc.StandbyException - if a given type of operation is not
supported in standby statepublic abstract boolean shouldPopulateReplQueues()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.