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 TypeMethodDescriptionvoidhandleException(@NotNull TableDataException exception) Notify the listener that an exception was encountered while initiating or maintaining the subscription.voidhandleTableLocationKeyAdded(@NotNull LiveSupplier<ImmutableTableLocationKey> addedKeySupplier) Notify the listener of aLiveSupplier<ImmutableTableLocationKey>encountered while initiating or maintaining the location subscription.voidhandleTableLocationKeyRemoved(@NotNull LiveSupplier<ImmutableTableLocationKey> removedKeySupplier) Notify the listener of aLiveSupplier<ImmutableTableLocationKey>that has been removed.voidhandleTableLocationKeysUpdate(@Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> addedKeySuppliers, @Nullable Collection<LiveSupplier<ImmutableTableLocationKey>> removedKeySuppliers) Notify the listener of collections ofTableLocationKeysadded 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.voidreset()Unsubscribe and clear any state pending processing.Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
ensureCleanupOnGC, findAnyManagedReferent, forEachManagedReference, getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods 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.LocationUpdatecollecting pending added and removed location keys, ornullif there are none; the caller mustclosethe 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.ListenerNotify 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:
handleTableLocationKeyAddedin interfaceTableLocationProvider.Listener- Parameters:
addedKeySupplier- The new table location key.
-
handleTableLocationKeyRemoved
public void handleTableLocationKeyRemoved(@NotNull @NotNull LiveSupplier<ImmutableTableLocationKey> removedKeySupplier) Description copied from interface:TableLocationProvider.ListenerNotify 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:
handleTableLocationKeyRemovedin 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.ListenerNotify the listener of collections of
TableLocationKeysadded 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:
handleTableLocationKeysUpdatein 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:BasicTableDataListenerNotify 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:
handleExceptionin interfaceBasicTableDataListener- Parameters:
exception- The exception
-