Class MergedListener

All Implemented Interfaces:
LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, NotificationQueue.Dependency, Serializable
Direct Known Subclasses:
BucketedChunkedAjMergedListener, PythonMergedListenerAdapter, SnapshotIncrementalListener, ZeroKeyChunkedAjMergedListener

public abstract class MergedListener extends LivenessArtifact implements NotificationQueue.Dependency
A merged listener has a collection of ListenerRecorders. Each one must complete before the merged listener fires its sole notification for the cycle.

You must use a MergedListener if your result table has multiple sources, otherwise it is possible for a table to produce notifications more than once in a cycle; which is an error.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getUpdateGraph

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

      protected Iterable<? extends ListenerRecorder> getRecorders()
    • isFailed

      public boolean isFailed()
    • notifyOnUpstreamError

      public final void notifyOnUpstreamError(@NotNull @NotNull Throwable upstreamError, @Nullable TableListener.Entry errorSourceEntry)
    • notifyChanges

      public void notifyChanges()
    • propagateError

      protected void propagateError(boolean uncaughtExceptionFromProcess, @NotNull @NotNull Throwable error, @Nullable TableListener.Entry entry)
      Propagate an error to downstream listeners.
      Parameters:
      uncaughtExceptionFromProcess - true if the exception was thrown from process(), false otherwise
      error - the error to propagate
      entry - the TableListener.Entry that threw the error.
    • systemicResult

      protected boolean systemicResult()
    • destroy

      @OverridingMethodsMustInvokeSuper 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 class ReferenceCountedLivenessReferent
    • propagateErrorDownstream

      protected void propagateErrorDownstream(boolean fromProcess, @NotNull @NotNull Throwable error, @Nullable TableListener.Entry entry)
    • scheduleDelayedErrorNotifier

      protected final void scheduleDelayedErrorNotifier(@NotNull @NotNull Throwable error, @Nullable TableListener.Entry entry, @NotNull @NotNull Collection<BaseTable> results)
    • process

      protected abstract void process()
    • append

      public LogOutput append(@NotNull @NotNull LogOutput logOutput)
      Specified by:
      append in interface LogOutputAppendable
      Overrides:
      append in class ReferenceCounted
    • canExecute

      protected boolean canExecute(long step)
    • 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)
    • handleUncaughtException

      protected void handleUncaughtException(Exception updateException)
    • accumulatePeformanceEntry

      protected void accumulatePeformanceEntry(BasePerformanceEntry subEntry)