Class ReadOnlyLocalTableLocationProvider

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, TableKey, TableLocationProvider, NamedImplementation

public class ReadOnlyLocalTableLocationProvider extends AbstractTableLocationProvider
Location provider for read-only table locations.
  • Constructor Details

    • ReadOnlyLocalTableLocationProvider

      public ReadOnlyLocalTableLocationProvider(@NotNull TableKey tableKey, @NotNull com.illumon.iris.db.v2.locations.local.LocalTableLocationProvider.Scanner scanner, boolean supportsSubscriptions, @NotNull TableDataRefreshService refreshService)
  • Method Details

    • getImplementationName

      public String getImplementationName()
      Description copied from interface: NamedImplementation

      Get a name for the implementing class. Useful for abstract classes that implement LogOutputAppendable or override toString.

      The default implementation is correct, but not suitable for high-frequency usage.

      Returns:
      A name for the implementing class
    • getName

      public String getName()
      Description copied from interface: TableLocationProvider
      allow TableLocationProvider instances to have names.
    • refresh

      public void refresh()
      Description copied from interface: TableLocationProvider
      Initialize or refresh state information about the list of existing locations.
    • refreshAndRescan

      public void refreshAndRescan(@NotNull Consumer<TableLocationKey> locationKeyObserver)
      Description copied from interface: TableLocationProvider
      Initialize or refresh state information about the list of existing locations. If applicable, perform extra work to ensure any cached information is up to date.
      Parameters:
      locationKeyObserver - call this TableLocationKey consumer with each location encountered (instead of the default)
    • activateUnderlyingDataSource

      protected void activateUnderlyingDataSource()
      Description copied from class: SubscriptionAggregator

      Refresh and activate update pushing from the implementing class.

      If the implementation will deliver notifications in a different thread than the one that calls this method, then this method must be asynchronous - that is, it must not block pending delivery of results. This requirement holds even if that other thread has nothing to do with the initial activation request!

      Listeners should guard against duplicate notifications, especially if the implementation delivers synchronous notifications.

      The implementation should call activationSuccessful() when done activating and delivering initial refresh results, unless activationFailed() was called instead.

      Must be called under the subscription lock.

      Overrides:
      activateUnderlyingDataSource in class SubscriptionAggregator<TableLocationProvider.Listener>
    • deactivateUnderlyingDataSource

      protected void deactivateUnderlyingDataSource()
      Description copied from class: SubscriptionAggregator
      Deactivate pushed updates from the implementing class. Must be called under the subscription lock.
      Overrides:
      deactivateUnderlyingDataSource in class SubscriptionAggregator<TableLocationProvider.Listener>
    • matchSubscriptionToken

      protected <T> boolean matchSubscriptionToken(T token)
      Description copied from class: SubscriptionAggregator
      Verify that a notification pertains to a currently-active subscription. Must be called under the subscription lock.
      Overrides:
      matchSubscriptionToken in class SubscriptionAggregator<TableLocationProvider.Listener>
      Parameters:
      token - A subscription-related object that the subclass can use to match a notification
      Returns:
      True iff notification delivery should proceed
    • makeTableLocation

      @NotNull protected final TableLocation makeTableLocation(@NotNull TableLocationKey locationKey)
      Description copied from class: AbstractTableLocationProvider
      Make a new implementation-appropriate TableLocation from the supplied key.
      Specified by:
      makeTableLocation in class AbstractTableLocationProvider
      Parameters:
      locationKey - The table location key
      Returns:
      The new TableLocation