Package io.deephaven.extensions.barrage
Class BarrageStreamGeneratorImpl
java.lang.Object
io.deephaven.extensions.barrage.BarrageStreamGeneratorImpl
- All Implemented Interfaces:
BarrageStreamGenerator
,SafeCloseable
,AutoCloseable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This factory writes data in Arrow's IPC format which has a terse header and no room for metadata.static class
static class
static class
static class
static interface
static class
static class
Nested classes/interfaces inherited from interface io.deephaven.extensions.barrage.BarrageStreamGenerator
BarrageStreamGenerator.MessageView
-
Constructor Summary
ConstructorDescriptionBarrageStreamGeneratorImpl
(BarrageMessage message, BarragePerformanceLog.WriteMetricsConsumer writeConsumer) Create a barrage stream generator that can slice and dice the barrage message for delivery to clients. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getSnapshotView
(BarrageSnapshotOptions options) Obtain a Full-Snapshot View of this StreamGenerator that can be sent to a single requestor.getSnapshotView
(BarrageSnapshotOptions options, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewport, @Nullable BitSet snapshotColumns) Obtain a View of this StreamGenerator that can be sent to a single requestor.getSubView
(BarrageSubscriptionOptions options, boolean isInitialSnapshot) Obtain a Full-Subscription View of this StreamGenerator that 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, @Nullable BitSet subscribedColumns) Obtain a View of this StreamGenerator that can be sent to a single subscriber.protected void
writeHeader
(ByteBuffer metadata, MutableInt size, com.google.flatbuffers.FlatBufferBuilder header, ExposedByteArrayOutputStream baos) This implementation prepares the protobuf FlightData header.
-
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 objectswriteConsumer
- a method that can be used to record write time
-
-
Method Details
-
getMessage
- Specified by:
getMessage
in interfaceBarrageStreamGenerator
- Returns:
- the BarrageMessage that this generator is operating on
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
getSubView
public BarrageStreamGenerator.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot, boolean isFullSubscription, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewportPrev, @Nullable @Nullable RowSet keyspaceViewport, @Nullable @Nullable BitSet subscribedColumns) Description copied from interface:BarrageStreamGenerator
Obtain a View of this StreamGenerator that 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.
- Specified by:
getSubView
in interfaceBarrageStreamGenerator
- 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
public BarrageStreamGenerator.MessageView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot) Description copied from interface:BarrageStreamGenerator
Obtain a Full-Subscription View of this StreamGenerator that can be sent to a single subscriber.- Specified by:
getSubView
in interfaceBarrageStreamGenerator
- 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
-
getSnapshotView
public BarrageStreamGenerator.MessageView getSnapshotView(BarrageSnapshotOptions options, @Nullable @Nullable RowSet viewport, boolean reverseViewport, @Nullable @Nullable RowSet keyspaceViewport, @Nullable @Nullable BitSet snapshotColumns) Description copied from interface:BarrageStreamGenerator
Obtain a View of this StreamGenerator that 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.
- Specified by:
getSnapshotView
in interfaceBarrageStreamGenerator
- 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
Description copied from interface:BarrageStreamGenerator
Obtain a Full-Snapshot View of this StreamGenerator that can be sent to a single requestor.- Specified by:
getSnapshotView
in interfaceBarrageStreamGenerator
- Parameters:
options
- serialization options for this specific view- Returns:
- a MessageView filtered by the snapshot properties that can be sent to that requestor
-
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
-