@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
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public DatanodeRegistration registerDatanode(DatanodeRegistration registration) throws IOException
DatanodeProtocol
registerDatanode
in interface DatanodeProtocol
registration
- datanode registration informationDatanodeRegistration
with
updated registration informationIOException
FSNamesystem.registerDatanode(DatanodeRegistration)
public HeartbeatResponse sendHeartbeat(DatanodeRegistration registration, StorageReport[] reports, int xmitsInProgress, int xceiverCount, int failedVolumes) throws IOException
DatanodeProtocol
sendHeartbeat
in interface DatanodeProtocol
registration
- 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
DatanodeProtocol
blockReport
in interface DatanodeProtocol
poolId
- - 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.IOException
public void blockReceivedAndDeleted(DatanodeRegistration registration, String poolId, StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) throws IOException
DatanodeProtocol
blockReceivedAndDeleted
in interface DatanodeProtocol
IOException
public void errorReport(DatanodeRegistration registration, int errorCode, String msg) throws IOException
DatanodeProtocol
errorReport
in interface DatanodeProtocol
IOException
public NamespaceInfo versionRequest() throws IOException
versionRequest
in interface DatanodeProtocol
IOException
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException
DatanodeProtocol
reportBadBlocks
in interface DatanodeProtocol
IOException
public void commitBlockSynchronization(ExtendedBlock block, long newgenerationstamp, long newlength, boolean closeFile, boolean deleteblock, DatanodeID[] newtargets, String[] newtargetstorages) throws IOException
DatanodeProtocol
commitBlockSynchronization
in interface DatanodeProtocol
IOException
public boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterface
isMethodSupported
in interface ProtocolMetaInterface
methodName
- The name of the methodIOException
Copyright © 2013 Apache Software Foundation. All rights reserved.