com.sun.labs.minion.indexer.postings.io
Interface PostingsOutput

All Known Implementing Classes:
ChannelPostingsOutput, StreamPostingsOutput

public interface PostingsOutput

An interface to be implemented by things that write postings.


Method Summary
 void flush()
          Flushes any buffered output to the underlying storage.
 long position()
          Gets the position of the current output.
 int write(WriteableBuffer b)
          Writes out the given buffer of postings.
 long write(WriteableBuffer[] b)
          Writes a set of postings encoded onto a number of buffers.
 long write(WriteableBuffer[] b, int offset, int length)
          Writes a subsequence of a set of postings encoded onto a number of buffers to the output.
 

Method Detail

write

int write(WriteableBuffer b)
          throws java.io.IOException
Writes out the given buffer of postings.

Parameters:
b - A buffer of postings to write.
Returns:
The number of bytes written to the output.
Throws:
java.io.IOException - if there is any error writing the postings.

write

long write(WriteableBuffer[] b)
           throws java.io.IOException
Writes a set of postings encoded onto a number of buffers.

Parameters:
b - The buffers to write.
Returns:
The number of bytes written to the output.
Throws:
java.io.IOException - if there is any error writing the postings.

write

long write(WriteableBuffer[] b,
           int offset,
           int length)
           throws java.io.IOException
Writes a subsequence of a set of postings encoded onto a number of buffers to the output.

Parameters:
b - The buffers to write.
offset - The offset in b where we will begin writing bytes.
length - The length of the subsequence of b for which we will write postings.
Returns:
The number of bytes written to the output.
Throws:
java.io.IOException - if there is any error writing the postings.

position

long position()
              throws java.io.IOException
Gets the position of the current output.

Returns:
The current position of the output
Throws:
java.io.IOException - if there is any error.

flush

void flush()
           throws java.io.IOException
Flushes any buffered output to the underlying storage.

Throws:
java.io.IOException - if there is any error flushing the postings.