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 Details

    • FixedWidthColumnDataDecoder

      public FixedWidthColumnDataDecoder​(Class decoderClass, Function<Object,​Object> objMapper)
      Create a new fixed width column data decoder using the given SBE decoder class.
      Parameters:
      decoderClass - Decoder class to wrap
      objMapper - 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 buffer
      directBuffer - The underlying receive buffer
      bufferOffset - The offset in the given buffer at which to start decoding
      actingBlockLength - 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 indexes
      dataBuffer - Array in which to write the updated data (corresponding to the row indexes)
      listenerList - Listeners to notify
      Returns:
      Number of affected rows