org.apache.nutch.ndfs
Class Block

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

public class Block
extends Object
implements Writable, Comparable

A Block is a Nutch FS primitive, identified by a long.

Author:
Mike Cafarella

Constructor Summary
Block()
           
Block(File f, long len)
          Find the blockid from the given filename
Block(long blkid, long len)
           
 
Method Summary
 int compareTo(Object o)
           
 long getBlockId()
           
 String getBlockName()
           
 long getNumBytes()
           
static boolean isBlockFilename(File f)
           
 void readFields(DataInput in)
          Reads the fields of this object from in.
 void setNumBytes(long len)
           
 String toString()
           
 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

Block

public Block()

Block

public Block(long blkid,
             long len)

Block

public Block(File f,
             long len)
Find the blockid from the given filename

Method Detail

isBlockFilename

public static boolean isBlockFilename(File f)

getBlockId

public long getBlockId()

getBlockName

public String getBlockName()

getNumBytes

public long getNumBytes()

setNumBytes

public void setNumBytes(long len)

toString

public String toString()

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

compareTo

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


Copyright © 2006 The Apache Software Foundation