java.io.Closeable, java.lang.AutoCloseable, DatanodeProtocol, org.apache.hadoop.ipc.ProtocolMetaInterface@Private @Stable public class DatanodeProtocolClientSideTranslatorPB extends java.lang.Object implements org.apache.hadoop.ipc.ProtocolMetaInterface, DatanodeProtocol, java.io.Closeable
DatanodeProtocol interfaces to the RPC server implementing
DatanodeProtocolPB.DISK_ERROR, DNA_ACCESSKEYUPDATE, DNA_BALANCERBANDWIDTHUPDATE, DNA_BLOCK_STORAGE_MOVEMENT, DNA_CACHE, DNA_DROP_SPS_WORK_COMMAND, DNA_ERASURE_CODING_RECONSTRUCTION, DNA_FINALIZE, DNA_INVALIDATE, DNA_RECOVERBLOCK, DNA_REGISTER, DNA_SHUTDOWN, DNA_TRANSFER, DNA_UNCACHE, DNA_UNKNOWN, FATAL_DISK_ERROR, INVALID_BLOCK, NOTIFY, versionID| Constructor | Description |
|---|---|
DatanodeProtocolClientSideTranslatorPB(java.net.InetSocketAddress nameNodeAddr,
org.apache.hadoop.conf.Configuration conf) |
|
DatanodeProtocolClientSideTranslatorPB(DatanodeProtocolPB rpcProxy) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
blockReceivedAndDeleted(DatanodeRegistration registration,
java.lang.String poolId,
StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) |
blockReceivedAndDeleted() allows the DataNode to tell the NameNode about
recently-received and -deleted block data.
|
DatanodeCommand |
blockReport(DatanodeRegistration registration,
java.lang.String poolId,
StorageBlockReport[] reports,
BlockReportContext context) |
blockReport() tells the NameNode about all the locally-stored blocks.
|
DatanodeCommand |
cacheReport(DatanodeRegistration registration,
java.lang.String poolId,
java.util.List<java.lang.Long> blockIds) |
Communicates the complete list of locally cached blocks to the NameNode.
|
void |
close() |
|
void |
commitBlockSynchronization(org.apache.hadoop.hdfs.protocol.ExtendedBlock block,
long newgenerationstamp,
long newlength,
boolean closeFile,
boolean deleteblock,
org.apache.hadoop.hdfs.protocol.DatanodeID[] newtargets,
java.lang.String[] newtargetstorages) |
Commit block synchronization in lease recovery
|
void |
errorReport(DatanodeRegistration registration,
int errorCode,
java.lang.String msg) |
errorReport() tells the NameNode about something that has gone
awry.
|
boolean |
isMethodSupported(java.lang.String methodName) |
|
DatanodeRegistration |
registerDatanode(DatanodeRegistration registration) |
Register Datanode.
|
void |
reportBadBlocks(org.apache.hadoop.hdfs.protocol.LocatedBlock[] blocks) |
same as
ClientProtocol.reportBadBlocks(LocatedBlock[])
} |
HeartbeatResponse |
sendHeartbeat(DatanodeRegistration registration,
org.apache.hadoop.hdfs.server.protocol.StorageReport[] reports,
long cacheCapacity,
long cacheUsed,
int xmitsInProgress,
int xceiverCount,
int failedVolumes,
VolumeFailureSummary volumeFailureSummary,
boolean requestFullBlockReportLease,
org.apache.hadoop.hdfs.server.protocol.SlowPeerReports slowPeers,
org.apache.hadoop.hdfs.server.protocol.SlowDiskReports slowDisks) |
sendHeartbeat() tells the NameNode that the DataNode is still
alive and well.
|
NamespaceInfo |
versionRequest() |
@VisibleForTesting public DatanodeProtocolClientSideTranslatorPB(DatanodeProtocolPB rpcProxy)
public DatanodeProtocolClientSideTranslatorPB(java.net.InetSocketAddress nameNodeAddr,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionpublic DatanodeRegistration registerDatanode(DatanodeRegistration registration) throws java.io.IOException
DatanodeProtocolregisterDatanode in interface DatanodeProtocolregistration - datanode registration informationDatanodeRegistration with
updated registration informationjava.io.IOExceptionFSNamesystem.registerDatanode(DatanodeRegistration)public HeartbeatResponse sendHeartbeat(DatanodeRegistration registration, org.apache.hadoop.hdfs.server.protocol.StorageReport[] reports, long cacheCapacity, long cacheUsed, int xmitsInProgress, int xceiverCount, int failedVolumes, VolumeFailureSummary volumeFailureSummary, boolean requestFullBlockReportLease, @Nonnull org.apache.hadoop.hdfs.server.protocol.SlowPeerReports slowPeers, @Nonnull org.apache.hadoop.hdfs.server.protocol.SlowDiskReports slowDisks) throws java.io.IOException
DatanodeProtocolsendHeartbeat in interface DatanodeProtocolregistration - datanode registration information.reports - utilization report per storage.cacheCapacity - the total cache capacity of the datanode (in bytes).cacheUsed - the amount of cache used by the datanode (in bytes).xmitsInProgress - number of transfers from this datanode to others.xceiverCount - number of active transceiver threads.failedVolumes - number of failed volumes.volumeFailureSummary - info about volume failures.requestFullBlockReportLease - whether to request a full block
report lease.slowPeers - Details of peer DataNodes that were detected as being
slow to respond to packet writes. Empty report if no
slow peers were detected by the DataNode.slowDisks - Details of disks on DataNodes that were detected as
being slow. Empty report if no slow disks were detected.java.io.IOException - on error.public DatanodeCommand blockReport(DatanodeRegistration registration, java.lang.String poolId, StorageBlockReport[] reports, BlockReportContext context) throws java.io.IOException
DatanodeProtocolblockReport in interface DatanodeProtocolregistration - datanode registrationpoolId - 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.context - Context information for this block report.java.io.IOExceptionpublic DatanodeCommand cacheReport(DatanodeRegistration registration, java.lang.String poolId, java.util.List<java.lang.Long> blockIds) throws java.io.IOException
DatanodeProtocolDatanodeProtocol.blockReport(DatanodeRegistration, String, StorageBlockReport[], BlockReportContext),
which is used to communicated blocks stored on disk.cacheReport in interface DatanodeProtocolregistration - The datanode registration.poolId - The block pool ID for the blocks.blockIds - A list of block IDs.java.io.IOExceptionpublic void blockReceivedAndDeleted(DatanodeRegistration registration, java.lang.String poolId, StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) throws java.io.IOException
DatanodeProtocolblockReceivedAndDeleted in interface DatanodeProtocoljava.io.IOExceptionpublic void errorReport(DatanodeRegistration registration, int errorCode, java.lang.String msg) throws java.io.IOException
DatanodeProtocolerrorReport in interface DatanodeProtocoljava.io.IOExceptionpublic NamespaceInfo versionRequest() throws java.io.IOException
versionRequest in interface DatanodeProtocoljava.io.IOExceptionpublic void reportBadBlocks(org.apache.hadoop.hdfs.protocol.LocatedBlock[] blocks)
throws java.io.IOException
DatanodeProtocolClientProtocol.reportBadBlocks(LocatedBlock[])
}reportBadBlocks in interface DatanodeProtocoljava.io.IOExceptionpublic void commitBlockSynchronization(org.apache.hadoop.hdfs.protocol.ExtendedBlock block,
long newgenerationstamp,
long newlength,
boolean closeFile,
boolean deleteblock,
org.apache.hadoop.hdfs.protocol.DatanodeID[] newtargets,
java.lang.String[] newtargetstorages)
throws java.io.IOException
DatanodeProtocolcommitBlockSynchronization in interface DatanodeProtocoljava.io.IOExceptionpublic boolean isMethodSupported(java.lang.String methodName)
throws java.io.IOException
isMethodSupported in interface org.apache.hadoop.ipc.ProtocolMetaInterfacejava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.