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
Modifier and TypeFieldDescription(package private) int
Number of tuples in buffer -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addToBuffer
(Tuple tuple, int id) Add to buffer(package private) boolean
Add a tuple(package private) boolean
addTuples
(Collection<Tuple> tuples) Add tuplesboolean
canDequeue
(StreamProperties props) Can dequeue?boolean
canEnqueue
(StreamProperties props) Can enqueue?protected void
checkTuple
(Tuple tuple) Check tuple to make sure it is up to snuff(package private) abstract void
enqueue
(boolean hasMore) actually enqueue the bufferboolean
int
hashCode()
(package private) abstract long
numBytes()
Number of bytes in bufferprops()
get stream properties for this Buffer(package private) void
recycle()
Clear the TupleBufferint
Get 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
-