public class RunWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected BitOutputStream |
bos
Underlying
BitOutputStream to write the compressed objects |
protected String |
info
Debug String representation of this RunWriter
|
protected DataOutputStream |
stringDos
Underlying
DataOutputStream to write the term Strings |
| Modifier | Constructor and Description |
|---|---|
protected |
RunWriter() |
protected |
RunWriter(BitOutputStream _bos,
DataOutputStream _stringDos)
other constructor for use by subclasses
|
|
RunWriter(String fileName,
String termsFile)
Instanciates a RunWriter, given the filenames to write.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginWrite(int maxSize,
int size)
Writes the headers of the run.
|
void |
finishWrite()
Closes the output streams.
|
String |
toString() |
boolean |
writeSorted()
Returns true if this RunWriter needs writeTerm() to be called sorted by term
|
void |
writeTerm(String term,
Posting post)
Writes the information for a given term.
|
protected final BitOutputStream bos
BitOutputStream to write the compressed objectsprotected final DataOutputStream stringDos
DataOutputStream to write the term Stringsprotected String info
protected RunWriter()
protected RunWriter(BitOutputStream _bos, DataOutputStream _stringDos) throws IOException
IOExceptionpublic RunWriter(String fileName, String termsFile) throws IOException
fileName - name of the file to write the posting lists data.termsFile - name of the file to write the terms.IOException - if an I/O error occurs.public boolean writeSorted()
public void beginWrite(int maxSize,
int size)
throws IOException
maxSize - max size of a posting.size - number of postings in the run.IOException - if an I/O error occurs.public void writeTerm(String term, Posting post) throws IOException
term - the term to write.post - the Posting with the data of the term.IOException - if an I/O error occurs.public void finishWrite()
throws IOException
IOException - if an I/O error occurs.Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow