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 Details

    • PrimitiveArrayColumnDataDecoder

      public PrimitiveArrayColumnDataDecoder​(Class decoderClass, Function<Object,​Object> objMapper)
      Create a new primitive array decoder wrapper for the given decoder type.
      Parameters:
      decoderClass - Decoder class to wrap
      objMapper - 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 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