Class BackupState
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.HAState
org.apache.hadoop.hdfs.server.namenode.BackupState
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckOperation(HAContext context, NameNode.OperationCategory op) Check if an operation is supported in a given state.voidenterState(HAContext context) Method to be overridden by subclasses to perform steps necessary for entering a state.voidMethod to be overridden by subclasses to perform steps necessary for exiting a state.voidprepareToExitState(HAContext context) Method to be overridden by subclasses to prepare to exit a state.booleanMethods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.HAState
getLastHATransitionTime, getServiceState, prepareToEnterState, setState, setStateInternal, toString
-
Constructor Details
-
BackupState
public BackupState()
-
-
Method Details
-
checkOperation
public void checkOperation(HAContext context, NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException Description copied from class:HAStateCheck if an operation is supported in a given state.- Specified by:
checkOperationin classHAState- Parameters:
context- HA contextop- Type of the operation.- Throws:
org.apache.hadoop.ipc.StandbyException- if a given type of operation is not supported in standby state
-
shouldPopulateReplQueues
public boolean shouldPopulateReplQueues()- Specified by:
shouldPopulateReplQueuesin classHAState
-
enterState
Description copied from class:HAStateMethod to be overridden by subclasses to perform steps necessary for entering a state.- Specified by:
enterStatein classHAState- Parameters:
context- HA context- Throws:
org.apache.hadoop.ha.ServiceFailedException- on failure to enter the state.
-
exitState
Description copied from class:HAStateMethod to be overridden by subclasses to perform steps necessary for exiting a state. -
prepareToExitState
public void prepareToExitState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException Description copied from class:HAStateMethod to be overridden by subclasses to prepare to exit a state. This method is called without the context being locked. This is used by the standby state to cancel any checkpoints that are going on. It can also be used to check any preconditions for the state transition. This method should not make any destructive changes to the state (eg stopping threads) sinceHAState.prepareToEnterState(HAContext)may subsequently cancel the state transition.- Overrides:
prepareToExitStatein classHAState- Parameters:
context- HA context- Throws:
org.apache.hadoop.ha.ServiceFailedException- on precondition failure
-