protected class NameNode.NameNodeHAContext extends Object implements org.apache.hadoop.hdfs.server.namenode.ha.HAContext
NameNode as context to HAState| Modifier | Constructor and Description |
|---|---|
protected |
NameNodeHAContext() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowStaleReads() |
void |
checkOperation(NameNode.OperationCategory op)
Check if an operation of given category is allowed
|
org.apache.hadoop.hdfs.server.namenode.ha.HAState |
getState()
Get the state from the context
|
void |
prepareToStopStandbyServices()
Prepare to exit the standby state
|
void |
setState(org.apache.hadoop.hdfs.server.namenode.ha.HAState s)
Set the state of the context to given
state |
void |
startActiveServices()
Start the services required in active state
|
void |
startStandbyServices()
Start the services required in standby state
|
void |
stopActiveServices()
Stop the services when exiting active state
|
void |
stopStandbyServices()
Stop the services when exiting standby state
|
void |
writeLock()
Take a write-lock on the underlying namesystem
so that no concurrent state transitions or edits
can be made.
|
void |
writeUnlock()
Unlock the lock taken by
HAContext.writeLock() |
public void setState(org.apache.hadoop.hdfs.server.namenode.ha.HAState s)
org.apache.hadoop.hdfs.server.namenode.ha.HAContextstatesetState in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextpublic org.apache.hadoop.hdfs.server.namenode.ha.HAState getState()
org.apache.hadoop.hdfs.server.namenode.ha.HAContextgetState in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextpublic void startActiveServices()
throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContextstartActiveServices in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextIOExceptionpublic void stopActiveServices()
throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContextstopActiveServices in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextIOExceptionpublic void startStandbyServices()
throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContextstartStandbyServices in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextIOExceptionpublic void prepareToStopStandbyServices()
throws org.apache.hadoop.ha.ServiceFailedException
org.apache.hadoop.hdfs.server.namenode.ha.HAContextprepareToStopStandbyServices in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextorg.apache.hadoop.ha.ServiceFailedExceptionpublic void stopStandbyServices()
throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContextstopStandbyServices in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextIOExceptionpublic void writeLock()
org.apache.hadoop.hdfs.server.namenode.ha.HAContextwriteLock in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextpublic void writeUnlock()
org.apache.hadoop.hdfs.server.namenode.ha.HAContextHAContext.writeLock()writeUnlock in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextpublic void checkOperation(NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException
checkOperation in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextorg.apache.hadoop.ipc.StandbyExceptionpublic boolean allowStaleReads()
allowStaleReads in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContextCopyright © 2008–2023 Apache Software Foundation. All rights reserved.