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 FixedSizeWriteableFactory
keyFactory
protected FixedSizeWriteableFactory
valueFactory
-
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 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
-
-
-
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.IOException
Add this (key, value) tuple to the MapFile- Specified by:
write
in interfaceFSOrderedMapFile.MapFileWriter
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in 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
-
-