Package org.terrier.structures
Class FSOMapFileLexicon
- java.lang.Object
-
- org.terrier.structures.Lexicon<K1>
-
- org.terrier.structures.MapLexicon<K1,K2>
-
- org.terrier.structures.FSOMapFileLexiconGeneric<java.lang.String,org.apache.hadoop.io.Text>
-
- org.terrier.structures.FSOMapFileLexicon
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Iterable<java.util.Map.Entry<java.lang.String,LexiconEntry>>
public class FSOMapFileLexicon extends FSOMapFileLexiconGeneric<java.lang.String,org.apache.hadoop.io.Text>
Instance of a Lexicon<String> where a FSOrderedMapFile is always used as a backing store.Index Properties:
- index.STRUCTURENAME.bsearchshortcut - depicts if the String lookups can be sped up using a binary search shortcut. Possible values are {charmap,default}. Charmap means a hashmap object will be read into memory that defines where to look for a given starting character of the lookup string.
- See also the super-class
- Since:
- 3.0
- Author:
- Craig Macdonald
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FSOMapFileLexicon.MapFileLexiconEntryIterator
static class
FSOMapFileLexicon.MapFileLexiconIterator
-
Nested classes/interfaces inherited from class org.terrier.structures.MapLexicon
MapLexicon.Id2EntryIndexLookup, MapLexicon.IdIsIndex
-
Nested classes/interfaces inherited from class org.terrier.structures.Lexicon
Lexicon.LexiconFileEntry<KEY2>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HASH_EXT
-
Fields inherited from class org.terrier.structures.FSOMapFileLexiconGeneric
ID_EXT, MAPFILE_EXT
-
Fields inherited from class org.terrier.structures.MapLexicon
keyFactory, map, modificationLock
-
-
Constructor Summary
Constructors Constructor Description FSOMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, FixedSizeWriteableFactory<LexiconEntry> _valueFactory, java.lang.String termIdLookup, java.lang.String termLookup, java.lang.String dataFile)
FSOMapFileLexicon(java.lang.String structureName, IndexOnDisk index)
Construct a new FSOMapFileLexicon
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
deleteMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix)
Delete a FSOMapFileLexicon within the specified index locationjava.util.Iterator<java.util.Map.Entry<java.lang.String,LexiconEntry>>
iterator()
static void
renameMapFileLexicon(java.lang.String SrcStructureName, java.lang.String SrcPath, java.lang.String SrcPrefix, java.lang.String destStructureName, java.lang.String destPath, java.lang.String destPrefix)
Rename a FSOMapFileLexicon within the specified index locationprotected void
setK2(java.lang.String key, org.apache.hadoop.io.Text instance)
protected java.lang.String
toK1(org.apache.hadoop.io.Text key)
-
Methods inherited from class org.terrier.structures.FSOMapFileLexiconGeneric
constructFilename
-
Methods inherited from class org.terrier.structures.MapLexicon
close, getIthLexiconEntry, getLexiconEntry, getLexiconEntry, getLexiconEntryRange, numberOfEntries, setTermIdLookup
-
-
-
-
Field Detail
-
HASH_EXT
public static final java.lang.String HASH_EXT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FSOMapFileLexicon
public FSOMapFileLexicon(java.lang.String structureName, IndexOnDisk index) throws java.io.IOException
Construct a new FSOMapFileLexicon- Throws:
java.io.IOException
-
FSOMapFileLexicon
public FSOMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, FixedSizeWriteableFactory<LexiconEntry> _valueFactory, java.lang.String termIdLookup, java.lang.String termLookup, java.lang.String dataFile) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.String,LexiconEntry>> iterator()
-
toK1
protected java.lang.String toK1(org.apache.hadoop.io.Text key)
- Specified by:
toK1
in classMapLexicon<java.lang.String,org.apache.hadoop.io.Text>
-
setK2
protected void setK2(java.lang.String key, org.apache.hadoop.io.Text instance)
- Specified by:
setK2
in classMapLexicon<java.lang.String,org.apache.hadoop.io.Text>
-
renameMapFileLexicon
public static void renameMapFileLexicon(java.lang.String SrcStructureName, java.lang.String SrcPath, java.lang.String SrcPrefix, java.lang.String destStructureName, java.lang.String destPath, java.lang.String destPrefix)
Rename a FSOMapFileLexicon within the specified index location
-
deleteMapFileLexicon
public static void deleteMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix)
Delete a FSOMapFileLexicon within the specified index location
-
-