Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleLookupFunctionProvider
/**
 * Provider for creating {@link LookupFunction} and {@link LookupCache} for storing lookup entries.
 */
@PublicEvolving
public interfaceclass PartialCachingLookupProvider extends LookupFunctionProvider { 
    private final LookupFunction lookupFunction;
    private final LookupCache cache;

    public PartialCachingLookupProvider(LookupFunction lookupFunction, LookupCache cache) {
        this.lookupFunction = lookupFunction;
        this.cache = cache;
    }

    @Override
    public LookupFunction createLookupFunction() {
        return lookupFunction;
    }

	public LookupCache getCache() {
		return cache;
	}
}

AsyncPartialCachingLookupProvider

Code Block
languagejava
titleLookupFunctionProvider
/**
 * Provider for creating {@link AsyncLookupFunction} and {@link LookupCache} for storing lookup entries.
 */
@PublicEvolving
public interfaceclass AsyncPartialCachingLookupProvider extends AsyncLookupFunctionProvider { 
    private final AsyncLookupFunction asyncLookupFunction;
    private final LookupCache cache;

    public AsyncPartialCachingLookupProvider(AsyncLookupFunction asyncLookupFunction, LookupCache cache) {
        this.asyncLookupFunction = asyncLookupFunction;
        this.cache = cache;
    }

    @Override
    public AsyncLookupFunction createAsyncLookupFunction() {
        return asyncLookupFunction;
    }

    public LookupCache getCache() {
        return cache;
    }
}

FullCachingLookupProvider

...

Code Block
languagejava
titleFullCachingLookupProvider
/**
 * A {@link LookupFunctionProvider} that never lookup in external system on cache miss and provides a
 * cache for holding all entries in the external system. The cache will be fully reloaded from the
 * external system and reload operations will be triggered by the {@link CacheReloadTrigger}.
 */
@PublicEvolving
public class FullCachingLookupProvider implements LookupFunctionProvider {

    private final ScanTableSource.ScanRuntimeProvider scanRuntimeProvider;
    private final CacheReloadTrigger reloadTrigger;

    public FullCachingLookupProvider(
            ScanTableSource.ScanRuntimeProvider scanRuntimeProvider,
            CacheReloadTrigger reloadTrigger) {
        this.scanRuntimeProvider = scanRuntimeProvider;
        this.reloadTrigger = reloadTrigger;
    }

    @Override
    public LookupFunction createLookupFunction() {
        return (keyRow) -> null;
    }

	public ScanTableSource.ScanRuntimeProvider getScanRuntimeProvider() {
		return scanRuntimeProvider;
    }

	public CacheReloadTrigger getCacheReloadTrigger() {
		return reloadTrigger;
	}
}  

CacheReloadTrigger

A trigger defining custom logic for triggering full cache reloading.

...