org.terrier.structures.collections
Class FSOrderedMapFile.MultiFSOMapWriter

java.lang.Object
  extended by org.terrier.structures.collections.FSOrderedMapFile.MultiFSOMapWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, FSOrderedMapFile.MapFileWriter
Enclosing class:
FSOrderedMapFile<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>

public static class FSOrderedMapFile.MultiFSOMapWriter
extends java.lang.Object
implements FSOrderedMapFile.MapFileWriter, java.io.Flushable

Writes out a FSOMapFile, but assumes that input data need not be sorted by key.


Field Summary
protected  FixedSizeWriteableFactory keyFactory
           
protected  FixedSizeWriteableFactory valueFactory
           
 
Constructor Summary
FSOrderedMapFile.MultiFSOMapWriter(java.lang.String filename, int numberOfValuesInMemory, FixedSizeWriteableFactory _keyFactory, FixedSizeWriteableFactory _valueFactory)
          Constructs an instance of the MultiFSOMapWriter.
 
Method Summary
 void close()
          
 void flush()
          
protected  void flushCache()
           
protected  void mergeTwo(int id1, int id2, java.lang.String filename)
           
 void write(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable value)
          Add this (key, value) tuple to the MapFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyFactory

protected FixedSizeWriteableFactory keyFactory

valueFactory

protected FixedSizeWriteableFactory valueFactory
Constructor Detail

FSOrderedMapFile.MultiFSOMapWriter

public FSOrderedMapFile.MultiFSOMapWriter(java.lang.String filename,
                                          int numberOfValuesInMemory,
                                          FixedSizeWriteableFactory _keyFactory,
                                          FixedSizeWriteableFactory _valueFactory)
Constructs an instance of the MultiFSOMapWriter.

Parameters:
filename -
numberOfValuesInMemory -
_keyFactory -
_valueFactory -
Method Detail

write

public void write(org.apache.hadoop.io.WritableComparable key,
                  org.apache.hadoop.io.Writable value)
           throws java.io.IOException
Add this (key, value) tuple to the MapFile

Specified by:
write in interface FSOrderedMapFile.MapFileWriter
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException

Specified by:
flush in interface java.io.Flushable
Throws:
java.io.IOException

flushCache

protected void flushCache()
                   throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

mergeTwo

protected void mergeTwo(int id1,
                        int id2,
                        java.lang.String filename)
                 throws java.io.IOException
Throws:
java.io.IOException


Terrier 3.5. Copyright © 2004-2011 University of Glasgow