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.
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
LOOKUP_CACHE_METRIC_GROUP_NAME |
| 构造器和说明 |
|---|
CachingAsyncLookupFunction(org.apache.flink.table.connector.source.lookup.cache.LookupCache cache,
org.apache.flink.table.functions.AsyncLookupFunction delegate) |
| 限定符和类型 | 方法和说明 |
|---|---|
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) |
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 在类中 org.apache.flink.table.functions.UserDefinedFunctionExceptionpublic CompletableFuture<Collection<org.apache.flink.table.data.RowData>> asyncLookup(org.apache.flink.table.data.RowData keyRow)
asyncLookup 在类中 org.apache.flink.table.functions.AsyncLookupFunctionpublic void close()
throws Exception
close 在类中 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.