Package io.deephaven.extensions.barrage
Class BarrageStreamGeneratorImpl
java.lang.Object
io.deephaven.extensions.barrage.BarrageStreamGeneratorImpl
- All Implemented Interfaces:
BarrageStreamGenerator<BarrageStreamGeneratorImpl.View>,SafeCloseable,AutoCloseable
public class BarrageStreamGeneratorImpl
extends Object
implements BarrageStreamGenerator<BarrageStreamGeneratorImpl.View>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis factory writes data in Arrow's IPC format which has a terse header and no room for metadata.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionintfinal longfinal booleanfinal longfinal BarrageMessagefinal long -
Constructor Summary
ConstructorsConstructorDescriptionBarrageStreamGeneratorImpl(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 TypeMethodDescriptionvoidclose()getSnapshotView(BarrageSnapshotOptions options) Obtain a Full-Snapshot View of this StreamGenerator that can be sent to a single snapshot 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 snapshot 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, @Nullable RowSet viewport, boolean reverseViewport, @Nullable RowSet keyspaceViewport, @Nullable BitSet subscribedColumns) Obtain a View of this StreamGenerator that can be sent to a single subscriber.protected voidwriteHeader(ByteBuffer metadata, org.apache.commons.lang3.mutable.MutableInt size, com.google.flatbuffers.FlatBufferBuilder header, BarrageProtoUtil.ExposedByteArrayOutputStream baos) This implementation prepares the protobuf FlightData header.
-
Field Details
-
message
-
writeConsumer
-
firstSeq
public final long firstSeq -
lastSeq
public final long lastSeq -
step
public final long step -
isSnapshot
public final boolean isSnapshot -
rowsAdded
-
rowsIncluded
-
rowsRemoved
-
shifted
-
addColumnData
-
addGeneratorCount
public int addGeneratorCount -
modColumnData
-
-
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:
getMessagein interfaceBarrageStreamGenerator<BarrageStreamGeneratorImpl.View>- Returns:
- the BarrageMessage that this generator is operating on
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-
getSubView
public BarrageStreamGeneratorImpl.SubView 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:
getSubViewin interfaceBarrageStreamGenerator<BarrageStreamGeneratorImpl.View>- Parameters:
options- serialization options for this specific viewisInitialSnapshot- indicates whether or not this is the first snapshot for the listenerviewport- is the position-space viewportreverseViewport- is the viewport reversed (relative to end of table instead of beginning)keyspaceViewport- 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 BarrageStreamGeneratorImpl.SubView getSubView(BarrageSubscriptionOptions options, boolean isInitialSnapshot) Obtain a Full-Subscription View of this StreamGenerator that can be sent to a single subscriber.- Specified by:
getSubViewin interfaceBarrageStreamGenerator<BarrageStreamGeneratorImpl.View>- Parameters:
options- serialization options for this specific viewisInitialSnapshot- 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 BarrageStreamGeneratorImpl.SnapshotView 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:
getSnapshotViewin interfaceBarrageStreamGenerator<BarrageStreamGeneratorImpl.View>- 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)keyspaceViewport- is the key-space viewportsnapshotColumns- 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:
getSnapshotViewin interfaceBarrageStreamGenerator<BarrageStreamGeneratorImpl.View>- 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, org.apache.commons.lang3.mutable.MutableInt size, com.google.flatbuffers.FlatBufferBuilder header, BarrageProtoUtil.ExposedByteArrayOutputStream baos) throws IOException This implementation prepares the protobuf FlightData header.- Throws:
IOException
-