public interface DatanodeProtocol extends VersionedProtocol
限定符和类型 | 字段和说明 |
---|---|
static int |
DISK_ERROR |
static int |
DNA_ACCESSKEYUPDATE |
static int |
DNA_BALANCERBANDWIDTHUPDATE |
static int |
DNA_FINALIZE |
static int |
DNA_INVALIDATE |
static int |
DNA_RECOVERBLOCK |
static int |
DNA_REGISTER |
static int |
DNA_SHUTDOWN |
static int |
DNA_TRANSFER |
static int |
DNA_UNKNOWN
Determines actions that data node should perform
when receiving a datanode command.
|
static int |
FATAL_DISK_ERROR |
static int |
INVALID_BLOCK |
static int |
NOTIFY |
static long |
versionID
26: Added an additional member to NamespaceInfo
|
限定符和类型 | 方法和说明 |
---|---|
void |
blockReceived(DatanodeRegistration registration,
Block[] blocks,
String[] delHints)
blockReceived() allows the DataNode to tell the NameNode about
recently-received block data, with a hint for pereferred replica
to be deleted when there is any excessive blocks.
|
DatanodeCommand |
blockReport(DatanodeRegistration registration,
long[] blocks)
blockReport() tells the NameNode about all the locally-stored blocks.
|
void |
blocksBeingWrittenReport(DatanodeRegistration registration,
long[] blocks)
blocksBeingWrittenReport() tells the NameNode about the blocks-being-
written information
|
void |
commitBlockSynchronization(Block block,
long newgenerationstamp,
long newlength,
boolean closeFile,
boolean deleteblock,
DatanodeID[] newtargets)
Commit block synchronization in lease recovery
|
void |
errorReport(DatanodeRegistration registration,
int errorCode,
String msg)
errorReport() tells the NameNode about something that has gone
awry.
|
long |
nextGenerationStamp(Block block,
boolean fromNN)
Get the next GenerationStamp to be associated with the specified
block.
|
UpgradeCommand |
processUpgradeCommand(UpgradeCommand comm)
This is a very general way to send a command to the name-node during
distributed upgrade process.
|
DatanodeRegistration |
register(DatanodeRegistration registration)
Register Datanode.
|
void |
reportBadBlocks(LocatedBlock[] blocks)
|
DatanodeCommand[] |
sendHeartbeat(DatanodeRegistration registration,
long capacity,
long dfsUsed,
long remaining,
int xmitsInProgress,
int xceiverCount)
sendHeartbeat() tells the NameNode that the DataNode is still
alive and well.
|
NamespaceInfo |
versionRequest() |
getProtocolVersion
static final long versionID
static final int NOTIFY
static final int DISK_ERROR
static final int INVALID_BLOCK
static final int FATAL_DISK_ERROR
static final int DNA_UNKNOWN
static final int DNA_TRANSFER
static final int DNA_INVALIDATE
static final int DNA_SHUTDOWN
static final int DNA_REGISTER
static final int DNA_FINALIZE
static final int DNA_RECOVERBLOCK
static final int DNA_ACCESSKEYUPDATE
static final int DNA_BALANCERBANDWIDTHUPDATE
DatanodeRegistration register(DatanodeRegistration registration) throws IOException
DatanodeRegistration
, which contains
new storageID if the datanode did not have one and
registration ID for further communication.IOException
DataNode.dnRegistration
,
FSNamesystem.registerDatanode(DatanodeRegistration)
DatanodeCommand[] sendHeartbeat(DatanodeRegistration registration, long capacity, long dfsUsed, long remaining, int xmitsInProgress, int xceiverCount) throws IOException
IOException
DatanodeCommand blockReport(DatanodeRegistration registration, long[] blocks) throws IOException
registration
- blocks
- - the block list as an array of longs.
Each block is represented as 2 longs.
This is done instead of Block[] to reduce memory used by block reports.IOException
void blocksBeingWrittenReport(DatanodeRegistration registration, long[] blocks) throws IOException
registration
- blocks
- IOException
void blockReceived(DatanodeRegistration registration, Block[] blocks, String[] delHints) throws IOException
IOException
void errorReport(DatanodeRegistration registration, int errorCode, String msg) throws IOException
IOException
NamespaceInfo versionRequest() throws IOException
IOException
UpgradeCommand processUpgradeCommand(UpgradeCommand comm) throws IOException
IOException
void reportBadBlocks(LocatedBlock[] blocks) throws IOException
IOException
long nextGenerationStamp(Block block, boolean fromNN) throws IOException
block
- blockfromNN
- if it is for lease recovery initiated by NameNodeIOException
void commitBlockSynchronization(Block block, long newgenerationstamp, long newlength, boolean closeFile, boolean deleteblock, DatanodeID[] newtargets) throws IOException
IOException
Copyright © 2009 The Apache Software Foundation