Class FSOrderedMapFile.MultiFSOMapWriter
- java.lang.Object
-
- org.terrier.structures.collections.FSOrderedMapFile.MultiFSOMapWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,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
Fields Modifier and Type Field Description protected FixedSizeWriteableFactorykeyFactoryprotected FixedSizeWriteableFactoryvalueFactory
-
Constructor Summary
Constructors Constructor Description MultiFSOMapWriter(java.lang.String filename, int numberOfValuesInMemory, FixedSizeWriteableFactory _keyFactory, FixedSizeWriteableFactory _valueFactory)Constructs an instance of the MultiFSOMapWriter.MultiFSOMapWriter(java.lang.String filename, int numberOfValuesInMemory, FixedSizeWriteableFactory _keyFactory, FixedSizeWriteableFactory _valueFactory, boolean dupsAllows)Constructs an instance of the MultiFSOMapWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()protected voidflushCache()protected voidmergeTwo(int id1, int id2, java.lang.String filename)voidwrite(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable value)Add this (key, value) tuple to the MapFile
-
-
-
Field Detail
-
keyFactory
protected FixedSizeWriteableFactory keyFactory
-
valueFactory
protected FixedSizeWriteableFactory valueFactory
-
-
Constructor Detail
-
MultiFSOMapWriter
public MultiFSOMapWriter(java.lang.String filename, int numberOfValuesInMemory, FixedSizeWriteableFactory _keyFactory, FixedSizeWriteableFactory _valueFactory)Constructs an instance of the MultiFSOMapWriter.- Parameters:
filename-numberOfValuesInMemory-_keyFactory-_valueFactory-
-
MultiFSOMapWriter
public MultiFSOMapWriter(java.lang.String filename, int numberOfValuesInMemory, FixedSizeWriteableFactory _keyFactory, FixedSizeWriteableFactory _valueFactory, boolean dupsAllows)Constructs an instance of the MultiFSOMapWriter.- Parameters:
filename-numberOfValuesInMemory-_keyFactory-_valueFactory-dupsAllows- are duplicates allowed
-
-
Method Detail
-
write
public void write(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable value) throws java.io.IOExceptionAdd this (key, value) tuple to the MapFile- Specified by:
writein interfaceFSOrderedMapFile.MapFileWriter- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.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
-
-