org.apache.nutch.io
Class SequenceFile.Writer

java.lang.Object
  extended byorg.apache.nutch.io.SequenceFile.Writer
Enclosing class:
SequenceFile

public static class SequenceFile.Writer
extends Object

Write key/value pairs to a sequence-format file.


Constructor Summary
SequenceFile.Writer(NutchFileSystem nfs, String name, Class keyClass, Class valClass)
          Create the named file.
 
Method Summary
 void append(byte[] data, int start, int length, int keyLength)
          Append a key/value pair.
 void append(Writable key, Writable val)
          Append a key/value pair.
 void close()
          Close the file.
 Class getKeyClass()
          Returns the class of keys in this file.
 long getLength()
          Returns the current length of the output file.
 Class getValueClass()
          Returns the class of values in this file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFile.Writer

public SequenceFile.Writer(NutchFileSystem nfs,
                           String name,
                           Class keyClass,
                           Class valClass)
                    throws IOException
Create the named file.

Method Detail

getKeyClass

public Class getKeyClass()
Returns the class of keys in this file.


getValueClass

public Class getValueClass()
Returns the class of values in this file.


close

public void close()
           throws IOException
Close the file.

Throws:
IOException

append

public void append(Writable key,
                   Writable val)
            throws IOException
Append a key/value pair.

Throws:
IOException

append

public void append(byte[] data,
                   int start,
                   int length,
                   int keyLength)
            throws IOException
Append a key/value pair.

Throws:
IOException

getLength

public long getLength()
               throws IOException
Returns the current length of the output file.

Throws:
IOException


Copyright © 2006 The Apache Software Foundation