Class TableLocationSubscriptionBuffer
java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.table.impl.locations.impl.TableLocationSubscriptionBuffer
- All Implemented Interfaces:
LogOutputAppendable
,LivenessManager
,LivenessNode
,LivenessReferent
,BasicTableDataListener
,TableLocationProvider.Listener
public class TableLocationSubscriptionBuffer
extends ReferenceCountedLivenessNode
implements TableLocationProvider.Listener
Intermediates between push-based subscription to a TableLocationProvider and polling on update source refresh.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTableLocationSubscriptionBuffer
(@NotNull TableLocationProvider tableLocationProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleException
(@NotNull TableDataException exception) Notify the listener that an exception was encountered while initiating or maintaining the subscription.void
handleTableLocationKeyAdded
(@NotNull LiveSupplier<ImmutableTableLocationKey> addedKeySupplier) Notify the listener of aLiveSupplier<ImmutableTableLocationKey>
encountered while initiating or maintaining the location subscription.void
handleTableLocationKeyRemoved
(@NotNull LiveSupplier<ImmutableTableLocationKey> removedKeySupplier) Notify the listener of aLiveSupplier<ImmutableTableLocationKey>
that has been removed.void
handleTableLocationKeysUpdate
(@Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> addedKeySuppliers, @Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> removedKeySuppliers) Notify the listener of collections ofTableLocationKeys
added or removed while initiating or maintaining the location subscription.Subscribe if needed, and return any pending location keys (or throw a pending exception) from the table location provider.void
reset()
Unsubscribe and clear any state pending processing.Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, 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
-
Constructor Details
-
TableLocationSubscriptionBuffer
public TableLocationSubscriptionBuffer(@NotNull @NotNull TableLocationProvider tableLocationProvider)
-
-
Method Details
-
processPending
Subscribe if needed, and return any pending location keys (or throw a pending exception) from the table location provider. A given location key will only be returned by a single call to processPending() (unless state is reset). No order is maintained internally. If a pending exception is thrown, this signals that the subscription is no longer valid and no subsequent location keys will be returned.- Returns:
- A
TableLocationSubscriptionBuffer.LocationUpdate
collecting pending added and removed location keys, ornull
if there are none; the caller mustclose
the returned object when done.
-
reset
public void reset()Unsubscribe and clear any state pending processing. -
handleTableLocationKeyAdded
public void handleTableLocationKeyAdded(@NotNull @NotNull LiveSupplier<ImmutableTableLocationKey> addedKeySupplier) Description copied from interface:TableLocationProvider.Listener
Notify the listener of aLiveSupplier<ImmutableTableLocationKey>
encountered while initiating or maintaining the location subscription. This should occur at most once per location, but the order of delivery is not guaranteed. This addition is not part of any transaction, and is equivalent tohandleTableLocationKeyAdded(tableLocationKey, null);
by default.- Specified by:
handleTableLocationKeyAdded
in interfaceTableLocationProvider.Listener
- Parameters:
addedKeySupplier
- The new table location key.
-
handleTableLocationKeyRemoved
public void handleTableLocationKeyRemoved(@NotNull @NotNull LiveSupplier<ImmutableTableLocationKey> removedKeySupplier) Description copied from interface:TableLocationProvider.Listener
Notify the listener of aLiveSupplier<ImmutableTableLocationKey>
that has been removed. This removal is not part of any transaction, and is equivalent tohandleTableLocationKeyRemoved(tableLocationKey, null);
by default.- Specified by:
handleTableLocationKeyRemoved
in interfaceTableLocationProvider.Listener
- Parameters:
removedKeySupplier
- The table location key that was removed.
-
handleTableLocationKeysUpdate
public void handleTableLocationKeysUpdate(@Nullable @Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> addedKeySuppliers, @Nullable @Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> removedKeySuppliers) Description copied from interface:TableLocationProvider.Listener
Notify the listener of collections of
TableLocationKeys
added or removed while initiating or maintaining the location subscription. Addition or removal should occur at most once per location, but the order of delivery is not guaranteed.- Specified by:
handleTableLocationKeysUpdate
in interfaceTableLocationProvider.Listener
- Parameters:
addedKeySuppliers
- Collection of table location keys that were added.removedKeySuppliers
- Collection of table location keys that were removed.
-
handleException
Description copied from interface:BasicTableDataListener
Notify the listener that an exception was encountered while initiating or maintaining the subscription. Delivery of an exception implies that the subscription is no longer valid. This might happen during subscription establishment, and consequently should be checked for after subscribe completes.- Specified by:
handleException
in interfaceBasicTableDataListener
- Parameters:
exception
- The exception
-