@InterfaceAudience.Private public abstract class HAState extends Object
Modifier and Type | Field and Description |
---|---|
protected HAServiceProtocol.HAServiceState |
state |
Constructor and Description |
---|
HAState(HAServiceProtocol.HAServiceState state)
Constructor
|
Modifier and Type | Method and 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.
|
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 transition the state of a given namenode to a new state.
|
abstract boolean |
shouldPopulateReplQueues() |
String |
toString() |
protected final HAServiceProtocol.HAServiceState state
public HAState(HAServiceProtocol.HAServiceState state)
name
- Name of the state.public HAServiceProtocol.HAServiceState getServiceState()
protected final void setStateInternal(HAContext context, HAState s) throws ServiceFailedException
nn
- Namenodes
- new stateServiceFailedException
- on failure to transition to new state.public void prepareToEnterState(HAContext context) throws ServiceFailedException
prepareToExitState(HAContext)
has been called
for the previous state, but before exitState(HAContext)
has been called for the previous state.context
- HA contextServiceFailedException
- on precondition failurepublic abstract void enterState(HAContext context) throws ServiceFailedException
context
- HA contextServiceFailedException
- on failure to enter the state.public void prepareToExitState(HAContext context) throws ServiceFailedException
prepareToEnterState(HAContext)
may subsequently cancel the state transition.context
- HA contextServiceFailedException
- on precondition failurepublic abstract void exitState(HAContext context) throws ServiceFailedException
context
- HA contextServiceFailedException
- on failure to enter the state.public void setState(HAContext context, HAState s) throws ServiceFailedException
context
- HA contexts
- new stateServiceFailedException
- on failure to transition to new state.public abstract void checkOperation(HAContext context, NameNode.OperationCategory op) throws StandbyException
context
- HA contextop
- Type of the operation.UnsupportedActionException
- if a given type of operation is not
supported in this state.StandbyException
public abstract boolean shouldPopulateReplQueues()
Copyright © 2013 Apache Software Foundation. All rights reserved.