Class BarrageMessageProducer
- All Implemented Interfaces:
LogOutputAppendable
,LivenessManager
,LivenessNode
,LivenessReferent
,NotificationStepReceiver
,DynamicNode
,Serializable
When a client subscribes initially, a snapshot of the table is sent. The snapshot is obtained using either get() or getPrev() based on the state of the LogicalClock. On each subsequent update, the client is given the deltas between the last update propagation and the next.
When a client changes its subscription it will be sent a snapshot of only the data that the server believes it needs assuming that the client has been respecting the existing subscription. Practically, this means that the server may omit some data if the client's viewport change overlaps the currently recognized viewport.
It is possible to use this replication source to create subscriptions that propagate changes from one UGP to another inside the same JVM.
The client-side counterpart of this is the StreamReader
.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Helper to convert from SubscriptionRequest to Options and from MessageView to InputStream.static class
-
Field Summary
Fields inherited from interface io.deephaven.engine.table.impl.NotificationStepReceiver
NULL_NOTIFICATION_STEP
-
Constructor Summary
ConstructorDescriptionBarrageMessageProducer
(Scheduler scheduler, SessionService.ErrorTransformer errorTransformer, BarrageStreamGenerator.Factory streamGeneratorFactory, BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParentReference
(Object parent) Called on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent.void
addSubscription
(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, BarrageSubscriptionOptions options, @Nullable BitSet columnsToSubscribe, @Nullable RowSet initialViewport, boolean reverseViewport) Add a subscription to this BarrageMessageProducer.protected void
destroy()
Attempt to release (destructively when necessary) resources held by this object.boolean
Is the node updating?void
removeSubscription
(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener) void
setLastNotificationStep
(long lastNotificationStep) Deliver a last notification step to this receiver.void
setOnGetSnapshot
(Runnable onGetSnapshot, boolean isPreSnap) boolean
setRefreshing
(boolean refreshing) Change the node's run mode.boolean
updateSubscription
(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, @Nullable RowSet newViewport, @Nullable BitSet columnsToSubscribe) boolean
updateSubscription
(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, @Nullable RowSet newViewport, @Nullable BitSet columnsToSubscribe, boolean newReverseViewport) Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScope
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage
Methods inherited from interface io.deephaven.engine.liveness.LivenessNode
unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.engine.table.impl.NotificationStepReceiver
initializeLastNotificationStep
-
Field Details
-
SUBSCRIPTION_GROWTH_ENABLED
public static final boolean SUBSCRIPTION_GROWTH_ENABLED
-
-
Constructor Details
-
BarrageMessageProducer
public BarrageMessageProducer(Scheduler scheduler, SessionService.ErrorTransformer errorTransformer, BarrageStreamGenerator.Factory streamGeneratorFactory, BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot)
-
-
Method Details
-
getRowSet
-
getTableDefinition
-
setOnGetSnapshot
-
addSubscription
public void addSubscription(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, BarrageSubscriptionOptions options, @Nullable @Nullable BitSet columnsToSubscribe, @Nullable @Nullable RowSet initialViewport, boolean reverseViewport) Add a subscription to this BarrageMessageProducer.- Parameters:
listener
- The listener for this subscriptionoptions
- Thesubscription options
columnsToSubscribe
- The initial columns to subscribe toinitialViewport
- Initial viewport, to be owned by the subscription
-
updateSubscription
public boolean updateSubscription(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, @Nullable @Nullable RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe) -
updateSubscription
public boolean updateSubscription(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener, @Nullable @Nullable RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe, boolean newReverseViewport) -
removeSubscription
public void removeSubscription(io.grpc.stub.StreamObserver<BarrageStreamGenerator.MessageView> listener) -
constructListener
-
destroy
protected void destroy()Description copied from class:ReferenceCountedLivenessReferent
Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().This is intended to only ever be used as a side effect of decreasing the reference count to 0.
- Overrides:
destroy
in classReferenceCountedLivenessReferent
-
isRefreshing
public boolean isRefreshing()Description copied from interface:DynamicNode
Is the node updating?- Specified by:
isRefreshing
in interfaceDynamicNode
- Returns:
- true if the node is updating; false otherwise.
-
setRefreshing
public boolean setRefreshing(boolean refreshing) Description copied from interface:DynamicNode
Change the node's run mode.- Specified by:
setRefreshing
in interfaceDynamicNode
- Parameters:
refreshing
- true to cause the node to update; false otherwise.- Returns:
- new refreshing state
-
addParentReference
Description copied from interface:DynamicNode
Called on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent. In the most common case, the parent object is a child listener to a parent node. The parent node only keeps a weak reference to its child listener, but the listener maintains a strong reference to the parent node. In this scenario, the only strong reference to the listener (and thus indirectly to the parent node itself) is the reference kept by the dependent node.- Specified by:
addParentReference
in interfaceDynamicNode
- Parameters:
parent
- A parent of this node
-
setLastNotificationStep
public void setLastNotificationStep(long lastNotificationStep) Description copied from interface:NotificationStepReceiver
Deliver a last notification step to this receiver.- Specified by:
setLastNotificationStep
in interfaceNotificationStepReceiver
- Parameters:
lastNotificationStep
- The last notification step to be delivered
-