Class BarrageStreamGeneratorImpl

java.lang.Object
io.deephaven.extensions.barrage.BarrageStreamGeneratorImpl
All Implemented Interfaces:
BarrageStreamGenerator, SafeCloseable, AutoCloseable

public class BarrageStreamGeneratorImpl extends Object implements BarrageStreamGenerator
  • Constructor Details

    • BarrageStreamGeneratorImpl

      public BarrageStreamGeneratorImpl(BarrageMessage message, BarragePerformanceLog.WriteMetricsConsumer writeConsumer)
      Create a barrage stream generator that can slice and dice the barrage message for delivery to clients.
      Parameters:
      message - the generator takes ownership of the message and its internal objects
      writeConsumer - a method that can be used to record write time
  • Method Details

    • getMessage

      public BarrageMessage getMessage()
      Specified by:
      getMessage in interface BarrageStreamGenerator
      Returns:
      the BarrageMessage that this generator is operating on
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SafeCloseable
    • getSubView

      public BarrageStreamGenerator.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewport, @Nullable @Nullable BitSet subscribedColumns)
      Obtain a View of this StreamGenerator that can be sent to a single subscriber.
      Specified by:
      getSubView in interface BarrageStreamGenerator
      Parameters:
      options - serialization options for this specific view
      isInitialSnapshot - indicates whether or not this is the first snapshot for the listener
      viewport - is the position-space viewport
      reverseViewport - is the viewport reversed (relative to end of table instead of beginning)
      keyspaceViewport - is the key-space viewport
      subscribedColumns - are the columns subscribed for this view
      Returns:
      a MessageView filtered by the subscription properties that can be sent to that subscriber
    • getSubView

      public BarrageStreamGenerator.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot)
      Obtain a Full-Subscription View of this StreamGenerator that can be sent to a single subscriber.
      Specified by:
      getSubView in interface BarrageStreamGenerator
      Parameters:
      options - serialization options for this specific view
      isInitialSnapshot - indicates whether or not this is the first snapshot for the listener
      Returns:
      a MessageView filtered by the subscription properties that can be sent to that subscriber
    • getSnapshotView

      public BarrageStreamGenerator.MessageView getSnapshotView(BarrageSnapshotOptions options, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewport, @Nullable @Nullable BitSet snapshotColumns)
      Obtain a View of this StreamGenerator that can be sent to a single snapshot requestor.
      Specified by:
      getSnapshotView in interface BarrageStreamGenerator
      Parameters:
      options - serialization options for this specific view
      viewport - is the position-space viewport
      reverseViewport - is the viewport reversed (relative to end of table instead of beginning)
      keyspaceViewport - is the key-space viewport
      snapshotColumns - are the columns subscribed for this view
      Returns:
      a MessageView filtered by the snapshot properties that can be sent to that subscriber
    • getSnapshotView

      Obtain a Full-Snapshot View of this StreamGenerator that can be sent to a single snapshot requestor.
      Specified by:
      getSnapshotView in interface BarrageStreamGenerator
      Parameters:
      options - serialization options for this specific view
      Returns:
      a MessageView filtered by the snapshot properties that can be sent to that subscriber
    • writeHeader

      protected void writeHeader(ByteBuffer metadata, MutableInt size, com.google.flatbuffers.FlatBufferBuilder header, ExposedByteArrayOutputStream baos) throws IOException
      This implementation prepares the protobuf FlightData header.
      Throws:
      IOException