Interface BarrageMessageWriter
- All Superinterfaces:
AutoCloseable,SafeCloseable
- All Known Implementing Classes:
BarrageMessageWriterImpl
BarrageMessageWriter takes a BarrageMessage and re-uses portions of the serialized payload across
different subscribers that may subscribe to different viewports and columns.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfaceRepresents a single update, which might be sent as multiple distinct payloads as necessary based in the implementation.static interfaceOptional metrics API to track how many bytes a barrage message consumed, and how many nanoseconds it took to write it. -
Method Summary
Modifier and TypeMethodDescriptiongetDictionaryBatchView(BarrageOptions options, long dictId, ChunkWriter<Chunk<Values>> valuesWriter, WritableChunk<Values> values, boolean isDelta) Obtain aBarrageMessageWriter.MessageViewof standalone DictionaryBatches carryingvaluesfor dictionarydictId, framed like this writer's other messages.getSnapshotView(BarrageSnapshotOptions options) Obtain a Full-SnapshotBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor.getSnapshotView(BarrageSnapshotOptions options, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewport, BitSet snapshotColumns) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor.getSnapshotView(BarrageSnapshotOptions options, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewport, BitSet snapshotColumns, @Nullable DictionaryWriterRegistry dictionaryRegistry) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor, with aDictionaryWriterRegistryfor any dictionary-encoded columns in the snapshot.getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot) Obtain a Full-SubscriptionBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber.getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewportPrev, @Nullable RowSet keyspaceViewport, BitSet subscribedColumns) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber.getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewportPrev, @Nullable RowSet keyspaceViewport, BitSet subscribedColumns, @Nullable DictionaryWriterRegistry dictionaryRegistry) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber, with a persistent per-subscriptionDictionaryWriterRegistrythat survives across multiple ticking updates.Methods inherited from interface io.deephaven.util.SafeCloseable
close
-
Method Details
-
getMessage
BarrageMessage getMessage()- Returns:
- the
BarrageMessagethat this writer is operating on
-
getSubView
BarrageMessageWriter.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot) Obtain a Full-SubscriptionBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber.- Parameters:
options- serialization options for this specific viewisInitialSnapshot- indicates whether this is the first snapshot for the listener- Returns:
- a MessageView filtered by the subscription properties that can be sent to that subscriber
-
getSubView
BarrageMessageWriter.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewportPrev, @Nullable @Nullable RowSet keyspaceViewport, BitSet subscribedColumns) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber.Note that all passed in arguments are owned by the caller and may be modified external to this method.
- Parameters:
options- serialization options for this specific viewisInitialSnapshot- indicates whether this is the first snapshot for the listenerisFullSubscription- whether this is a full subscription (possibly a growing viewport)viewport- is the position-space viewportreverseViewport- is the viewport reversed (relative to end of table instead of beginning)keyspaceViewportPrev- is the key-space viewport prior to applying the updatekeyspaceViewport- is the key-space viewportsubscribedColumns- are the columns subscribed for this view- Returns:
- a MessageView filtered by the subscription properties that can be sent to that subscriber
-
getSubView
BarrageMessageWriter.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewportPrev, @Nullable @Nullable RowSet keyspaceViewport, BitSet subscribedColumns, @Nullable @Nullable DictionaryWriterRegistry dictionaryRegistry) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single subscriber, with a persistent per-subscriptionDictionaryWriterRegistrythat survives across multiple ticking updates.Note that all passed in arguments are owned by the caller and may be modified external to this method.
- Parameters:
options- serialization options for this specific viewisInitialSnapshot- indicates whether this is the first snapshot for the listenerisFullSubscription- whether this is a full subscription (possibly a growing viewport)viewport- is the position-space viewportreverseViewport- is the viewport reversed (relative to end of table instead of beginning)keyspaceViewportPrev- is the key-space viewport prior to applying the updatekeyspaceViewport- is the key-space viewportsubscribedColumns- are the columns subscribed for this viewdictionaryRegistry- the persistent dictionary registry for this subscription, ornullif unused- Returns:
- a MessageView filtered by the subscription properties that can be sent to that subscriber
-
getSnapshotView
Obtain a Full-SnapshotBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor.- Parameters:
options- serialization options for this specific view- Returns:
- a MessageView filtered by the snapshot properties that can be sent to that requestor
-
getSnapshotView
BarrageMessageWriter.MessageView getSnapshotView(BarrageSnapshotOptions options, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewport, BitSet snapshotColumns) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor.Note that all passed in arguments are owned by the caller and may be modified external to this method.
- Parameters:
options- serialization options for this specific viewviewport- is the position-space viewportreverseViewport- is the viewport reversed (relative to end of table instead of beginning)snapshotColumns- are the columns included for this view- Returns:
- a MessageView filtered by the snapshot properties that can be sent to that requestor
-
getSnapshotView
BarrageMessageWriter.MessageView getSnapshotView(BarrageSnapshotOptions options, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewport, BitSet snapshotColumns, @Nullable @Nullable DictionaryWriterRegistry dictionaryRegistry) Obtain aBarrageMessageWriter.MessageViewof thisBarrageMessageWriterthat can be sent to a single requestor, with aDictionaryWriterRegistryfor any dictionary-encoded columns in the snapshot.Note that all passed in arguments are owned by the caller and may be modified external to this method.
- Parameters:
options- serialization options for this specific viewviewport- is the position-space viewportreverseViewport- is the viewport reversed (relative to end of table instead of beginning)snapshotColumns- are the columns included for this viewdictionaryRegistry- the dictionary registry for this snapshot, ornullif unused- Returns:
- a MessageView filtered by the snapshot properties that can be sent to that requestor
-
getDictionaryBatchView
BarrageMessageWriter.MessageView getDictionaryBatchView(BarrageOptions options, long dictId, ChunkWriter<Chunk<Values>> valuesWriter, WritableChunk<Values> values, boolean isDelta) Obtain aBarrageMessageWriter.MessageViewof standalone DictionaryBatches carryingvaluesfor dictionarydictId, framed like this writer's other messages. A producer that writes one message for several subscribers sends these first, to bring each subscriber's dictionary level with the others'.The values make one DictionaryBatch, or several when one would reach the maximum message size
optionsallow or carry more values than their batch size, as a message's rows are split into record batches. Only the first replaces the dictionary whenisDeltaisfalse; the rest append to it.Takes ownership of
values. The returned view must be visited exactly once.- Parameters:
options- serialization options for the values, including the maximum message sizedictId- the dictionary idvaluesWriter- the writer for the dictionary's valuesvalues- the values to sendisDelta- whether the values append to the dictionary the subscriber holds, rather than replace it- Returns:
- a MessageView of the DictionaryBatches, one stream each
-