org.apache.hadoop.dfs
Class DatanodeDescriptor

java.lang.Object
  extended by org.apache.hadoop.dfs.DatanodeID
      extended by org.apache.hadoop.dfs.DatanodeInfo
          extended by org.apache.hadoop.dfs.DatanodeDescriptor
All Implemented Interfaces:
Comparable<DatanodeID>, Writable, WritableComparable<DatanodeID>, Node

public class DatanodeDescriptor
extends DatanodeInfo

DatanodeDescriptor tracks stats on a given DataNode, such as available storage capacity, last update time, etc., and maintains a set of blocks stored on the datanode. This data structure is a data structure that is internal to the namenode. It is *not* sent over-the-wire to the Client or the Datnodes. Neither is it stored persistently in the fsImage.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.dfs.DatanodeInfo
DatanodeInfo.AdminStates
 
Field Summary
protected  boolean isAlive
           
 
Fields inherited from class org.apache.hadoop.dfs.DatanodeInfo
adminState, capacity, dfsUsed, hostName, lastUpdate, location, remaining, xceiverCount
 
Fields inherited from class org.apache.hadoop.dfs.DatanodeID
infoPort, ipcPort, name, storageID
 
Constructor Summary
DatanodeDescriptor()
          Default constructor
DatanodeDescriptor(DatanodeID nodeID)
          DatanodeDescriptor constructor
DatanodeDescriptor(DatanodeID nodeID, long capacity, long dfsUsed, long remaining, int xceiverCount)
          DatanodeDescriptor constructor
DatanodeDescriptor(DatanodeID nodeID, String networkLocation)
          DatanodeDescriptor constructor
DatanodeDescriptor(DatanodeID nodeID, String networkLocation, String hostName)
          DatanodeDescriptor constructor
DatanodeDescriptor(DatanodeID nodeID, String networkLocation, String hostName, long capacity, long dfsUsed, long remaining, int xceiverCount)
          DatanodeDescriptor constructor
 
Method Summary
 int getBlocksScheduled()
           
 
Methods inherited from class org.apache.hadoop.dfs.DatanodeInfo
getCapacity, getDatanodeReport, getDfsUsed, getHostName, getLastUpdate, getLevel, getNetworkLocation, getParent, getRemaining, getXceiverCount, readFields, setHostName, setLevel, setNetworkLocation, setParent, write
 
Methods inherited from class org.apache.hadoop.dfs.DatanodeID
compareTo, equals, getHost, getInfoPort, getIpcPort, getName, getPort, getStorageID, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.net.Node
getName
 

Field Detail

isAlive

protected boolean isAlive
Constructor Detail

DatanodeDescriptor

public DatanodeDescriptor()
Default constructor


DatanodeDescriptor

public DatanodeDescriptor(DatanodeID nodeID)
DatanodeDescriptor constructor

Parameters:
nodeID - id of the data node

DatanodeDescriptor

public DatanodeDescriptor(DatanodeID nodeID,
                          String networkLocation)
DatanodeDescriptor constructor

Parameters:
nodeID - id of the data node
networkLocation - location of the data node in network

DatanodeDescriptor

public DatanodeDescriptor(DatanodeID nodeID,
                          String networkLocation,
                          String hostName)
DatanodeDescriptor constructor

Parameters:
nodeID - id of the data node
networkLocation - location of the data node in network
hostName - it could be different from host specified for DatanodeID

DatanodeDescriptor

public DatanodeDescriptor(DatanodeID nodeID,
                          long capacity,
                          long dfsUsed,
                          long remaining,
                          int xceiverCount)
DatanodeDescriptor constructor

Parameters:
nodeID - id of the data node
capacity - capacity of the data node
dfsUsed - space used by the data node
remaining - remaing capacity of the data node
xceiverCount - # of data transfers at the data node

DatanodeDescriptor

public DatanodeDescriptor(DatanodeID nodeID,
                          String networkLocation,
                          String hostName,
                          long capacity,
                          long dfsUsed,
                          long remaining,
                          int xceiverCount)
DatanodeDescriptor constructor

Parameters:
nodeID - id of the data node
networkLocation - location of the data node in network
capacity - capacity of the data node, including space used by non-dfs
dfsUsed - the used space by dfs datanode
remaining - remaing capacity of the data node
xceiverCount - # of data transfers at the data node
Method Detail

getBlocksScheduled

public int getBlocksScheduled()
Returns:
Approximate number of blocks currently scheduled to be written to this datanode.


Copyright © 2008 The Apache Software Foundation