org.apache.nutch.io
Class MapFile.Writer

java.lang.Object
  extended byorg.apache.nutch.io.MapFile.Writer
Direct Known Subclasses:
ArrayFile.Writer, SetFile.Writer
Enclosing class:
MapFile

public static class MapFile.Writer
extends Object

Writes a new map.


Constructor Summary
MapFile.Writer(NutchFileSystem nfs, String dirName, Class keyClass, Class valClass)
          Create the named map for keys of the named class.
MapFile.Writer(NutchFileSystem nfs, String dirName, WritableComparator comparator, Class valClass)
          Create the named map using the named key comparator.
 
Method Summary
 void append(WritableComparable key, Writable val)
          Append a key/value pair to the map.
 void close()
          Close the map.
 int getIndexInterval()
          The number of entries that are added before an index entry is added.
 void setIndexInterval(int interval)
          Sets the index interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapFile.Writer

public MapFile.Writer(NutchFileSystem nfs,
                      String dirName,
                      Class keyClass,
                      Class valClass)
               throws IOException
Create the named map for keys of the named class.


MapFile.Writer

public MapFile.Writer(NutchFileSystem nfs,
                      String dirName,
                      WritableComparator comparator,
                      Class valClass)
               throws IOException
Create the named map using the named key comparator.

Method Detail

getIndexInterval

public int getIndexInterval()
The number of entries that are added before an index entry is added.


setIndexInterval

public void setIndexInterval(int interval)
Sets the index interval.

See Also:
getIndexInterval()

close

public void close()
           throws IOException
Close the map.

Throws:
IOException

append

public void append(WritableComparable key,
                   Writable val)
            throws IOException
Append a key/value pair to the map. The key must be strictly greater than the previous key added to the map.

Throws:
IOException


Copyright © 2006 The Apache Software Foundation