Package io.deephaven.engine.table.impl
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
ListenerRecorder
s. 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 Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable PerformanceEntry
protected final QueryTable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MergedListener
(Iterable<? extends ListenerRecorder> recorders, Iterable<NotificationQueue.Dependency> dependencies, String listenerDescription, @Nullable QueryTable result) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected boolean
canExecute
(long step) protected void
destroy()
Attempt to release (destructively when necessary) resources held by this object.protected Iterable<? extends ListenerRecorder>
protected void
handleUncaughtException
(Exception updateException) boolean
isFailed()
void
final void
notifyOnUpstreamError
(@NotNull Throwable upstreamError, TableListener.Entry errorSourceEntry) protected abstract void
process()
protected void
propagateError
(boolean uncaughtExceptionFromProcess, @NotNull Throwable error, TableListener.Entry entry) Propagate an error to downstream listeners.protected void
propagateErrorDownstream
(boolean fromProcess, @NotNull Throwable error, TableListener.Entry entry) boolean
satisfied
(long step) Is this ancestor satisfied? Note that this method must be safe to call on any thread.protected final void
scheduleDelayedErrorNotifier
(@NotNull Throwable error, TableListener.Entry entry, @NotNull Collection<BaseTable> results) protected boolean
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
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.updategraph.NotificationQueue.Dependency
getUpdateGraph
-
Field Details
-
result
-
entry
-
-
Constructor Details
-
MergedListener
protected MergedListener(Iterable<? extends ListenerRecorder> recorders, Iterable<NotificationQueue.Dependency> dependencies, String listenerDescription, @Nullable @Nullable QueryTable result)
-
-
Method Details
-
getUpdateGraph
- Specified by:
getUpdateGraph
in interfaceNotificationQueue.Dependency
- Returns:
- the update graph that this dependency is a part of
-
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 fromprocess()
, false otherwiseerror
- the error to propagateentry
- theTableListener.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 classReferenceCountedLivenessReferent
-
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
- Specified by:
append
in interfaceLogOutputAppendable
- Overrides:
append
in classReferenceCounted
-
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 interfaceNotificationQueue.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
-
accumulatePeformanceEntry
-