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 BarrageMessageReader.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface io.deephaven.engine.table.impl.NotificationStepReceiver
NULL_NOTIFICATION_STEP -
Constructor Summary
ConstructorsConstructorDescriptionBarrageMessageProducer(Scheduler scheduler, SessionService.ErrorTransformer errorTransformer, BarrageMessageWriter.Factory streamGeneratorFactory, BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParentReference(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.voidaddSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, BarrageSubscriptionOptions options, @Nullable BitSet columnsToSubscribe, @Nullable RowSet initialViewport, boolean reverseViewport) Add a subscription to this BarrageMessageProducer.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.booleanIs the node updating?voidremoveSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener) voidsetLastNotificationStep(long lastNotificationStep) Deliver a last notification step to this receiver.voidsetOnGetSnapshot(Runnable onGetSnapshot, boolean isPreSnap) booleansetRefreshing(boolean refreshing) Change the node's run mode.booleanupdateSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, @Nullable RowSet newViewport, @Nullable BitSet columnsToSubscribe) booleanupdateSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, @Nullable RowSet newViewport, @Nullable BitSet columnsToSubscribe, boolean newReverseViewport) Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScopeMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReferenceMethods 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, BarrageMessageWriter.Factory streamGeneratorFactory, BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot)
-
-
Method Details
-
getRowSet
-
getTableDefinition
-
setOnGetSnapshot
-
addSubscription
public void addSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.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 optionscolumnsToSubscribe- The initial columns to subscribe toinitialViewport- Initial viewport, to be owned by the subscription
-
updateSubscription
public boolean updateSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, @Nullable @Nullable RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe) -
updateSubscription
public boolean updateSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, @Nullable @Nullable RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe, boolean newReverseViewport) -
removeSubscription
public void removeSubscription(io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener) -
constructListener
-
destroy
@OverridingMethodsMustInvokeSuper protected void destroy()Description copied from class:ReferenceCountedLivenessReferentAttempt 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:
destroyin classReferenceCountedLivenessReferent
-
isRefreshing
public boolean isRefreshing()Description copied from interface:DynamicNodeIs the node updating?- Specified by:
isRefreshingin interfaceDynamicNode- Returns:
- true if the node is updating; false otherwise.
-
setRefreshing
public boolean setRefreshing(boolean refreshing) Description copied from interface:DynamicNodeChange the node's run mode.- Specified by:
setRefreshingin interfaceDynamicNode- Parameters:
refreshing- true to cause the node to update; false otherwise.- Returns:
- new refreshing state
-
addParentReference
Description copied from interface:DynamicNodeCalled 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:
addParentReferencein interfaceDynamicNode- Parameters:
parent- A parent of this node
-
setLastNotificationStep
public void setLastNotificationStep(long lastNotificationStep) Description copied from interface:NotificationStepReceiverDeliver a last notification step to this receiver.- Specified by:
setLastNotificationStepin interfaceNotificationStepReceiver- Parameters:
lastNotificationStep- The last notification step to be delivered
-