Class TableLocationSubscriptionBuffer

java.lang.Object
com.illumon.iris.db.v2.locations.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 LiveTable refresh.
  • Constructor Details

  • Method Details

    • processPending

      public Collection<TableLocation> processPending()
      Subscribe if needed, and return any pending locations (or throw a pending exception) from the table location provider. A given location 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 locations will be returned.
      Returns:
      The collection of pending locations
    • reset

      public void reset()
      Unsubscribe and clear any state pending processing.
    • handleTableLocation

      public void handleTableLocation​(@NotNull TableLocation tableLocation)
      Description copied from interface: TableLocationProvider.Listener
      Notify the listener of a table location 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:
      handleTableLocation in interface TableLocationProvider.Listener
      Parameters:
      tableLocation - The table location
    • handleException

      public void handleException​(@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