public class CachingAsyncLookupFunction
extends org.apache.flink.table.functions.AsyncLookupFunction
This function will check the cache on lookup request and return entries directly on cache hit, otherwise the function will invoke the actual lookup function, and store the entry into the cache after lookup for later use.
| Modifier and Type | Field and Description |
|---|---|
static String |
LOOKUP_CACHE_METRIC_GROUP_NAME |
| Constructor and Description |
|---|
CachingAsyncLookupFunction(org.apache.flink.table.connector.source.lookup.cache.LookupCache cache,
org.apache.flink.table.functions.AsyncLookupFunction delegate) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Collection<org.apache.flink.table.data.RowData>> |
asyncLookup(org.apache.flink.table.data.RowData keyRow) |
void |
close() |
org.apache.flink.table.connector.source.lookup.cache.LookupCache |
getCache() |
void |
open(org.apache.flink.table.functions.FunctionContext context) |
getKind, getTypeInferencefunctionIdentifier, toStringpublic static final String LOOKUP_CACHE_METRIC_GROUP_NAME
public CachingAsyncLookupFunction(org.apache.flink.table.connector.source.lookup.cache.LookupCache cache,
org.apache.flink.table.functions.AsyncLookupFunction delegate)
public void open(org.apache.flink.table.functions.FunctionContext context)
throws Exception
open in class org.apache.flink.table.functions.UserDefinedFunctionExceptionpublic CompletableFuture<Collection<org.apache.flink.table.data.RowData>> asyncLookup(org.apache.flink.table.data.RowData keyRow)
asyncLookup in class org.apache.flink.table.functions.AsyncLookupFunctionpublic void close()
throws Exception
close in class org.apache.flink.table.functions.UserDefinedFunctionException@VisibleForTesting public org.apache.flink.table.connector.source.lookup.cache.LookupCache getCache()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.