Class FixedWidthColumnDataDecoder
java.lang.Object
io.deephaven.sbe.standalone.client.messages.FixedWidthColumnDataDecoder
public class FixedWidthColumnDataDecoder extends Object
A utility class to decode column data updates with a fixed width (ie primitive types). The SBE codegen does not
support specifying common interfaces, but because every SBE decoder for fixed-width data 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 FixedWidthColumnDataDecoder(Class decoderClass, Function<Object,Object> objMapper)
Create a new fixed width column data decoder using the given SBE decoder class. -
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 fixed-width column data update message and pass along to any interested listeners.
-
Constructor Details
-
FixedWidthColumnDataDecoder
Create a new fixed width column data decoder using the given SBE decoder class.- Parameters:
decoderClass
- Decoder class to wrapobjMapper
- Function to map a raw decoded 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 fixed-width 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
-