public class FSADocumentIndex extends FSArrayFile<DocumentIndexEntry> implements DocumentIndex
Modifier and Type | Class and Description |
---|---|
static class |
FSADocumentIndex.FSADocumentIndexIterator
Gets an iterator over the documents in this index
|
FSArrayFile.ArrayFileIterator<V extends org.apache.hadoop.io.Writable>, FSArrayFile.ArrayFileWriter
Modifier and Type | Field and Description |
---|---|
protected int[] |
docLengths |
protected int |
lastDocid |
protected DocumentIndexEntry |
lastEntry |
protected static org.slf4j.Logger |
logger |
dataFile, dataFilename, entrySize, numberOfEntries, USUAL_EXTENSION, valueFactory
modCount
Modifier | Constructor and Description |
---|---|
|
FSADocumentIndex(IndexOnDisk index,
String structureName)
Construct an instance of the class with
|
protected |
FSADocumentIndex(IndexOnDisk index,
String structureName,
boolean initialise) |
Modifier and Type | Method and Description |
---|---|
DocumentIndexEntry |
getDocumentEntry(int docid)
Get the document index entry based on its docid
|
int |
getDocumentLength(int docid)
Get the length of the document
|
int |
getNumberOfDocuments()
Get the number of documents
|
protected void |
initialise(IndexOnDisk index,
String structureName) |
close, get, iterator, size, writeFSArrayFile
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
protected static final org.slf4j.Logger logger
protected int lastDocid
protected DocumentIndexEntry lastEntry
protected int[] docLengths
public FSADocumentIndex(IndexOnDisk index, String structureName) throws IOException
index
- structureName
- IOException
protected FSADocumentIndex(IndexOnDisk index, String structureName, boolean initialise) throws IOException
IOException
protected void initialise(IndexOnDisk index, String structureName) throws IOException
IOException
public final int getDocumentLength(int docid) throws IOException
getDocumentLength
in interface DocumentIndex
IOException
public final DocumentIndexEntry getDocumentEntry(int docid) throws IOException
getDocumentEntry
in interface DocumentIndex
IOException
public int getNumberOfDocuments()
getNumberOfDocuments
in interface DocumentIndex
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow