...
Code Block | ||||
---|---|---|---|---|
| ||||
/** * Runtime provider for periodically re-scanning all entries of the lookup table and storing the * table locally for lookup. */ @PublicEvolving public interface RescanRuntimeProvider extends LookupTableSource.LookupRuntimeProvider { /** Creates builder* ofCreates {@link RescanRuntimeProvider} with provided scan runtime provider and rescan * interval. */ static BuilderRescanRuntimeProvider newBuilder(of( ScanTableSource.ScanRuntimeProvider scanRuntimeProvider, Duration rescanInterval) { return new BuilderRescanRuntimeProvider(); { } /**@Override * Gets the {@link org.apache.flink.table.connector.source. public ScanTableSource.ScanRuntimeProvider} getScanRuntimeProvider() { * for executing the periodically re-scan. */ ScanTableSource.ScanRuntimeProvider getScanRuntimeProvider()return scanRuntimeProvider; /** Gets the interval between two re-scans. */ } Duration getRescanInterval(); /** Builder class for@Override {@link RescanRuntimeProvider}. */ class Builder { public Duration getRescanInterval() { private ScanTableSource.ScanRuntimeProvider scanRuntimeProvider; private Durationreturn rescanInterval; /** Sets scan runtime provider. */} public}; Builder withScanRuntimeProvider( } /** * Gets the {@link org.apache.flink.table.connector.source.ScanTableSource.ScanRuntimeProvider scanRuntimeProvider) {} * for executing the this.scanRuntimeProvider = scanRuntimeProvider;periodically re-scan. */ return this; } ScanTableSource.ScanRuntimeProvider getScanRuntimeProvider(); /** SetsGets rescanthe interval between two re-scans. */ public Builder withRescanInterval(Duration rescanInterval) { this.rescanInterval = rescanInterval; return this; } /** Build {@link RescanRuntimeProvider}. */ public RescanRuntimeProvider build() { // Build RescanRuntimeProvider } } } |
TableFunctionProvider / AsyncTableFunctionProvider
...
Duration getRescanInterval();
} |
TableFunctionProvider / AsyncTableFunctionProvider
We'd like to deprecate these two interfaces and let developers to switch to the new LookupFunctionProvider / AsyncLookupFunctionProvider instead.
Table Options for Default Lookup Cache
In order to unify the usage of DefaultLookupCache across all connectors, we'd like to introduce some common table options:
- lookup.cache.expire-after-access, duration type, matching DefaultLookupCacheFactory.Builder#expireAfterAccess
- lookup.cache.expire-after-write, duration type, matching DefaultLookupCacheFactory.Builder#expireAfterWrite
- lookup.cache.initial-capacity, integer type, matching DefaultLookupCacheFactory.Builder#initialCapacity
- lookup.cache.maximum-size, long type, matching DefaultLookupCacheFactory.Builder#maximumSize
Cache Metrics
It is important to mention that a cache implementation does not have to report all the defined metrics. But if a cache reports a metric of the same semantic defined below, the implementation should follow the convention.
...