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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToBuffer(Tuple tuple, int id) Possibly add a tuple if there is room(package private) voidenqueue(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) longnumBytes()Number of bytes in buffer(package private) voidrecycle()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:
addToBufferin 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:
recyclein classStreamBaseClient.TupleBuffer
-
enqueue
Description copied from class:StreamBaseClient.TupleBufferactually enqueue the buffer- Specified by:
enqueuein 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.TupleBufferNumber of bytes in buffer- Specified by:
numBytesin classStreamBaseClient.TupleBuffer- Returns:
- Number of bytes
-