net.nutch.fs
Class DatanodeInfo

java.lang.Object
  extended bynet.nutch.fs.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, UTF8 machineName, int port, long capacity, long remaining)
           
 
Method Summary
 void addBlock(Block b)
           
 int compareTo(Object o)
           
 Block[] getBlocks()
           
 long getCapacity()
           
 UTF8 getMachineName()
           
 UTF8 getName()
           
 int getPort()
           
 long getRemaining()
           
 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 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,
                    UTF8 machineName,
                    int port,
                    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()

toString

public String toString()

getMachineName

public UTF8 getMachineName()

getPort

public int getPort()

getBlocks

public Block[] getBlocks()

getCapacity

public long getCapacity()

getRemaining

public long getRemaining()

lastUpdate

public long lastUpdate()

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 © 2004 The Nutch Organization.