Class NamenodeProtocolTranslatorPB
java.lang.Object
org.apache.hadoop.hdfs.protocolPB.NamenodeProtocolTranslatorPB
- All Implemented Interfaces:
Closeable,AutoCloseable,NamenodeProtocol,org.apache.hadoop.ipc.ProtocolMetaInterface,org.apache.hadoop.ipc.ProtocolTranslator
@Private
@Stable
public class NamenodeProtocolTranslatorPB
extends Object
implements NamenodeProtocol, org.apache.hadoop.ipc.ProtocolMetaInterface, Closeable, org.apache.hadoop.ipc.ProtocolTranslator
This class is the client side translator to translate the requests made on
NamenodeProtocol interfaces to the RPC server implementing
NamenodeProtocolPB.-
Field Summary
Fields inherited from interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
ACT_CHECKPOINT, ACT_SHUTDOWN, ACT_UNKNOWN, FATAL, NOTIFY, versionID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidendCheckpoint(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 timeInterval, 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.longbooleanisMethodSupported(String methodName) booleanreturn 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.
-
Constructor Details
-
NamenodeProtocolTranslatorPB
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getUnderlyingProxyObject
- Specified by:
getUnderlyingProxyObjectin interfaceorg.apache.hadoop.ipc.ProtocolTranslator
-
getBlocks
public BlocksWithLocations getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long timeInterval, org.apache.hadoop.fs.StorageType storageType) throws IOException Description copied from interface:NamenodeProtocolGet a list of blocks belonging todatanodewhose total size equalssize.- Specified by:
getBlocksin interfaceNamenodeProtocol- Parameters:
datanode- a data nodesize- requested sizeminBlockSize- each block should be of this minimum Block SizetimeInterval- 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
Description copied from interface:NamenodeProtocolGet the current block keys- Specified by:
getBlockKeysin interfaceNamenodeProtocol- Returns:
- ExportedBlockKeys containing current block keys
- Throws:
IOException
-
getTransactionID
- Specified by:
getTransactionIDin interfaceNamenodeProtocol- 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
Description copied from interface:NamenodeProtocolGet the transaction ID of the most recent checkpoint.- Specified by:
getMostRecentCheckpointTxIdin interfaceNamenodeProtocol- Throws:
IOException
-
getMostRecentNameNodeFileTxId
Description copied from interface:NamenodeProtocolGet the transaction ID of the most recent checkpoint for the given NameNodeFile.- Specified by:
getMostRecentNameNodeFileTxIdin interfaceNamenodeProtocol- Throws:
IOException
-
rollEditLog
Description copied from interface:NamenodeProtocolCloses the current edit log and opens a new one. The call fails if the file system is in SafeMode.- Specified by:
rollEditLogin interfaceNamenodeProtocol- Returns:
- a unique token to identify this transaction.
- Throws:
IOException
-
versionRequest
Description copied from interface:NamenodeProtocolRequest name-node version and storage information.- Specified by:
versionRequestin interfaceNamenodeProtocol- Returns:
NamespaceInfoidentifying versions and storage information of the name-node- Throws:
IOException
-
errorReport
public void errorReport(NamenodeRegistration registration, int errorCode, String msg) throws IOException Description copied from interface:NamenodeProtocolReport 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.- Specified by:
errorReportin interfaceNamenodeProtocol- Parameters:
registration- requesting node.errorCode- indicates the errormsg- free text description of the error- Throws:
IOException
-
registerSubordinateNamenode
public NamenodeRegistration registerSubordinateNamenode(NamenodeRegistration registration) throws IOException Description copied from interface:NamenodeProtocolRegister a subordinate name-node like backup node.- Specified by:
registerSubordinateNamenodein interfaceNamenodeProtocol- Returns:
NamenodeRegistrationof the node, which this node has just registered with.- Throws:
IOException
-
startCheckpoint
Description copied from interface:NamenodeProtocolA 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.- Specified by:
startCheckpointin interfaceNamenodeProtocol- Parameters:
registration- the requesting node- Returns:
CheckpointCommandif checkpoint is allowed.- Throws:
IOException- See Also:
-
endCheckpoint
public void endCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) throws IOException Description copied from interface:NamenodeProtocolA request to the active name-node to finalize previously started checkpoint.- Specified by:
endCheckpointin interfaceNamenodeProtocol- Parameters:
registration- the requesting nodesig-CheckpointSignaturewhich identifies the checkpoint.- Throws:
IOException
-
getEditLogManifest
Description copied from interface:NamenodeProtocolReturn a structure containing details about all edit logs available to be fetched from the NameNode.- Specified by:
getEditLogManifestin interfaceNamenodeProtocol- Parameters:
sinceTxId- return only logs that contain transactions >= sinceTxId- Throws:
IOException
-
isMethodSupported
- Specified by:
isMethodSupportedin interfaceorg.apache.hadoop.ipc.ProtocolMetaInterface- Throws:
IOException
-
isUpgradeFinalized
- Specified by:
isUpgradeFinalizedin interfaceNamenodeProtocol- Returns:
- Whether the NameNode is in upgrade state (false) or not (true)
- Throws:
IOException
-
isRollingUpgrade
Description copied from interface:NamenodeProtocolreturn whether the Namenode is rolling upgrade in progress (true) or not (false).- Specified by:
isRollingUpgradein interfaceNamenodeProtocol- Returns:
- Throws:
IOException
-
getNextSPSPath
- Specified by:
getNextSPSPathin interfaceNamenodeProtocol- Returns:
- Gets the next available sps path, otherwise null. This API used by External SPS.
- Throws:
IOException
-