com.bigdata.relation.accesspath
Interface IRunnableBuffer<E>

All Superinterfaces:
IBuffer<E>
All Known Subinterfaces:
IBlockingBuffer<E>
All Known Implementing Classes:
BlockingBuffer, ClientRunnableBuffer

public interface IRunnableBuffer<E>
extends IBuffer<E>

An IBuffer that may be closed. Instances of this interface are normally drained by a worker thread.

Version:
$Id: IRunnableBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 void abort(Throwable cause)
          Signal abnormal termination of the process writing on the buffer.
 void add(E e)
          Add an element to the buffer.
 void close()
          Signal that no more data will be written on this buffer (this is required in order for the #iterator() to know when no more data will be made available).
 Future getFuture()
          The Future for the worker task.
 boolean isOpen()
          Return true if the buffer is open.
 
Methods inherited from interface com.bigdata.relation.accesspath.IBuffer
flush, isEmpty, reset, size
 

Method Detail

add

void add(E e)
Add an element to the buffer.

Note: This method is constrained to throw the specified exception if the buffer has been close()d.

Specified by:
add in interface IBuffer<E>
Parameters:
e - The element
Throws:
BufferClosedException - if the buffer has been close()d.

isOpen

boolean isOpen()
Return true if the buffer is open.


close

void close()
Signal that no more data will be written on this buffer (this is required in order for the #iterator() to know when no more data will be made available).


abort

void abort(Throwable cause)
Signal abnormal termination of the process writing on the buffer. The buffer will be closed. The #iterator() will report the cause via a wrapped exception the next time any method on its interface is invoked. The internal queue may be cleared once this method is invoked.

Parameters:
cause - The exception thrown by the processing writing on the buffer.

getFuture

Future getFuture()
The Future for the worker task.

Returns:
The Future -or- null if no Future has been set.
TODO:
There should be a generic type for this.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.