Class BarrageMessageProducer

java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.liveness.LivenessArtifact
io.deephaven.server.barrage.BarrageMessageProducer
All Implemented Interfaces:
io.deephaven.base.log.LogOutputAppendable, io.deephaven.engine.liveness.LivenessManager, io.deephaven.engine.liveness.LivenessNode, io.deephaven.engine.liveness.LivenessReferent, io.deephaven.engine.table.impl.NotificationStepReceiver, io.deephaven.engine.updategraph.DynamicNode, Serializable

public class BarrageMessageProducer extends io.deephaven.engine.liveness.LivenessArtifact implements io.deephaven.engine.updategraph.DynamicNode, io.deephaven.engine.table.impl.NotificationStepReceiver
The server-side implementation of a Barrage replication source.

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
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
     

    Fields inherited from interface io.deephaven.engine.table.impl.NotificationStepReceiver

    NULL_NOTIFICATION_STEP
  • Constructor Summary

    Constructors
    Constructor
    Description
    BarrageMessageProducer(Scheduler scheduler, SessionService.ErrorTransformer errorTransformer, io.deephaven.extensions.barrage.BarrageMessageWriter.Factory streamGeneratorFactory, io.deephaven.engine.table.impl.BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    addSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, io.deephaven.extensions.barrage.BarrageSubscriptionOptions options, @Nullable BitSet columnsToSubscribe, @Nullable io.deephaven.engine.rowset.RowSet initialViewport, boolean reverseViewport)
    Add a subscription to this BarrageMessageProducer.
    io.deephaven.engine.table.impl.InstrumentedTableUpdateListener
     
    protected void
     
    io.deephaven.engine.rowset.RowSet
     
    io.deephaven.engine.table.TableDefinition
     
    boolean
     
    void
    removeSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener)
     
    void
    setLastNotificationStep(long lastNotificationStep)
     
    void
    setOnGetSnapshot(Runnable onGetSnapshot, boolean isPreSnap)
     
    boolean
    setRefreshing(boolean refreshing)
     
    boolean
    updateSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, @Nullable io.deephaven.engine.rowset.RowSet newViewport, @Nullable BitSet columnsToSubscribe)
     
    boolean
    updateSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, @Nullable io.deephaven.engine.rowset.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, 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, io.deephaven.extensions.barrage.BarrageMessageWriter.Factory streamGeneratorFactory, io.deephaven.engine.table.impl.BaseTable<?> parent, long updateIntervalMs, Runnable onGetSnapshot)
  • Method Details

    • getRowSet

      public io.deephaven.engine.rowset.RowSet getRowSet()
    • getTableDefinition

      public io.deephaven.engine.table.TableDefinition getTableDefinition()
    • setOnGetSnapshot

      public void setOnGetSnapshot(Runnable onGetSnapshot, boolean isPreSnap)
    • addSubscription

      public void addSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, io.deephaven.extensions.barrage.BarrageSubscriptionOptions options, @Nullable @Nullable BitSet columnsToSubscribe, @Nullable @Nullable io.deephaven.engine.rowset.RowSet initialViewport, boolean reverseViewport)
      Add a subscription to this BarrageMessageProducer.
      Parameters:
      listener - The listener for this subscription
      options - The subscription options
      columnsToSubscribe - The initial columns to subscribe to
      initialViewport - Initial viewport, to be owned by the subscription
    • updateSubscription

      public boolean updateSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, @Nullable @Nullable io.deephaven.engine.rowset.RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe)
    • updateSubscription

      public boolean updateSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener, @Nullable @Nullable io.deephaven.engine.rowset.RowSet newViewport, @Nullable @Nullable BitSet columnsToSubscribe, boolean newReverseViewport)
    • removeSubscription

      public void removeSubscription(io.grpc.stub.StreamObserver<io.deephaven.extensions.barrage.BarrageMessageWriter.MessageView> listener)
    • constructListener

      public io.deephaven.engine.table.impl.InstrumentedTableUpdateListener constructListener()
    • destroy

      @OverridingMethodsMustInvokeSuper protected void destroy()
      Overrides:
      destroy in class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
    • isRefreshing

      public boolean isRefreshing()
      Specified by:
      isRefreshing in interface io.deephaven.engine.updategraph.DynamicNode
    • setRefreshing

      public boolean setRefreshing(boolean refreshing)
      Specified by:
      setRefreshing in interface io.deephaven.engine.updategraph.DynamicNode
    • addParentReference

      public void addParentReference(Object parent)
      Specified by:
      addParentReference in interface io.deephaven.engine.updategraph.DynamicNode
    • setLastNotificationStep

      public void setLastNotificationStep(long lastNotificationStep)
      Specified by:
      setLastNotificationStep in interface io.deephaven.engine.table.impl.NotificationStepReceiver