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

All Known Subinterfaces:
IBlockingBuffer<E>, IRunnableBuffer<E>, IStatementBuffer<F>
All Known Implementing Classes:
AbstractArrayBuffer, AbstractElementBuffer, AbstractElementBuffer.DeleteBuffer, AbstractElementBuffer.InsertBuffer, AbstractSolutionBuffer, AbstractSolutionBuffer.DeleteSolutionBuffer, AbstractSolutionBuffer.InsertSolutionBuffer, AbstractStatementBuffer, AbstractStatementBuffer.StatementBuffer2, AbstractUnsynchronizedArrayBuffer, AsynchronousStatementBufferFactory.AsynchronousStatementBufferImpl, BlockingBuffer, BlockingBufferWithStats, ClientBuffer, ClientRunnableBuffer, DelegateBuffer, MapBindingSetsOverShardsBuffer, OutputStatsBuffer, RDFJoinNexus.InsertSPOAndJustificationBuffer, StatementBuffer, UnsynchronizedArrayBuffer, UnsynchronizedUnboundedChunkBuffer, UnsyncLocalOutputBuffer, UnsyncLocalOutputBuffer, VerifyStatementBuffer

public interface IBuffer<E>

A buffer abstraction.

An AbstractArrayBuffer is generally used to write on an IRelation while BlockingBuffer may be used to feed an iterator on which another process will read asynchronously. An UnsynchronizedArrayBuffer may be used in single-threaded contexts and offers reduced synchronization overhead.

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

Method Summary
 void add(E e)
          Add an element to the buffer.
 long flush()
          Flush the buffer and return the #of elements written on the backing IRelation since the counter was last reset() (the mutationCount).
 boolean isEmpty()
          True iff there are no elements in the buffer.
 void reset()
          Reset the state of the buffer, including the counter whose value is reported by flush().
 int size()
          The #of elements currently in the buffer.
 

Method Detail

size

int size()
The #of elements currently in the buffer.


isEmpty

boolean isEmpty()
True iff there are no elements in the buffer.


add

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

Parameters:
e - The element

flush

long flush()
Flush the buffer and return the #of elements written on the backing IRelation since the counter was last reset() (the mutationCount).

Note: If the buffer does not write on an IRelation then it SHOULD return ZERO(0).

Returns:
The #of elements written on the backing IRelation. See IMutableRelation

reset

void reset()
Reset the state of the buffer, including the counter whose value is reported by flush(). Any data in the buffer will be discarded.



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