@InterfaceAudience.Private @InterfaceStability.Stable public class DatanodeProtocolClientSideTranslatorPB extends Object implements ProtocolMetaInterface, DatanodeProtocol, Closeable
DatanodeProtocol interfaces to the RPC server implementing
DatanodeProtocolPB.DISK_ERROR, DNA_ACCESSKEYUPDATE, DNA_BALANCERBANDWIDTHUPDATE, DNA_FINALIZE, DNA_INVALIDATE, DNA_RECOVERBLOCK, DNA_REGISTER, DNA_SHUTDOWN, DNA_TRANSFER, DNA_UNKNOWN, FATAL_DISK_ERROR, INVALID_BLOCK, NOTIFY, versionID| Constructor and Description |
|---|
DatanodeProtocolClientSideTranslatorPB(InetSocketAddress nameNodeAddr,
Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
blockReceivedAndDeleted(DatanodeRegistration registration,
String poolId,
StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks)
blockReceivedAndDeleted() allows the DataNode to tell the NameNode about
recently-received and -deleted block data.
|
DatanodeCommand |
blockReport(DatanodeRegistration registration,
String poolId,
StorageBlockReport[] reports)
blockReport() tells the NameNode about all the locally-stored blocks.
|
void |
close() |
void |
commitBlockSynchronization(ExtendedBlock block,
long newgenerationstamp,
long newlength,
boolean closeFile,
boolean deleteblock,
DatanodeID[] newtargets,
String[] newtargetstorages)
Commit block synchronization in lease recovery
|
void |
errorReport(DatanodeRegistration registration,
int errorCode,
String msg)
errorReport() tells the NameNode about something that has gone
awry.
|
boolean |
isMethodSupported(String methodName)
Checks whether the given method name is supported by the server.
|
DatanodeRegistration |
registerDatanode(DatanodeRegistration registration)
Register Datanode.
|
void |
reportBadBlocks(LocatedBlock[] blocks)
|
HeartbeatResponse |
sendHeartbeat(DatanodeRegistration registration,
StorageReport[] reports,
int xmitsInProgress,
int xceiverCount,
int failedVolumes)
sendHeartbeat() tells the NameNode that the DataNode is still
alive and well.
|
NamespaceInfo |
versionRequest() |
public DatanodeProtocolClientSideTranslatorPB(InetSocketAddress nameNodeAddr, Configuration conf) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic DatanodeRegistration registerDatanode(DatanodeRegistration registration) throws IOException
DatanodeProtocolregisterDatanode in interface DatanodeProtocolregistration - datanode registration informationDatanodeRegistration with
updated registration informationIOExceptionFSNamesystem.registerDatanode(DatanodeRegistration)public HeartbeatResponse sendHeartbeat(DatanodeRegistration registration, StorageReport[] reports, int xmitsInProgress, int xceiverCount, int failedVolumes) throws IOException
DatanodeProtocolsendHeartbeat in interface DatanodeProtocolregistration - datanode registration informationreports - utilization report per storagexmitsInProgress - number of transfers from this datanode to othersxceiverCount - number of active transceiver threadsfailedVolumes - number of failed volumesIOException - on errorpublic DatanodeCommand blockReport(DatanodeRegistration registration, String poolId, StorageBlockReport[] reports) throws IOException
DatanodeProtocolblockReport in interface DatanodeProtocolpoolId - - the block pool ID for the blocksreports - - report of blocks per storage
Each finalized block is represented as 3 longs. Each under-
construction replica is represented as 4 longs.
This is done instead of Block[] to reduce memory used by block reports.IOExceptionpublic void blockReceivedAndDeleted(DatanodeRegistration registration, String poolId, StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) throws IOException
DatanodeProtocolblockReceivedAndDeleted in interface DatanodeProtocolIOExceptionpublic void errorReport(DatanodeRegistration registration, int errorCode, String msg) throws IOException
DatanodeProtocolerrorReport in interface DatanodeProtocolIOExceptionpublic NamespaceInfo versionRequest() throws IOException
versionRequest in interface DatanodeProtocolIOExceptionpublic void reportBadBlocks(LocatedBlock[] blocks) throws IOException
DatanodeProtocolreportBadBlocks in interface DatanodeProtocolIOExceptionpublic void commitBlockSynchronization(ExtendedBlock block, long newgenerationstamp, long newlength, boolean closeFile, boolean deleteblock, DatanodeID[] newtargets, String[] newtargetstorages) throws IOException
DatanodeProtocolcommitBlockSynchronization in interface DatanodeProtocolIOExceptionpublic boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterfaceisMethodSupported in interface ProtocolMetaInterfacemethodName - The name of the methodIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.