Class PoisonedUpdateGraph

java.lang.Object
io.deephaven.engine.context.PoisonedUpdateGraph
All Implemented Interfaces:
LogOutputAppendable, NotificationQueue, NotificationQueue.Dependency, UpdateGraph, UpdateSourceRegistrar

public class PoisonedUpdateGraph extends Object implements UpdateGraph
  • Field Details

  • Method Details

    • append

      public LogOutput append(LogOutput logOutput)
      Specified by:
      append in interface LogOutputAppendable
    • satisfied

      public boolean satisfied(long step)
      Description copied from interface: NotificationQueue.Dependency
      Is this ancestor satisfied? Note that this method must be safe to call on any thread.
      Specified by:
      satisfied in interface NotificationQueue.Dependency
      Parameters:
      step - The step for which we are testing satisfaction
      Returns:
      Whether the dependency is satisfied on step (and will not fire subsequent notifications)
    • getUpdateGraph

      public UpdateGraph getUpdateGraph()
      Specified by:
      getUpdateGraph in interface NotificationQueue.Dependency
      Returns:
      the update graph that this dependency is a part of
    • getName

      public String getName()
      Specified by:
      getName in interface UpdateGraph
      Returns:
      The name of this UpdateGraph
    • addNotification

      public void addNotification(@NotNull @NotNull NotificationQueue.Notification notification)
      Description copied from interface: NotificationQueue
      Add a notification for this NotificationQueue to deliver (by invoking its run() method). Note that implementations may have restrictions as to how and when this method may be used for non-terminal notifications, e.g. by only supporting notification queuing from threads that can guarantee they are part of an update cycle.
      Specified by:
      addNotification in interface NotificationQueue
      Parameters:
      notification - The notification to add
    • addNotifications

      public void addNotifications(@NotNull @NotNull Collection<? extends NotificationQueue.Notification> notifications)
      Description copied from interface: NotificationQueue
      Enqueue a collection of notifications to be flushed.
      Specified by:
      addNotifications in interface NotificationQueue
      Parameters:
      notifications - The notification to enqueue
      See Also:
    • maybeAddNotification

      public boolean maybeAddNotification(@NotNull @NotNull NotificationQueue.Notification notification, long deliveryStep)
      Description copied from interface: NotificationQueue
      Add a notification for this NotificationQueue to deliver (by invoking its run() method), iff the delivery step is the current step and the update cycle for that step is still in process. This is only supported for non-terminal notifications.
      Specified by:
      maybeAddNotification in interface NotificationQueue
      Parameters:
      notification - The notification to add
      deliveryStep - The step to deliver this notification on
    • sharedLock

      public AwareFunctionalLock sharedLock()
      Specified by:
      sharedLock in interface UpdateGraph
      Returns:
      The shared AwareFunctionalLock to use with this update graph
    • exclusiveLock

      public AwareFunctionalLock exclusiveLock()
      Specified by:
      exclusiveLock in interface UpdateGraph
      Returns:
      The exclusive AwareFunctionalLock to use with this update graph
    • clock

      public LogicalClock clock()
      Specified by:
      clock in interface UpdateGraph
      Returns:
      The LogicalClock to use with this update graph
    • cycleStartNanoTime

      public long cycleStartNanoTime()
      Description copied from interface: UpdateGraph
      Get the monotonic time at the start of the current or most recently completed refresh cycle. This value is suitable for measuring elapsed time relative to the cycle start, but not for deriving wall clock times. Before any cycle has started, returns QueryConstants.NULL_LONG.
      Specified by:
      cycleStartNanoTime in interface UpdateGraph
      Returns:
      The System.nanoTime() value recorded at the start of the current or most recently completed refresh cycle, or io.deephaven.util.QueryConstants#NULL_LONG if no cycle has started
    • cycleStartTime

      public Instant cycleStartTime()
      Description copied from interface: UpdateGraph
      Get the wall clock Instant at the start of the current or most recently completed refresh cycle. Before any cycle has started, returns null.
      Specified by:
      cycleStartTime in interface UpdateGraph
      Returns:
      The Instant recorded at the start of the current or most recently completed refresh cycle, or null if no cycle has started
    • parallelismFactor

      public int parallelismFactor()
      Description copied from interface: UpdateGraph
      Retrieve the number of independent update propagation tasks this UpdateGraph can process concurrently.

      For example, an implementation using a fixed-size thread pool of update task workers should return the size of the thread pool.

      This is exposed in order to allow users to determine the ideal way to partition their queries for maximum parallelism without undue overhead.

      Specified by:
      parallelismFactor in interface UpdateGraph
      Returns:
      number of independent update propagation tasks this UpdateGraph can process concurrently
    • logDependencies

      public LogEntry logDependencies()
      Specified by:
      logDependencies in interface UpdateGraph
      Returns:
      A LogEntry that may be prefixed with UpdateGraph information
    • currentThreadProcessesUpdates

      public boolean currentThreadProcessesUpdates()
      Description copied from interface: UpdateGraph
      Test if the current thread is involved in processing updates for this UpdateGraph. If so, non-terminal user notifications on the current thread must not attempt to lock this UpdateGraph.
      Specified by:
      currentThreadProcessesUpdates in interface UpdateGraph
      Returns:
      Whether the current thread is involved in processing updates for this UpdateGraph
    • serialTableOperationsSafe

      public boolean serialTableOperationsSafe()
      Description copied from interface: UpdateGraph
      Test if engine code executing on the current thread should assume safety for serial table operations. Operations annotated as concurrent are always safe.
      Specified by:
      serialTableOperationsSafe in interface UpdateGraph
      Returns:
      Whether code on this thread should assume serial table operation safety
      See Also:
    • setSerialTableOperationsSafe

      public boolean setSerialTableOperationsSafe(boolean newValue)
      Description copied from interface: UpdateGraph
      User or engine code that makes its own determination about the safety of initiating serial table operations on the current thread may use this method to override default behavior. The previous value should be restored immediately after use, typically with the following pattern:
       boolean oldValue = assumeSerialTableOperations(true);
       try {
           // ... safe table operations here
       } finally {
           assumeSerialTableOperations(oldValue);
       }
       
      Specified by:
      setSerialTableOperationsSafe in interface UpdateGraph
      Parameters:
      newValue - the new value
      Returns:
      the old value
      See Also:
    • addSource

      public void addSource(@NotNull @NotNull Runnable updateSource)
      Description copied from interface: UpdateSourceRegistrar
      Add a source to this registrar.
      Specified by:
      addSource in interface UpdateSourceRegistrar
      Parameters:
      updateSource - The table to add
    • removeSource

      public void removeSource(@NotNull @NotNull Runnable updateSource)
      Description copied from interface: UpdateSourceRegistrar
      Remove a source from this registrar.
      Specified by:
      removeSource in interface UpdateSourceRegistrar
      Parameters:
      updateSource - The table to remove
    • supportsRefreshing

      public boolean supportsRefreshing()
      Specified by:
      supportsRefreshing in interface UpdateGraph
      Returns:
      Whether this UpdateGraph has a mechanism that supports refreshing
    • requestRefresh

      public void requestRefresh()
      Description copied from interface: UpdateGraph
      Request that this UpdateGraph process any pending updates as soon as practicable. Updates "hurried" in this way are otherwise processed as normal.
      Specified by:
      requestRefresh in interface UpdateGraph
      Specified by:
      requestRefresh in interface UpdateSourceRegistrar
    • stop

      public void stop()
      Description copied from interface: UpdateGraph
      Attempt to stop this update graph, and cease processing further notifications.
      Specified by:
      stop in interface UpdateGraph