|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.postings.io.StreamPostingsInput
public class StreamPostingsInput
A postings input that can be used when streaming through a lot of postings sequentially as when merging or evaluating field queries. Random access is not supported, but sequential access should work well.
Field Summary | |
---|---|
protected byte[] |
b
Our in-memory buffer. |
protected static java.lang.String |
logTag
|
protected long |
me
The offset of the end of our in-memory buffer. |
protected long |
ms
The offset of the start of our in-memory buffer. |
Constructor Summary | |
---|---|
StreamPostingsInput(java.io.RandomAccessFile postFile,
int buffSize)
Creates a stream postings input. |
|
StreamPostingsInput(java.io.RandomAccessFile postFile,
long offset,
int buffSize)
Creates a stream postings input. |
Method Summary | |
---|---|
protected int |
read(long off)
Reads some bytes from the stream. |
ReadableBuffer |
read(long offset,
int size)
Returns a buffer constructed from our internal buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long ms
protected long me
protected byte[] b
protected static java.lang.String logTag
Constructor Detail |
---|
public StreamPostingsInput(java.io.RandomAccessFile postFile, int buffSize) throws java.io.IOException
postFile
- The file from which the postings should be read.buffSize
- The size of the buffer to use.
java.io.IOException
- If there is any error reading the postings.public StreamPostingsInput(java.io.RandomAccessFile postFile, long offset, int buffSize) throws java.io.IOException
postFile
- The file from which the postings should be read.offset
- The offset at which the postings start.buffSize
- The size of the buffer to use.
java.io.IOException
- If there is any error reading the postings.Method Detail |
---|
protected int read(long off) throws java.io.IOException
off
- The offset in the file from which the bytes should be
read.
java.io.IOException
- If there is any error reading from the stream.public ReadableBuffer read(long offset, int size) throws java.io.IOException
read
in interface PostingsInput
offset
- The offset in the input at which the postings can be
found.size
- The number of bytes to read to get the postings.
java.io.IOException
- if there is any error reading the
postings.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |