public class DirectInvertedOutputStream extends AbstractPostingOutputStream implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger
The logger used
|
protected BitOut |
output
what to write to
|
| Constructor and Description |
|---|
DirectInvertedOutputStream(BitOut out)
Creates a new output stream, writing to the specified BitOut implementation.
|
DirectInvertedOutputStream(String filename)
Creates a new output stream, writing a BitOutputStream to the specified file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close this object.
|
byte |
getBitOffset()
Deprecated.
|
BitOut |
getBitOut()
Return the underlying BitOut implementation being used by the class
|
long |
getByteOffset()
Deprecated.
|
BitFilePosition |
getOffset()
What is current offset?
|
Class<? extends IterablePosting> |
getPostingIteratorClass()
Returns the IterablePosting class to use for reading structure written by this class
|
protected BitIndexPointer |
writeNoFieldPostings(int[][] postings,
int offset,
int length,
int firstId)
Writes the given postings to the bit file.
|
protected void |
writePostingNotDocid(Posting p)
Hook method for writing out the remainder of the posting
|
BitIndexPointer |
writePostings(int[][] postings,
int firstId)
Write out the specified postings.
|
BitIndexPointer |
writePostings(int[][] postings,
int startOffset,
int Length,
int firstId)
Write out a range of the specified postings.
|
BitIndexPointer |
writePostings(IterablePosting postings)
Write out the specified postings.
|
BitIndexPointer |
writePostings(IterablePosting postings,
int previousId)
Write out the specified postings, but allowing the delta for the first document to be adjusted
|
BitIndexPointer |
writePostings(Iterator<Posting> iterator)
Write out the specified postings.
|
BitIndexPointer |
writePostings(Iterator<Posting> iterator,
int previousId)
Write out the specified postings, but allowing the delta for the first document to be adjusted
|
protected BitOut output
protected static final org.slf4j.Logger logger
public DirectInvertedOutputStream(String filename) throws IOException
filename - Location of the file to write toIOExceptionpublic DirectInvertedOutputStream(BitOut out)
out - BitOut implementation to write the file topublic Class<? extends IterablePosting> getPostingIteratorClass()
getPostingIteratorClass in class AbstractPostingOutputStreampublic BitIndexPointer writePostings(int[][] postings, int firstId) throws IOException
postings - The postings to write outfirstId - the (delta) value of the first docid to write out.IOExceptionpublic BitIndexPointer writePostings(Iterator<Posting> iterator) throws IOException
writePostings in class AbstractPostingOutputStreamiterator - an Iterator of Posting objectsIOExceptionpublic BitIndexPointer writePostings(Iterator<Posting> iterator, int previousId) throws IOException
writePostings in class AbstractPostingOutputStreamiterator - an Iterator of Posting objectspreviousId - id of the previous posting in this streamIOExceptionpublic BitIndexPointer writePostings(IterablePosting postings, int previousId) throws IOException
writePostings in class AbstractPostingOutputStreampostings - IterablePosting postings accessed through an IterablePosting objectpreviousId - id of the previous posting in this streamIOExceptionpublic BitIndexPointer writePostings(IterablePosting postings) throws IOException
writePostings in class AbstractPostingOutputStreampostings - IterablePosting postings accessed through an IterablePosting objectIOExceptionprotected void writePostingNotDocid(Posting p) throws IOException
IOExceptionpublic BitIndexPointer writePostings(int[][] postings, int startOffset, int Length, int firstId) throws IOException
writePostings in class AbstractPostingOutputStreampostings - The postings to write outstartOffset - The location of the first posting to write out.Length - The number of postings to be written out.firstId - the (delta) value of the first docid to write out.IOExceptionprotected BitIndexPointer writeNoFieldPostings(int[][] postings, int offset, int length, int firstId) throws IOException
postings - the postings list to write.firstId - the first identifier to write. This can be
an id plus one, or the gap of the current id and the previous one.offset - The location of the first posting to write out.length - The number of postings to be written out.IOException - if an error occurs during writing to a file.public void close()
close in interface Closeableclose in interface AutoCloseableclose in class AbstractPostingOutputStreampublic BitFilePosition getOffset()
getOffset in class AbstractPostingOutputStreampublic long getByteOffset()
public byte getBitOffset()
public BitOut getBitOut()
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow