Package com.streambase.sb.client
Class StreamBaseClient.TupleBuffer
java.lang.Object
com.streambase.sb.client.StreamBaseClient.TupleBuffer
- Direct Known Subclasses:
StreamBaseClient.SerializedTupleBuffer
- Enclosing class:
- StreamBaseClient
Class for abstracting away where tuples come from, Buffers, Collections, and Single Enqueues.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intNumber of tuples in buffer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddToBuffer(Tuple tuple, int id) Add to buffer(package private) booleanAdd a tuple(package private) booleanaddTuples(Collection<Tuple> tuples) Add tuplesbooleancanDequeue(StreamProperties props) Can dequeue?booleancanEnqueue(StreamProperties props) Can enqueue?protected voidcheckTuple(Tuple tuple) Check tuple to make sure it is up to snuff(package private) abstract voidenqueue(boolean hasMore) actually enqueue the bufferbooleaninthashCode()(package private) abstract longnumBytes()Number of bytes in bufferprops()get stream properties for this Buffer(package private) voidrecycle()Clear the TupleBufferintGet tuple count
-
Field Details
-
bufferTupleCount
int bufferTupleCountNumber of tuples in buffer
-
-
Constructor Details
-
TupleBuffer
TupleBuffer(StreamProperties props) Constructor- Parameters:
props- Properties
-
-
Method Details
-
addTuple
Add a tuple- Parameters:
tuple- Tuple to add- Returns:
- true if more tuples can be added
- Throws:
StreamBaseException- Error adding tuple
-
addTuples
Add tuples- Parameters:
tuples- Tuples to add- Returns:
- true if more tuples can be added
- Throws:
StreamBaseException- Error adding tuples
-
addToBuffer
Add to buffer- Parameters:
tuple- Tuple to addid- Identifier- Throws:
TupleException- Error adding to buffer
-
numBytes
abstract long numBytes()Number of bytes in buffer- Returns:
- Number of bytes
-
recycle
void recycle()Clear the TupleBuffer -
enqueue
actually enqueue the buffer- Parameters:
hasMore- are there more Tuples in this batch of tuples- Throws:
StreamBaseException- enqueue error
-
props
get stream properties for this Buffer- Returns:
- stream properties for the buffer
-
checkTuple
Check tuple to make sure it is up to snuff- Parameters:
tuple- tuple to check
-
equals
-
hashCode
public int hashCode() -
tupleCount
public int tupleCount()Get tuple count- Returns:
- Number of tuples
-
canEnqueue
Can enqueue?- Parameters:
props- Properties- Returns:
- true if can enqueue, false otherwise
-
canDequeue
Can dequeue?- Parameters:
props- Properties- Returns:
- true if can dequeue, false otherwise
-