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 |
NameNode.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.HAContext
state
setState
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
public org.apache.hadoop.hdfs.server.namenode.ha.HAState getState()
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
getState
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
public void startActiveServices() throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
startActiveServices
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
IOException
public void stopActiveServices() throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
stopActiveServices
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
IOException
public void startStandbyServices() throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
startStandbyServices
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
IOException
public void prepareToStopStandbyServices() throws org.apache.hadoop.ha.ServiceFailedException
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
prepareToStopStandbyServices
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
org.apache.hadoop.ha.ServiceFailedException
public void stopStandbyServices() throws IOException
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
stopStandbyServices
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
IOException
public void writeLock()
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
writeLock
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
public void writeUnlock()
org.apache.hadoop.hdfs.server.namenode.ha.HAContext
HAContext.writeLock()
writeUnlock
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
public void checkOperation(NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException
checkOperation
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
org.apache.hadoop.ipc.StandbyException
public boolean allowStaleReads()
allowStaleReads
in interface org.apache.hadoop.hdfs.server.namenode.ha.HAContext
Copyright © 2017 Apache Software Foundation. All Rights Reserved.