public class DirectInvertedOutputStream extends AbstractPostingOutputStream implements Closeable
Modifier and Type | Field and Description |
---|---|
protected int |
lastDocid |
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(OutputStream os)
Creates a new output stream, writing a BitOutputStream to the specified file.
|
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.
|
int |
getLastDocidWritten() |
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 int lastDocid
protected static final org.slf4j.Logger logger
public DirectInvertedOutputStream(OutputStream os) throws IOException
os
- stream to write toIOException
public DirectInvertedOutputStream(String filename) throws IOException
filename
- Location of the file to write toIOException
public DirectInvertedOutputStream(BitOut out)
out
- BitOut implementation to write the file topublic Class<? extends IterablePosting> getPostingIteratorClass()
getPostingIteratorClass
in class AbstractPostingOutputStream
public BitIndexPointer writePostings(int[][] postings, int firstId) throws IOException
postings
- The postings to write outfirstId
- the (delta) value of the first docid to write out.IOException
public BitIndexPointer writePostings(Iterator<Posting> iterator) throws IOException
writePostings
in class AbstractPostingOutputStream
iterator
- an Iterator of Posting objectsIOException
public BitIndexPointer writePostings(Iterator<Posting> iterator, int previousId) throws IOException
writePostings
in class AbstractPostingOutputStream
iterator
- an Iterator of Posting objectspreviousId
- id of the previous posting in this streamIOException
public BitIndexPointer writePostings(IterablePosting postings, int previousId) throws IOException
writePostings
in class AbstractPostingOutputStream
postings
- IterablePosting postings accessed through an IterablePosting objectpreviousId
- id of the previous posting in this streamIOException
public BitIndexPointer writePostings(IterablePosting postings) throws IOException
writePostings
in class AbstractPostingOutputStream
postings
- IterablePosting postings accessed through an IterablePosting objectIOException
protected void writePostingNotDocid(Posting p) throws IOException
IOException
public BitIndexPointer writePostings(int[][] postings, int startOffset, int Length, int firstId) throws IOException
writePostings
in class AbstractPostingOutputStream
postings
- 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.IOException
protected 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 Closeable
close
in interface AutoCloseable
close
in class AbstractPostingOutputStream
public BitFilePosition getOffset()
getOffset
in class AbstractPostingOutputStream
public long getByteOffset()
public byte getBitOffset()
public BitOut getBitOut()
public int getLastDocidWritten()
getLastDocidWritten
in class AbstractPostingOutputStream
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow