org.apache.nutch.ndfs
Class DatanodeInfo

java.lang.Object
  extended byorg.apache.nutch.ndfs.DatanodeInfo
All Implemented Interfaces:
Comparable, Writable

public class DatanodeInfo
extends Object
implements Writable, Comparable

DatanodeInfo tracks stats on a given node

Author:
Mike Cafarella

Constructor Summary
DatanodeInfo()
           
DatanodeInfo(UTF8 name)
           
DatanodeInfo(UTF8 name, long capacity, long remaining)
           
 
Method Summary
 void addBlock(Block b)
           
 int compareTo(Object o)
           
 Iterator getBlockIterator()
           
 Block[] getBlocks()
           
 long getCapacity()
           
 UTF8 getHost()
           
 UTF8 getName()
           
 long getRemaining()
           
 long lastObsoleteCheck()
           
 long lastUpdate()
           
 void readFields(DataInput in)
          Reads the fields of this object from in.
 String toString()
           
 void updateBlocks(Block[] newBlocks)
           
 void updateHeartbeat(long capacity, long remaining)
           
 void updateObsoleteCheck()
           
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatanodeInfo

public DatanodeInfo()

DatanodeInfo

public DatanodeInfo(UTF8 name)

DatanodeInfo

public DatanodeInfo(UTF8 name,
                    long capacity,
                    long remaining)
Method Detail

updateBlocks

public void updateBlocks(Block[] newBlocks)

addBlock

public void addBlock(Block b)

updateHeartbeat

public void updateHeartbeat(long capacity,
                            long remaining)

getName

public UTF8 getName()

getHost

public UTF8 getHost()

toString

public String toString()

getBlocks

public Block[] getBlocks()

getBlockIterator

public Iterator getBlockIterator()

getCapacity

public long getCapacity()

getRemaining

public long getRemaining()

lastUpdate

public long lastUpdate()

updateObsoleteCheck

public void updateObsoleteCheck()

lastObsoleteCheck

public long lastObsoleteCheck()

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

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
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
Throws:
IOException


Copyright © 2006 The Apache Software Foundation