Class CacheLoader
java.lang.Object
org.apache.flink.table.runtime.functions.table.lookup.fullcache.CacheLoader
- All Implemented Interfaces:
Serializable,AutoCloseable
- Direct Known Subclasses:
InputFormatCacheLoader
Abstract task that loads data in Full cache from source provided by
ScanTableSource.ScanRuntimeProvider.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> protected booleanprotected static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> getCache()voidinitializeMetrics(org.apache.flink.metrics.groups.CacheMetricGroup cacheMetricGroup) voidopen(org.apache.flink.configuration.Configuration parameters, ClassLoader userCodeClassLoader) protected abstract boolean
-
Field Details
-
TIMEOUT_AFTER_INTERRUPT_MS
protected static final long TIMEOUT_AFTER_INTERRUPT_MS- See Also:
-
cache
protected transient volatile ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> cache -
isStopped
protected volatile boolean isStopped
-
-
Constructor Details
-
CacheLoader
public CacheLoader()
-
-
Method Details
-
updateCache
- Returns:
- whether reload was successful and was not interrupted.
- Throws:
Exception
-
open
public void open(org.apache.flink.configuration.Configuration parameters, ClassLoader userCodeClassLoader) throws Exception - Throws:
Exception
-
initializeMetrics
public void initializeMetrics(org.apache.flink.metrics.groups.CacheMetricGroup cacheMetricGroup) -
getCache
public ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> getCache() -
awaitFirstLoad
- Throws:
InterruptedException
-
reloadAsync
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-