Package org.terrier.structures
Class FSOMapFileLexiconOutputStream
- java.lang.Object
-
- org.terrier.structures.LexiconOutputStream<T1>
-
- org.terrier.structures.FSOMapFileLexiconOutputStreamGeneric<java.lang.String,org.apache.hadoop.io.Text>
-
- org.terrier.structures.FSOMapFileLexiconOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class FSOMapFileLexiconOutputStream extends FSOMapFileLexiconOutputStreamGeneric<java.lang.String,org.apache.hadoop.io.Text>
A LexiconOutputStream for FSOMapFileLexicon. Writes to a FSOrderedMapFile.- Since:
- 3.0
- Author:
- Craig Macdonald
-
-
Field Summary
-
Fields inherited from class org.terrier.structures.FSOMapFileLexiconOutputStreamGeneric
index, keyFactory, leValueClassname, mapFileWriter, structureName, tempKey
-
Fields inherited from class org.terrier.structures.LexiconOutputStream
lexiconStream, numPointersWritten, numTermsWritten, numTokensWritten
-
-
Constructor Summary
Constructors Constructor Description FSOMapFileLexiconOutputStream(java.lang.String path, java.lang.String prefix, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory)
FSOMapFileLexiconOutputStream(java.lang.String filename, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory)
FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, java.lang.Class<? extends FixedSizeWriteableFactory<LexiconEntry>> valueFactoryClass)
FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, java.lang.Class<? extends FixedSizeWriteableFactory<LexiconEntry>> valueFactoryClass)
FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, java.lang.String valueFactoryClassName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addLexiconToIndex(IndexOnDisk index, java.lang.String structureName, java.lang.String leValueClassname)
Adds Lexicon to indexvoid
close()
Closes the lexicon stream.protected void
setKey(java.lang.String k)
-
Methods inherited from class org.terrier.structures.FSOMapFileLexiconOutputStreamGeneric
addLexiconToIndex, writeNextEntry
-
Methods inherited from class org.terrier.structures.LexiconOutputStream
getNumberOfPointersWritten, getNumberOfTermsWritten, getNumberOfTokensWritten, incrementCounters
-
-
-
-
Constructor Detail
-
FSOMapFileLexiconOutputStream
public FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, java.lang.Class<? extends FixedSizeWriteableFactory<LexiconEntry>> valueFactoryClass) throws java.io.IOException
- Throws:
java.io.IOException
-
FSOMapFileLexiconOutputStream
public FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, java.lang.Class<? extends FixedSizeWriteableFactory<LexiconEntry>> valueFactoryClass) throws java.io.IOException
- Throws:
java.io.IOException
-
FSOMapFileLexiconOutputStream
public FSOMapFileLexiconOutputStream(IndexOnDisk _index, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, java.lang.String valueFactoryClassName) throws java.io.IOException
- Throws:
java.io.IOException
-
FSOMapFileLexiconOutputStream
public FSOMapFileLexiconOutputStream(java.lang.String filename, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory) throws java.io.IOException
- Throws:
java.io.IOException
-
FSOMapFileLexiconOutputStream
public FSOMapFileLexiconOutputStream(java.lang.String path, java.lang.String prefix, java.lang.String _structureName, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
setKey
protected void setKey(java.lang.String k)
- Specified by:
setKey
in classFSOMapFileLexiconOutputStreamGeneric<java.lang.String,org.apache.hadoop.io.Text>
-
close
public void close()
Description copied from class:LexiconOutputStream
Closes the lexicon stream. IOException if an I/O error occurs while closing the stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classFSOMapFileLexiconOutputStreamGeneric<java.lang.String,org.apache.hadoop.io.Text>
-
addLexiconToIndex
public static void addLexiconToIndex(IndexOnDisk index, java.lang.String structureName, java.lang.String leValueClassname)
Adds Lexicon to index- Parameters:
index
-structureName
-leValueClassname
-
-
-