Interface NamenodeProtocol
- All Known Subinterfaces:
BalancerProtocols,NamenodeProtocols
- All Known Implementing Classes:
NamenodeProtocolTranslatorPB,NameNodeRpcServer
@Private
public interface NamenodeProtocol
Protocol that a secondary NameNode uses to communicate with the NameNode.
Also used by external storage policy satisfier. It's used to get part of the
name node state
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longUntil version 6L, this class served as both the client interface to the NN AND the RPC protocol used to communicate with the NN. -
Method Summary
Modifier and TypeMethodDescriptionvoidendCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) A request to the active name-node to finalize previously started checkpoint.voiderrorReport(NamenodeRegistration registration, int errorCode, String msg) Report to the active name-node an error occurred on a subordinate node.Get the current block keysgetBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long hotBlockTimeInterval, org.apache.hadoop.fs.StorageType storageType) Get a list of blocks belonging todatanodewhose total size equalssize.getEditLogManifest(long sinceTxId) Return a structure containing details about all edit logs available to be fetched from the NameNode.longGet the transaction ID of the most recent checkpoint.longGet the transaction ID of the most recent checkpoint for the given NameNodeFile.longbooleanreturn whether the Namenode is rolling upgrade in progress (true) or not (false).booleanregisterSubordinateNamenode(NamenodeRegistration registration) Register a subordinate name-node like backup node.Closes the current edit log and opens a new one.startCheckpoint(NamenodeRegistration registration) A request to the active name-node to start a checkpoint.Request name-node version and storage information.
-
Field Details
-
versionID
static final long versionIDUntil version 6L, this class served as both the client interface to the NN AND the RPC protocol used to communicate with the NN. This class is used by both the DFSClient and the NN server side to insulate from the protocol serialization. If you are adding/changing NN's interface then you need to change both this class and ALSO related protocol buffer wire protocol definition in NamenodeProtocol.proto. For more details on protocol buffer wire protocol, please see .../org/apache/hadoop/hdfs/protocolPB/overview.html 6: Switch to txid-based file naming for image and edits- See Also:
-
NOTIFY
static final int NOTIFY- See Also:
-
FATAL
static final int FATAL- See Also:
-
ACT_UNKNOWN
static final int ACT_UNKNOWN- See Also:
-
ACT_SHUTDOWN
static final int ACT_SHUTDOWN- See Also:
-
ACT_CHECKPOINT
static final int ACT_CHECKPOINT- See Also:
-
-
Method Details
-
getBlocks
BlocksWithLocations getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long hotBlockTimeInterval, org.apache.hadoop.fs.StorageType storageType) throws IOException Get a list of blocks belonging todatanodewhose total size equalssize.- Parameters:
datanode- a data nodesize- requested sizeminBlockSize- each block should be of this minimum Block SizehotBlockTimeInterval- prefer to get blocks which are belong to the cold files accessed before the time intervalstorageType- the given storage typeStorageType- Returns:
- BlocksWithLocations a list of blocks & their locations
- Throws:
IOException- if size is less than or equal to 0 or datanode does not exist- See Also:
-
getBlockKeys
Get the current block keys- Returns:
- ExportedBlockKeys containing current block keys
- Throws:
IOException
-
getTransactionID
- Returns:
- The most recent transaction ID that has been synced to persistent storage, or applied from persistent storage in the case of a non-active node.
- Throws:
IOException
-
getMostRecentCheckpointTxId
Get the transaction ID of the most recent checkpoint.- Throws:
IOException
-
getMostRecentNameNodeFileTxId
Get the transaction ID of the most recent checkpoint for the given NameNodeFile.- Throws:
IOException
-
rollEditLog
Closes the current edit log and opens a new one. The call fails if the file system is in SafeMode.- Returns:
- a unique token to identify this transaction.
- Throws:
IOException
-
versionRequest
Request name-node version and storage information.- Returns:
NamespaceInfoidentifying versions and storage information of the name-node- Throws:
IOException
-
errorReport
Report to the active name-node an error occurred on a subordinate node. Depending on the error code the active node may decide to unregister the reporting node.- Parameters:
registration- requesting node.errorCode- indicates the errormsg- free text description of the error- Throws:
IOException
-
registerSubordinateNamenode
NamenodeRegistration registerSubordinateNamenode(NamenodeRegistration registration) throws IOException Register a subordinate name-node like backup node.- Returns:
NamenodeRegistrationof the node, which this node has just registered with.- Throws:
IOException
-
startCheckpoint
A request to the active name-node to start a checkpoint. The name-node should decide whether to admit it or reject. The name-node also decides what should be done with the backup node image before and after the checkpoint.- Parameters:
registration- the requesting node- Returns:
CheckpointCommandif checkpoint is allowed.- Throws:
IOException- See Also:
-
endCheckpoint
A request to the active name-node to finalize previously started checkpoint.- Parameters:
registration- the requesting nodesig-CheckpointSignaturewhich identifies the checkpoint.- Throws:
IOException
-
getEditLogManifest
Return a structure containing details about all edit logs available to be fetched from the NameNode.- Parameters:
sinceTxId- return only logs that contain transactions >= sinceTxId- Throws:
IOException
-
isUpgradeFinalized
- Returns:
- Whether the NameNode is in upgrade state (false) or not (true)
- Throws:
IOException
-
isRollingUpgrade
return whether the Namenode is rolling upgrade in progress (true) or not (false).- Returns:
- Throws:
IOException
-
getNextSPSPath
- Returns:
- Gets the next available sps path, otherwise null. This API used by External SPS.
- Throws:
IOException
-