org.supermind.crawl
Class MapFileLongPersister

java.lang.Object
  extended by org.supermind.crawl.MapFileLongPersister
Direct Known Subclasses:
MapFileScatterPurger

public class MapFileLongPersister
extends java.lang.Object

Saves Long values to a MapFile.


Constructor Summary
MapFileLongPersister(org.apache.nutch.fs.NutchFileSystem nfs, java.lang.String tmpfile, java.lang.String mapdir, boolean overwrite)
           
MapFileLongPersister(java.lang.String tmpfile, java.lang.String mapdir, boolean overwrite)
           
 
Method Summary
 void add(long value)
           
 void close()
           
 boolean contains(long v)
           
protected  void flushToDisk()
          Flush the buffer to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapFileLongPersister

public MapFileLongPersister(org.apache.nutch.fs.NutchFileSystem nfs,
                            java.lang.String tmpfile,
                            java.lang.String mapdir,
                            boolean overwrite)
                     throws java.io.IOException
Throws:
java.io.IOException

MapFileLongPersister

public MapFileLongPersister(java.lang.String tmpfile,
                            java.lang.String mapdir,
                            boolean overwrite)
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

add

public void add(long value)
         throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

contains

public boolean contains(long v)
                 throws java.io.IOException
Throws:
java.io.IOException

flushToDisk

protected void flushToDisk()
                    throws java.io.IOException
Flush the buffer to disk. Buffer entries are appended to the tmpfile, which is then sorted. A MapFile is created from the sorted file, so that fast access to the entries is possible.

Throws:
java.io.IOException