Class PrimitiveArrayColumnDataDecoder
java.lang.Object
io.deephaven.sbe.standalone.client.messages.PrimitiveArrayColumnDataDecoder
public class PrimitiveArrayColumnDataDecoder extends Object
Utility class to decode column data updates for primitive array columns. The SBE codegen does not
support specifying common interfaces, but because every SBE decoder for primitive array column updates shares the
same methods, we can use reflection to extract those methods and write the decoding logic in one place.
-
Constructor Summary
Constructors Constructor Description PrimitiveArrayColumnDataDecoder(Class decoderClass, Function<Object,Object> objMapper)
Create a new primitive array decoder wrapper for the given decoder type. -
Method Summary
Modifier and Type Method Description int
decode(Object decoder, org.agrona.concurrent.UnsafeBuffer directBuffer, int bufferOffset, int actingBlockLength, int actingVersion, long[] rowIndexes, Object[] dataBuffer, List<SimpleMessageHandlerListener> listenerList)
Decode a primitive array column data update message and pass along to any interested listeners.
-
Constructor Details
-
PrimitiveArrayColumnDataDecoder
Create a new primitive array decoder wrapper for the given decoder type.- Parameters:
decoderClass
- Decoder class to wrapobjMapper
- Function to map a raw decoded array element value to an alternate type for notification
-
-
Method Details
-
decode
public int decode(Object decoder, org.agrona.concurrent.UnsafeBuffer directBuffer, int bufferOffset, int actingBlockLength, int actingVersion, long[] rowIndexes, Object[] dataBuffer, List<SimpleMessageHandlerListener> listenerList)Decode a primitive array column data update message and pass along to any interested listeners.- Parameters:
decoder
- Decoder which can be used to extract the message from from the given bufferdirectBuffer
- The underlying receive bufferbufferOffset
- The offset in the given buffer at which to start decodingactingBlockLength
- Block length from SBE header (pass to decoder wrap method)actingVersion
- Version from SBE header (pass to decoder wrap method)rowIndexes
- Array in which to write affected row indexesdataBuffer
- Array in which to write the updated data (corresponding to the row indexes)listenerList
- Listeners to notify- Returns:
- Number of affected rows
-