org.apache.hadoop.dfs
Class DatanodeInfo

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

public class DatanodeInfo
extends DatanodeID
implements Node

DatanodeInfo represents the status of a DataNode. This object is used for communication in the Datanode Protocol and the Client Protocol.

Author:
Mike Cafarella, Konstantin Shvachko

Nested Class Summary
static class DatanodeInfo.AdminStates
           
 
Field Summary
protected  DatanodeInfo.AdminStates adminState
           
protected  long capacity
           
protected  long lastUpdate
           
protected  long remaining
           
protected  int xceiverCount
           
 
Fields inherited from class org.apache.hadoop.dfs.DatanodeID
infoPort, name, storageID
 
Method Summary
 long getCapacity()
          The raw capacity.
 String getDatanodeReport()
          A formatted string for reporting the status of the DataNode.
 String getHostName()
           
 long getLastUpdate()
          The time when this information was accurate.
 int getLevel()
          Return this node's level in the tree.
 String getNetworkLocation()
          rack name
 Node getParent()
          Return this node's parent
 String getPath()
           
 long getRemaining()
          The raw free space.
 int getXceiverCount()
          number of active connections
 void readFields(DataInput in)
          Reads the fields of this object from in.
 void setHostName(String host)
           
 void setLevel(int level)
           
 void setParent(Node parent)
           
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class org.apache.hadoop.dfs.DatanodeID
compareTo, equals, getHost, getInfoPort, 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

capacity

protected long capacity

remaining

protected long remaining

lastUpdate

protected long lastUpdate

xceiverCount

protected int xceiverCount

adminState

protected DatanodeInfo.AdminStates adminState
Method Detail

getCapacity

public long getCapacity()
The raw capacity.


getRemaining

public long getRemaining()
The raw free space.


getLastUpdate

public long getLastUpdate()
The time when this information was accurate.


getXceiverCount

public int getXceiverCount()
number of active connections


getNetworkLocation

public String getNetworkLocation()
rack name

Specified by:
getNetworkLocation in interface Node

getPath

public String getPath()

getHostName

public String getHostName()

setHostName

public void setHostName(String host)

getDatanodeReport

public String getDatanodeReport()
A formatted string for reporting the status of the DataNode.


getParent

public Node getParent()
Return this node's parent

Specified by:
getParent in interface Node

setParent

public void setParent(Node parent)

getLevel

public int getLevel()
Return this node's level in the tree. E.g. the root of a tree returns 0 and its children return 1

Specified by:
getLevel in interface Node

setLevel

public void setLevel(int level)

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Writes the fields of this object to out.

Specified by:
write in interface Writable
Overrides:
write in class DatanodeID
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Overrides:
readFields in class DatanodeID
Throws:
IOException


Copyright © 2006 The Apache Software Foundation