Package io.deephaven.extensions.barrage
Class BarrageMessageWriterImpl.SubView
java.lang.Object
io.deephaven.extensions.barrage.BarrageMessageWriterImpl.SingleUseMessageView
io.deephaven.extensions.barrage.BarrageMessageWriterImpl.RecordBatchMessageView
io.deephaven.extensions.barrage.BarrageMessageWriterImpl.SubView
- All Implemented Interfaces:
BarrageMessageWriter.MessageView
- Enclosing class:
BarrageMessageWriterImpl
protected class BarrageMessageWriterImpl.SubView
extends BarrageMessageWriterImpl.RecordBatchMessageView
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewportPrev, @Nullable RowSet keyspaceViewport, @Nullable BitSet subscribedColumns, @Nullable DictionaryWriterRegistry dictionaryRegistry) -
Method Summary
Modifier and TypeMethodDescription@Nullable DictionaryWriterRegistryReturns theDictionaryWriterRegistryfor this stream, ornullif no columns use dictionary encoding.protected voidencodeBatches(Consumer<DefensiveDrainable> visitor) Encodes the message one batch at a time, handing each batch tovisitoras a stream, in order.protected ByteBufferGenerate the metadata for this subscription.final booleanisColumnIncluded(int col) Whether this view writes the data of columncol.modRowOffsets(int col) options()Methods inherited from class io.deephaven.extensions.barrage.BarrageMessageWriterImpl.SingleUseMessageView
forEachStream
-
Constructor Details
-
SubView
protected SubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewportPrev, @Nullable @Nullable RowSet keyspaceViewport, @Nullable @Nullable BitSet subscribedColumns, @Nullable @Nullable DictionaryWriterRegistry dictionaryRegistry)
-
-
Method Details
-
encodeBatches
Description copied from class:BarrageMessageWriterImpl.SingleUseMessageViewEncodes the message one batch at a time, handing each batch tovisitoras a stream, in order. Called at most once.- Specified by:
encodeBatchesin classBarrageMessageWriterImpl.SingleUseMessageView- Parameters:
visitor- the visitor, which takes ownership of each stream it is handed- Throws:
IOException
-
options
- Specified by:
optionsin classBarrageMessageWriterImpl.RecordBatchMessageView
-
addRowOffsets
- Specified by:
addRowOffsetsin classBarrageMessageWriterImpl.RecordBatchMessageView
-
modRowOffsets
- Specified by:
modRowOffsetsin classBarrageMessageWriterImpl.RecordBatchMessageView
-
isColumnIncluded
public final boolean isColumnIncluded(int col) Whether this view writes the data of columncol. A column the view leaves out still gets a field node in every batch, as the schema requires, but no rows: it is written as if the message held no data for it.A producer's message carries data for every column that any of its subscriptions needs, so a subscription's view writes only the columns in its
subscribedColumns. Final, as the constructor relies on it.- Specified by:
isColumnIncludedin classBarrageMessageWriterImpl.RecordBatchMessageView- Parameters:
col- the column's index in the message- Returns:
- whether the view writes the column's added and modified rows
-
dictionaryRegistry
Description copied from class:BarrageMessageWriterImpl.RecordBatchMessageViewReturns theDictionaryWriterRegistryfor this stream, ornullif no columns use dictionary encoding. The manager is shared across all batches of the same stream so thatDictionaryWriterStateinstances survive across batch boundaries.- Specified by:
dictionaryRegistryin classBarrageMessageWriterImpl.RecordBatchMessageView
-
getSubscriptionMetadata
Generate the metadata for this subscription. For a standard subscription, this is a flatbuffer representing aBarrageMessageWrappercontaining a payload ofBarrageUpdateMetadata.- Returns:
- a ByteBuffer representing the metadata for this subscription
- Throws:
IOException- if the metadata could not be serialized
-