com.sun.labs.minion.indexer.postings.io
Class FileBackedPostingsInput

java.lang.Object
  extended by com.sun.labs.minion.util.buffer.StdReadableImpl
      extended by com.sun.labs.minion.util.buffer.FileReadableBuffer
          extended by com.sun.labs.minion.indexer.postings.io.FileBackedPostingsInput
All Implemented Interfaces:
PostingsInput, Buffer, ReadableBuffer

public class FileBackedPostingsInput
extends FileReadableBuffer
implements PostingsInput

A postings input that extends a file backed buffer. The postings that are returned are this buffer. This is useful in situations where we're iterating through a large portion of the postings for a file and the postings are not multipart (e.g., IDPostings).


Field Summary
protected static java.lang.String logTag
           
 
Fields inherited from class com.sun.labs.minion.util.buffer.FileReadableBuffer
be, bs, buff, DEFAULT_BUFF_SIZE, me, ms, pos, raf
 
Constructor Summary
FileBackedPostingsInput(java.io.RandomAccessFile raf, long offset, int buffSize)
           
 
Method Summary
 ReadableBuffer read(long offset, int size)
          Reads a set of postings, returning them in a buffer suitable for decoding.
 
Methods inherited from class com.sun.labs.minion.util.buffer.FileReadableBuffer
checkBounds, duplicate, get, get, limit, limit, position, position, read, remaining, slice, toString
 
Methods inherited from class com.sun.labs.minion.util.buffer.StdReadableImpl
byteDecode, byteDecode, byteDecode, byteDecodeLong, byteDecodeLong, byteDecodeLong, countBits, decodeFloat, getString, skipByteEncoded, test, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logTag

protected static java.lang.String logTag
Constructor Detail

FileBackedPostingsInput

public FileBackedPostingsInput(java.io.RandomAccessFile raf,
                               long offset,
                               int buffSize)
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

read

public ReadableBuffer read(long offset,
                           int size)
                    throws java.io.IOException
Reads a set of postings, returning them in a buffer suitable for decoding. The buffer that is returned is backed by the file containing the postings.

Specified by:
read in interface PostingsInput
Parameters:
offset - The offset in the input at which the postings can be found.
size - The number of bytes to read to get the postings.
Returns:
A readable buffer containing the postings.
Throws:
java.io.IOException - if there is any error reading the postings.