Class IcebergAutoRefreshTableLocationProvider<TK extends TableKey,TLK extends TableLocationKey>
- All Implemented Interfaces:
TableLocationProvider,NamedImplementation
Automatically refreshing TableLocationProvider implementation that delegates location
key discovery to a TableLocationKeyFinder and location creation to a
TableLocationFactory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.locations.TableLocationProvider
TableLocationProvider.Listener -
Field Summary
Fields inherited from class io.deephaven.engine.table.impl.locations.impl.SubscriptionAggregator
subscriptions -
Constructor Summary
ConstructorsConstructorDescriptionIcebergAutoRefreshTableLocationProvider(TK tableKey, @NotNull IcebergBaseLayout locationKeyFinder, @NotNull TableLocationFactory<TK, TLK> locationFactory, @NotNull TableDataRefreshService refreshService, long refreshIntervalMs, @NotNull IcebergTableAdapter adapter, @NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidRefresh and activate update pushing from the implementing class.protected final voidDeactivate pushed updates from the implementing class.protected voidInitialization method for subclasses to override, in case simply callingTableLocationProvider.refresh()is inappropriate.Get a name for the implementing class.protected <T> booleanmatchSubscriptionToken(T token) Verify that a notification pertains to a currently-active subscription.voidrefresh()Initialize or refresh state information about the list of existing locations.voidupdate()Update a manually refreshing table location provider with the latest snapshot from the catalog.voidupdate(long snapshotId) Update a manually refreshing table location provider with a specific snapshot from the catalog.voidupdate(org.apache.iceberg.Snapshot snapshot) Update a manually refreshing table location provider with a specific snapshot from the catalog.Methods inherited from class io.deephaven.iceberg.layout.IcebergTableLocationProviderBase
makeTableLocation, refreshLocationsMethods inherited from class io.deephaven.engine.table.impl.locations.impl.AbstractTableLocationProvider
beginTransaction, deliverInitialSnapshot, endTransaction, ensureInitialized, getKey, getLocationUpdateMode, getTableLocationIfPresent, getTableLocationKeys, getUpdateMode, handleTableLocationKeyAdded, handleTableLocationKeyAdded, handleTableLocationKeyRemoved, hasTableLocationKey, isInitialized, removeTableLocationKey, setInitialized, toString, visitLocationKeyMethods inherited from class io.deephaven.engine.table.impl.locations.impl.SubscriptionAggregator
activationFailed, activationSuccessful, checkHasSubscribers, postActivationHook, subscribe, supportsSubscriptions, unsubscribeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.locations.TableLocationProvider
getName, getTableLocation, getTableLocationKeys, getTableLocationKeys, subscribe, supportsSubscriptions, unsubscribe
-
Constructor Details
-
IcebergAutoRefreshTableLocationProvider
public IcebergAutoRefreshTableLocationProvider(@NotNull TK tableKey, @NotNull @NotNull IcebergBaseLayout locationKeyFinder, @NotNull @NotNull TableLocationFactory<TK, TLK> locationFactory, @NotNull @NotNull TableDataRefreshService refreshService, long refreshIntervalMs, @NotNull @NotNull IcebergTableAdapter adapter, @NotNull @NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
-
-
Method Details
-
getImplementationName
Description copied from interface:NamedImplementationGet a name for the implementing class. Useful for abstract classes that implement
LogOutputAppendableor overridetoString.The default implementation is correct, but not suitable for high-frequency usage.
- Returns:
- A name for the implementing class
-
doInitialization
protected void doInitialization()Description copied from class:AbstractTableLocationProviderInitialization method for subclasses to override, in case simply callingTableLocationProvider.refresh()is inappropriate. This is *not* guaranteed to be called only once. It should internally callAbstractTableLocationProvider.setInitialized()upon successful initialization.- Overrides:
doInitializationin classAbstractTableLocationProvider
-
refresh
public void refresh()Description copied from interface:TableLocationProviderInitialize or refresh state information about the list of existing locations. -
update
public void update()Description copied from class:IcebergTableLocationProviderBaseUpdate a manually refreshing table location provider with the latest snapshot from the catalog. This will throw anUnsupportedOperationExceptionif the table is not manually refreshing.- Specified by:
updatein classIcebergTableLocationProviderBase<TK extends TableKey,TLK extends TableLocationKey>
-
update
public void update(long snapshotId) Description copied from class:IcebergTableLocationProviderBaseUpdate a manually refreshing table location provider with a specific snapshot from the catalog. If thesnapshotIdis not found in the list of snapshots for the table, anIllegalArgumentExceptionis thrown. The input snapshot must also be newer (higher in sequence number) than the current snapshot or anIllegalArgumentExceptionis thrown. This will throw anUnsupportedOperationExceptionif the table is not manually refreshing.- Specified by:
updatein classIcebergTableLocationProviderBase<TK extends TableKey,TLK extends TableLocationKey> - Parameters:
snapshotId- The identifier of the snapshot to use when updating the table.
-
update
public void update(org.apache.iceberg.Snapshot snapshot) Description copied from class:IcebergTableLocationProviderBaseUpdate a manually refreshing table location provider with a specific snapshot from the catalog. The input snapshot must be newer (higher in sequence number) than the current snapshot or anIllegalArgumentExceptionis thrown. This will throw anUnsupportedOperationExceptionif the table is not manually refreshing.- Specified by:
updatein classIcebergTableLocationProviderBase<TK extends TableKey,TLK extends TableLocationKey> - Parameters:
snapshot- The snapshot to use when updating the table.
-
activateUnderlyingDataSource
protected final void activateUnderlyingDataSource()Description copied from class:SubscriptionAggregatorRefresh 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 run results, unless activationFailed() was called instead.
Must be called under the subscription lock.
- Overrides:
activateUnderlyingDataSourcein classSubscriptionAggregator<TableLocationProvider.Listener>
-
deactivateUnderlyingDataSource
protected final void deactivateUnderlyingDataSource()Description copied from class:SubscriptionAggregatorDeactivate pushed updates from the implementing class. Must be called under the subscription lock.- Overrides:
deactivateUnderlyingDataSourcein classSubscriptionAggregator<TableLocationProvider.Listener>
-
matchSubscriptionToken
protected <T> boolean matchSubscriptionToken(T token) Description copied from class:SubscriptionAggregatorVerify that a notification pertains to a currently-active subscription. Must be called under the subscription lock.- Overrides:
matchSubscriptionTokenin classSubscriptionAggregator<TableLocationProvider.Listener>- Parameters:
token- A subscription-related object that the subclass can use to match a notification- Returns:
- True iff notification delivery should proceed
-