|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.structures.indexing.singlepass.MemoryPostings
public class MemoryPostings
Class for handling Simple posting lists in memory while indexing.
| Field Summary | |
|---|---|
protected long |
keyBytes
|
protected static org.apache.log4j.Logger |
logger
logger to use in this class |
protected int |
maxSize
The number of documents for any term in this run |
protected long |
numPointers
Number of pointers ( |
protected java.util.Map<java.lang.String,Posting> |
postings
Hashmap indexed by the term, containing the posting lists |
protected long |
valueBytes
|
| Constructor Summary | |
|---|---|
MemoryPostings()
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.String term,
int doc,
int frequency)
Adds an occurrence of a term in a document to the posting in memory. |
void |
addTerms(DocumentPostingList docPostings,
int docid)
Add the terms in a DocumentPostingList to the postings in memory. |
void |
finish(RunWriter runWriter)
Triggers the writing of the postings in memory to the specified RunWriter. |
void |
finish(java.lang.String[] file)
Triggers the writing of the postings in memory to disk. |
long |
getMemoryConsumption()
Returns the number of bytes consumed by this set of postings |
long |
getPointers()
Returns the number of pointers in this posting list. |
int |
getSize()
Returns the number of terms in this posting list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger logger
protected java.util.Map<java.lang.String,Posting> postings
protected int maxSize
protected long numPointers
protected long keyBytes
protected long valueBytes
| Constructor Detail |
|---|
public MemoryPostings()
| Method Detail |
|---|
public void addTerms(DocumentPostingList docPostings,
int docid)
throws java.io.IOException
docPostings - DocumentPostingList containing the term information for the denoted document.docid - Current document Identifier.
java.io.IOException - if an I/O error occurs.
public void add(java.lang.String term,
int doc,
int frequency)
throws java.io.IOException
term - String representing the term.doc - int containing the document identifier.frequency - int containing the frequency of the term in the document.
java.io.IOException - if an I/O error occurs.
public void finish(java.lang.String[] file)
throws java.io.IOException
file - name of the file to write the postings.
java.io.IOException - if an I/O error occurs.
public void finish(RunWriter runWriter)
throws java.io.IOException
runWriter -
java.io.IOExceptionpublic int getSize()
public long getMemoryConsumption()
public long getPointers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||