Class TableLocationSubscriptionBuffer
java.lang.Object
io.deephaven.engine.table.impl.locations.impl.TableLocationSubscriptionBuffer
- All Implemented Interfaces:
BasicTableDataListener
,TableLocationProvider.Listener
public class TableLocationSubscriptionBuffer
extends Object
implements TableLocationProvider.Listener
Intermediates between push-based subscription to a TableLocationProvider and polling on update source refresh.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
-
Constructor Summary
ConstructorDescriptionTableLocationSubscriptionBuffer
(@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
handleTableLocationKey
(@NotNull ImmutableTableLocationKey tableLocationKey) Notify the listener of aTableLocationKey
encountered while initiating or maintaining the location subscription.void
handleTableLocationKeyRemoved
(@NotNull ImmutableTableLocationKey tableLocationKey) Notify the listener of aTableLocationKey
that has been removed.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.
-
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:
- The collection of pending location keys
-
reset
public void reset()Unsubscribe and clear any state pending processing. -
handleTableLocationKey
Description copied from interface:TableLocationProvider.Listener
Notify the listener of aTableLocationKey
encountered while initiating or maintaining the location subscription. This should occur at most once per location, but the order of delivery is not guaranteed.- Specified by:
handleTableLocationKey
in interfaceTableLocationProvider.Listener
- Parameters:
tableLocationKey
- The new table location key
-
handleTableLocationKeyRemoved
public void handleTableLocationKeyRemoved(@NotNull @NotNull ImmutableTableLocationKey tableLocationKey) Description copied from interface:TableLocationProvider.Listener
Notify the listener of aTableLocationKey
that has been removed.- Specified by:
handleTableLocationKeyRemoved
in interfaceTableLocationProvider.Listener
- Parameters:
tableLocationKey
- The table location key that was 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
-