com.bigdata.service.proxy
Class ClientBuffer<E>

java.lang.Object
  extended by com.bigdata.service.proxy.ClientBuffer<E>
All Implemented Interfaces:
IBuffer<E>, Serializable
Direct Known Subclasses:
ClientRunnableBuffer

public class ClientBuffer<E>
extends Object
implements IBuffer<E>, Serializable

Serializable class wraps a RemoteBuffer delegating methods through to the IBuffer on the remote service while masquerading IOExceptions so that we can implement the IBuffer API.

Version:
$Id: ClientBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
ClientBuffer(RemoteBuffer<E> buffer)
           
 
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 IBuffer.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 IBuffer.flush().
 int size()
          The #of elements currently in the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientBuffer

public ClientBuffer(RemoteBuffer<E> buffer)
Parameters:
buffer - A proxy for the RemoteBuffer.
Method Detail

add

public void add(E e)
Description copied from interface: IBuffer
Add an element to the buffer.

Specified by:
add in interface IBuffer<E>
Parameters:
e - The element

flush

public long flush()
Description copied from interface: IBuffer
Flush the buffer and return the #of elements written on the backing IRelation since the counter was last IBuffer.reset() (the mutationCount).

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

Specified by:
flush in interface IBuffer<E>
Returns:
The #of elements written on the backing IRelation. See IMutableRelation

isEmpty

public boolean isEmpty()
Description copied from interface: IBuffer
True iff there are no elements in the buffer.

Specified by:
isEmpty in interface IBuffer<E>

reset

public void reset()
Description copied from interface: IBuffer
Reset the state of the buffer, including the counter whose value is reported by IBuffer.flush(). Any data in the buffer will be discarded.

Specified by:
reset in interface IBuffer<E>

size

public int size()
Description copied from interface: IBuffer
The #of elements currently in the buffer.

Specified by:
size in interface IBuffer<E>


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