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.
  • 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

      public void handleTableLocationKey(@NotNull @NotNull ImmutableTableLocationKey tableLocationKey)
      Description copied from interface: TableLocationProvider.Listener
      Notify the listener of a TableLocationKey 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 interface TableLocationProvider.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 a TableLocationKey that has been removed.
      Specified by:
      handleTableLocationKeyRemoved in interface TableLocationProvider.Listener
      Parameters:
      tableLocationKey - The table location key that was removed
    • handleException

      public void handleException(@NotNull @NotNull TableDataException exception)
      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 interface BasicTableDataListener
      Parameters:
      exception - The exception