|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.server.namenode.NameNode
org.apache.hadoop.hdfs.server.namenode.BackupNode
@InterfaceAudience.Private public class BackupNode
BackupNode.
Backup node can play two roles.
HdfsConstants.NamenodeRole.CHECKPOINT
node periodically creates checkpoints,
that is downloads image and edits from the active node, merges them, and
uploads the new image back to the active.HdfsConstants.NamenodeRole.BACKUP
node keeps its namespace in sync with the
active node, and periodically creates checkpoints by simply saving the
namespace image to local disk(s).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.protocol.FSConstants |
---|
FSConstants.DatanodeReportType, FSConstants.SafeModeAction, FSConstants.UpgradeAction |
Field Summary |
---|
Fields inherited from class org.apache.hadoop.hdfs.server.namenode.NameNode |
---|
DEFAULT_PORT, httpAddress, httpServer, LOG, namesystem, nodeRegistration, role, rpcAddress, server, stateChangeLog, stopRequested |
Fields inherited from interface org.apache.hadoop.hdfs.protocol.ClientProtocol |
---|
GET_STATS_CAPACITY_IDX, GET_STATS_CORRUPT_BLOCKS_IDX, GET_STATS_MISSING_BLOCKS_IDX, GET_STATS_REMAINING_IDX, GET_STATS_UNDER_REPLICATED_IDX, GET_STATS_USED_IDX, versionID |
Fields inherited from interface org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol |
---|
DISK_ERROR, DNA_ACCESSKEYUPDATE, DNA_FINALIZE, DNA_INVALIDATE, DNA_RECOVERBLOCK, DNA_REGISTER, DNA_SHUTDOWN, DNA_TRANSFER, DNA_UNKNOWN, FATAL_DISK_ERROR, INVALID_BLOCK, NOTIFY, versionID |
Fields inherited from interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol |
---|
ACT_CHECKPOINT, ACT_SHUTDOWN, ACT_UNKNOWN, FATAL, JA_CHECKPOINT_TIME, JA_IS_ALIVE, JA_JOURNAL, JA_JSPOOL_START, NOTIFY, versionID |
Fields inherited from interface org.apache.hadoop.security.authorize.RefreshAuthorizationPolicyProtocol |
---|
versionID |
Fields inherited from interface org.apache.hadoop.security.RefreshUserToGroupMappingsProtocol |
---|
versionID |
Method Summary | |
---|---|
void |
endCheckpoint(NamenodeRegistration registration,
CheckpointSignature sig)
A request to the active name-node to finalize previously started checkpoint. |
BlocksWithLocations |
getBlocks(DatanodeInfo datanode,
long size)
Get a list of blocks belonging to datanode
whose total size equals size . |
protected InetSocketAddress |
getHttpServerAddress(org.apache.hadoop.conf.Configuration conf)
|
protected InetSocketAddress |
getRpcServerAddress(org.apache.hadoop.conf.Configuration conf)
|
protected void |
initialize(org.apache.hadoop.conf.Configuration conf)
Initialize name-node. |
void |
journal(NamenodeRegistration nnReg,
int jAction,
int length,
byte[] args)
Journal edit records. |
protected void |
loadNamesystem(org.apache.hadoop.conf.Configuration conf)
|
NamenodeRegistration |
register(NamenodeRegistration registration)
Register a subordinate name-node like backup node. |
protected void |
setHttpServerAddress(org.apache.hadoop.conf.Configuration conf)
|
protected void |
setRpcServerAddress(org.apache.hadoop.conf.Configuration conf)
|
NamenodeCommand |
startCheckpoint(NamenodeRegistration registration)
A request to the active name-node to start a checkpoint. |
void |
stop()
Stop all NameNode threads and wait for all to finish. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected InetSocketAddress getRpcServerAddress(org.apache.hadoop.conf.Configuration conf) throws IOException
getRpcServerAddress
in class NameNode
IOException
protected void setRpcServerAddress(org.apache.hadoop.conf.Configuration conf)
setRpcServerAddress
in class NameNode
protected InetSocketAddress getHttpServerAddress(org.apache.hadoop.conf.Configuration conf)
getHttpServerAddress
in class NameNode
protected void setHttpServerAddress(org.apache.hadoop.conf.Configuration conf)
setHttpServerAddress
in class NameNode
protected void loadNamesystem(org.apache.hadoop.conf.Configuration conf) throws IOException
loadNamesystem
in class NameNode
IOException
protected void initialize(org.apache.hadoop.conf.Configuration conf) throws IOException
NameNode
initialize
in class NameNode
conf
- the configuration
IOException
public void stop()
NameNode
stop
in class NameNode
public BlocksWithLocations getBlocks(DatanodeInfo datanode, long size) throws IOException
NamenodeProtocol
datanode
whose total size equals size
.
getBlocks
in interface NamenodeProtocol
getBlocks
in class NameNode
datanode
- a data nodesize
- requested size
IOException
Balancer
public NamenodeRegistration register(NamenodeRegistration registration) throws IOException
NamenodeProtocol
register
in interface NamenodeProtocol
register
in class NameNode
NamenodeRegistration
of the node,
which this node has just registered with.
IOException
public NamenodeCommand startCheckpoint(NamenodeRegistration registration) throws IOException
NamenodeProtocol
startCheckpoint
in interface NamenodeProtocol
startCheckpoint
in class NameNode
registration
- the requesting node
CheckpointCommand
if checkpoint is allowed.
IOException
CheckpointCommand
,
NamenodeCommand
,
NamenodeProtocol.ACT_SHUTDOWN
public void endCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) throws IOException
NamenodeProtocol
endCheckpoint
in interface NamenodeProtocol
endCheckpoint
in class NameNode
registration
- the requesting nodesig
- CheckpointSignature
which identifies the checkpoint.
IOException
public void journal(NamenodeRegistration nnReg, int jAction, int length, byte[] args) throws IOException
NamenodeProtocol
EditLogBackupOutputStream
in order to synchronize meta-data
changes with the backup namespace image.
journal
in interface NamenodeProtocol
journal
in class NameNode
nnReg
- active node registrationjAction
- journal actionlength
- length of the byte arrayargs
- byte array containing serialized journal records
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |