Package com.streambase.sb.client
Class StreamBaseClient.SerializedTupleBuffer
java.lang.Object
com.streambase.sb.client.StreamBaseClient.TupleBuffer
com.streambase.sb.client.StreamBaseClient.SerializedTupleBuffer
- Enclosing class:
- StreamBaseClient
A TupleBuffer which contains a byte buffer of serialized tuples
including space for a network header
-
Field Summary
Fields inherited from class com.streambase.sb.client.StreamBaseClient.TupleBuffer
bufferTupleCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToBuffer
(Tuple tuple, int id) Possibly add a tuple if there is room(package private) void
enqueue
(boolean hasMore) actually enqueue the bufferReturn a ByteBuffer containing all of the tuples ready to be serialized also contains empty space at the beginning of the buffer for a network header(package private) long
numBytes()
Number of bytes in buffer(package private) void
recycle()
clear the bufferMethods inherited from class com.streambase.sb.client.StreamBaseClient.TupleBuffer
addTuple, addTuples, canDequeue, canEnqueue, checkTuple, equals, hashCode, props, tupleCount
-
Constructor Details
-
SerializedTupleBuffer
SerializedTupleBuffer(StreamProperties props) throws StreamBaseException Constructor- Parameters:
props
- Properties- Throws:
StreamBaseException
- Error creating buffer
-
-
Method Details
-
addToBuffer
Possibly add a tuple if there is room- Specified by:
addToBuffer
in classStreamBaseClient.TupleBuffer
- Parameters:
tuple
- tuple to addid
- tuple identifier- Throws:
TupleException
- Error adding to buffer
-
getBuffer
Return a ByteBuffer containing all of the tuples ready to be serialized also contains empty space at the beginning of the buffer for a network header- Returns:
- byteBuffer containing serialized headers including empty space in the beginning for a network header
-
recycle
void recycle()clear the buffer- Overrides:
recycle
in classStreamBaseClient.TupleBuffer
-
enqueue
Description copied from class:StreamBaseClient.TupleBuffer
actually enqueue the buffer- Specified by:
enqueue
in classStreamBaseClient.TupleBuffer
- Parameters:
hasMore
- are there more Tuples in this batch of tuples- Throws:
StreamBaseException
- enqueue error
-
numBytes
long numBytes()Description copied from class:StreamBaseClient.TupleBuffer
Number of bytes in buffer- Specified by:
numBytes
in classStreamBaseClient.TupleBuffer
- Returns:
- Number of bytes
-