Class NameNode.NameNodeHAContext
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.NameNode.NameNodeHAContext
- All Implemented Interfaces:
HAContext
- Enclosing class:
- NameNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidCheck if an operation of given category is allowedgetState()Get the state from the contextvoidPrepare to exit the standby statevoidSet the state of the context to givenstatevoidStart the services required in active statevoidStart the services required in standby statevoidStop the services when exiting active statevoidStop the services when exiting standby statevoidTake a write-lock on the underlying namesystem so that no concurrent state transitions or edits can be made.voidUnlock the lock taken byHAContext.writeLock()
-
Constructor Details
-
NameNodeHAContext
protected NameNodeHAContext()
-
-
Method Details
-
setState
Description copied from interface:HAContextSet the state of the context to givenstate -
getState
Description copied from interface:HAContextGet the state from the context -
startActiveServices
Description copied from interface:HAContextStart the services required in active state- Specified by:
startActiveServicesin interfaceHAContext- Throws:
IOException
-
stopActiveServices
Description copied from interface:HAContextStop the services when exiting active state- Specified by:
stopActiveServicesin interfaceHAContext- Throws:
IOException
-
startStandbyServices
Description copied from interface:HAContextStart the services required in standby state- Specified by:
startStandbyServicesin interfaceHAContext- Throws:
IOException
-
prepareToStopStandbyServices
public void prepareToStopStandbyServices() throws org.apache.hadoop.ha.ServiceFailedExceptionDescription copied from interface:HAContextPrepare to exit the standby state- Specified by:
prepareToStopStandbyServicesin interfaceHAContext- Throws:
org.apache.hadoop.ha.ServiceFailedException
-
stopStandbyServices
Description copied from interface:HAContextStop the services when exiting standby state- Specified by:
stopStandbyServicesin interfaceHAContext- Throws:
IOException
-
writeLock
public void writeLock()Description copied from interface:HAContextTake a write-lock on the underlying namesystem so that no concurrent state transitions or edits can be made. -
writeUnlock
public void writeUnlock()Description copied from interface:HAContextUnlock the lock taken byHAContext.writeLock()- Specified by:
writeUnlockin interfaceHAContext
-
checkOperation
public void checkOperation(NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException Check if an operation of given category is allowed- Specified by:
checkOperationin interfaceHAContext- Throws:
org.apache.hadoop.ipc.StandbyException
-
allowStaleReads
public boolean allowStaleReads()- Specified by:
allowStaleReadsin interfaceHAContext- Returns:
- true if the node should allow stale reads (ie reads while the namespace is not up to date)
-