org.supermind.crawl.util
Class LongLongPersister

java.lang.Object
  extended by org.supermind.crawl.util.MapFilePersister<java.lang.Long,java.lang.Long>
      extended by org.supermind.crawl.util.LongLongPersister

public class LongLongPersister
extends MapFilePersister<java.lang.Long,java.lang.Long>


Field Summary
 
Fields inherited from class org.supermind.crawl.util.MapFilePersister
baseDir, buffer, bufferIdx, LOG, mapdir, mapdirFile, maxBufferSize, nfs, overwrite, reader
 
Constructor Summary
LongLongPersister()
           
 
Method Summary
 boolean contains(long key)
           
protected  org.apache.nutch.io.WritableComparator getKeyComparator()
          Get comparator for MapFile key class.
 org.apache.nutch.io.WritableComparable getKeyInstance(java.lang.Long aLong, boolean throwaway)
          Return a new instance of the key.
 java.util.Comparator<java.lang.Long> getTypeComparator()
          Get comparator for type.
 long getValue(long key)
          Get value for key.
 org.apache.nutch.io.Writable getValueInstance(java.lang.Long aLong, boolean throwaway)
          Return a new instance of the value.
 
Methods inherited from class org.supermind.crawl.util.MapFilePersister
add, close, flushToDisk, init, setBaseDir, setMaxBufferSize, setNfs, setOverwrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongLongPersister

public LongLongPersister()
Method Detail

contains

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

getKeyComparator

protected org.apache.nutch.io.WritableComparator getKeyComparator()
Description copied from class: MapFilePersister
Get comparator for MapFile key class.

Specified by:
getKeyComparator in class MapFilePersister<java.lang.Long,java.lang.Long>
Returns:

getKeyInstance

public org.apache.nutch.io.WritableComparable getKeyInstance(java.lang.Long aLong,
                                                             boolean throwaway)
Description copied from class: MapFilePersister
Return a new instance of the key.

Specified by:
getKeyInstance in class MapFilePersister<java.lang.Long,java.lang.Long>
Returns:

getTypeComparator

public java.util.Comparator<java.lang.Long> getTypeComparator()
Description copied from class: MapFilePersister
Get comparator for type.

Specified by:
getTypeComparator in class MapFilePersister<java.lang.Long,java.lang.Long>
Returns:

getValue

public long getValue(long key)
              throws java.io.IOException
Get value for key.

Parameters:
key -
Returns:
value, or -1 if key doesn't exist
Throws:
java.io.IOException

getValueInstance

public org.apache.nutch.io.Writable getValueInstance(java.lang.Long aLong,
                                                     boolean throwaway)
Description copied from class: MapFilePersister
Return a new instance of the value. Defaults to NullWritable.get().

Overrides:
getValueInstance in class MapFilePersister<java.lang.Long,java.lang.Long>
Returns: