Interface TableLocationProvider
- All Superinterfaces:
NamedImplementation
- All Known Implementing Classes:
AbstractTableLocationProvider,IcebergAutoRefreshTableLocationProvider,IcebergManualRefreshTableLocationProvider,IcebergStaticTableLocationProvider,IcebergTableLocationProviderBase,PollingTableLocationProvider,SingleTableLocationProvider
TableLocations for a given table.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceShiftObliviousListener interface for anything that wants to know about new table location keys. -
Method Summary
Modifier and TypeMethodDescriptionEnsure that this location provider is initialized.getKey()Get theTableKeyassociated with this provider.@NotNull TableUpdateModeGet the locationupdate guaranteesof this provider describing how individual locations will add or remove rows.default StringgetName()Allow TableLocationProvider instances to have names.default @NotNull TableLocationgetTableLocation(@NotNull TableLocationKey tableLocationKey) Get theTableLocationassociated with the given key.@Nullable TableLocationgetTableLocationIfPresent(@NotNull TableLocationKey tableLocationKey) Get theTableLocationassociated with the given key if it exists.default Collection<ImmutableTableLocationKey>Get this provider's currently known location keys.default voidGet this provider's currently known location keys.voidgetTableLocationKeys(Consumer<LiveSupplier<ImmutableTableLocationKey>> consumer, Predicate<ImmutableTableLocationKey> filter) Get this provider's currently known location keys.@NotNull TableUpdateModeGet theupdate guaranteesof this provider describing how this provider will add or remove table locations.booleanhasTableLocationKey(@NotNull TableLocationKey tableLocationKey) Check if this provider knows the supplied location key.voidrefresh()Initialize or refresh state information about the list of existing locations.voidsubscribe(@NotNull TableLocationProvider.Listener listener) Subscribe to pushed location additions.booleanDoes this provider support subscriptions? That is, can this provider ever have ticking data?voidunsubscribe(@NotNull TableLocationProvider.Listener listener) Unsubscribe from pushed location additions.Methods inherited from interface io.deephaven.util.type.NamedImplementation
getImplementationName
-
Method Details
-
getKey
ImmutableTableKey getKey()Get theTableKeyassociated with this provider.- Returns:
- The associated
TableKey
-
getUpdateMode
Get theupdate guaranteesof this provider describing how this provider will add or remove table locations. -
getLocationUpdateMode
Get the locationupdate guaranteesof this provider describing how individual locations will add or remove rows. -
supportsSubscriptions
boolean supportsSubscriptions()Does this provider support subscriptions? That is, can this provider ever have ticking data?- Returns:
- True if this provider supports subscriptions.
-
subscribe
Subscribe to pushed location additions. Subscribing more than once with the same listener without an intervening unsubscribe is an error, and may result in undefined behavior.
This is a possibly asynchronous operation - listener will receive 0 or more handleTableLocationKey callbacks, followed by 0 or 1 handleException callbacks during invocation and continuing after completion, on a thread determined by the implementation. As noted in
BasicTableDataListener.handleException(TableDataException), an exception callback signifies that the subscription is no longer valid, and no unsubscribe is required in that case. Callers must not hold any lock that prevents notification delivery while subscribing. Callers must guard against duplicate notifications.This method only guarantees eventually consistent state. To force a state update, use refresh() after subscription completes.
- Parameters:
listener- A listener.
-
unsubscribe
Unsubscribe from pushed location additions.- Parameters:
listener- The listener to forget about.
-
refresh
void refresh()Initialize or refresh state information about the list of existing locations. -
ensureInitialized
TableLocationProvider ensureInitialized()Ensure that this location provider is initialized. Mainly useful in cases where it cannot be otherwise guaranteed thatrefresh()orsubscribe(Listener)has been called prior to calls to the various table location fetch methods.- Returns:
- this, to allow method chaining.
-
getTableLocationKeys
Get this provider's currently known location keys. The locations specified by the keys returned may have null size - that is, they may not "exist" for application purposes.getTableLocation(TableLocationKey)is guaranteed to succeed for all results as long as the associatedLiveSupplieris retained by the caller. -
getTableLocationKeys
Get this provider's currently known location keys. The locations specified by the keys returned may have null size - that is, they may not "exist" for application purposes.getTableLocation(TableLocationKey)is guaranteed to succeed for all results as long as the associatedLiveSupplieris retained by the caller.- Parameters:
consumer- A consumer to receive the location keys
-
getTableLocationKeys
void getTableLocationKeys(Consumer<LiveSupplier<ImmutableTableLocationKey>> consumer, Predicate<ImmutableTableLocationKey> filter) Get this provider's currently known location keys. The locations specified by the keys returned may have null size - that is, they may not "exist" for application purposes.getTableLocation(TableLocationKey)is guaranteed to succeed for all results as long as the associatedLiveSupplieris retained by the caller.- Parameters:
consumer- A consumer to receive the location keysfilter- A filter to apply to the location keys before the consumer is called
-
hasTableLocationKey
Check if this provider knows the supplied location key.- Parameters:
tableLocationKey- The key to test.- Returns:
- Whether the key is known to this provider.
-
getTableLocation
@NotNull default @NotNull TableLocation getTableLocation(@NotNull @NotNull TableLocationKey tableLocationKey) Get theTableLocationassociated with the given key. Callers should ensure that they retain theLiveSupplierreturned bygetTableLocationKeys(Consumer, Predicate)for the key they are interested in, as the location may be removed if the supplier is no longer live.- Parameters:
tableLocationKey- ATableLocationKeyspecifying the location to get.- Returns:
- The
TableLocationmatching the given key
-
getTableLocationIfPresent
@Nullable @Nullable TableLocation getTableLocationIfPresent(@NotNull @NotNull TableLocationKey tableLocationKey) Get theTableLocationassociated with the given key if it exists. Callers should ensure that they retain theLiveSupplierreturned bygetTableLocationKeys(Consumer, Predicate)for the key they are interested in, as the location may be removed if the supplier is no longer live.- Parameters:
tableLocationKey- ATableLocationKeyspecifying the location to get.- Returns:
- The
TableLocationmatching the given key if present, else null.
-
getName
Allow TableLocationProvider instances to have names.
-