Save This Page
Home » hadoop-0.14.4 » org.apache » hadoop » dfs » [javadoc | source]
org.apache.hadoop.dfs
interface: DatanodeProtocol [javadoc | source]

All Implemented Interfaces:
    VersionedProtocol

All Known Implementing Classes:
    NameNode

Protocol that a DFS datanode uses to communicate with the NameNode. It's used to upload current load information and block reports. The only way a NameNode can communicate with a DataNode is by returning values from these functions.
Field Summary
public static final  long versionID     
static final  int NOTIFY     
static final  int DISK_ERROR     
static final  int INVALID_BLOCK     
static final  int DNA_UNKNOWN    Determines actions that data node should perform when receiving a datanode command. 
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     
Method from org.apache.hadoop.dfs.DatanodeProtocol Summary:
blockCrcUpgradeGetBlockLocations,   blockReceived,   blockReport,   errorReport,   processUpgradeCommand,   register,   sendHeartbeat,   versionRequest
Method from org.apache.hadoop.dfs.DatanodeProtocol Detail:
 public BlockCrcInfo blockCrcUpgradeGetBlockLocations(Block block) throws IOException
    Get locations for a given block. This is used only during Block Level CRC upgrades (HADOOP-1134), when a datanode node misses the cluster wide distributed upgrade. It uses the same BlockCrcInfo class, that is also used during distributed upgrade
 public  void blockReceived(DatanodeRegistration registration,
    Block[] blocks) throws IOException
    blockReceived() allows the DataNode to tell the NameNode about recently-received block data. For example, whenever client code writes a new Block here, or another DataNode copies a Block to this DataNode, it will call blockReceived().
 public DatanodeCommand blockReport(DatanodeRegistration registration,
    Block[] blocks) throws IOException
    blockReport() tells the NameNode about all the locally-stored blocks. The NameNode returns an array of Blocks that have become obsolete and should be deleted. This function is meant to upload *all* the locally-stored blocks. It's invoked upon startup and then infrequently afterwards.
 public  void errorReport(DatanodeRegistration registration,
    int errorCode,
    String msg) throws IOException
    errorReport() tells the NameNode about something that has gone awry. Useful for debugging.
 public UpgradeCommand processUpgradeCommand(UpgradeCommand comm) throws IOException
    This is a very general way to send a command to the name-node during distributed upgrade process. The generosity is because the variety of upgrade commands is unpredictable. The reply from the name-node is also received in the form of an upgrade command.
 public DatanodeRegistration register(DatanodeRegistration registration,
    String networkLocation) throws IOException
    Register Datanode.
 public DatanodeCommand sendHeartbeat(DatanodeRegistration registration,
    long capacity,
    long remaining,
    int xmitsInProgress,
    int xceiverCount) throws IOException
    sendHeartbeat() tells the NameNode that the DataNode is still alive and well. Includes some status info, too. It also gives the NameNode a chance to return a "DatanodeCommand" object. A DatanodeCommand tells the DataNode to invalidate local block(s), or to copy them to other DataNodes, etc.
 public NamespaceInfo versionRequest() throws IOException