Class CacheLoader
- java.lang.Object
-
- org.apache.flink.table.runtime.functions.table.lookup.fullcache.CacheLoader
-
- All Implemented Interfaces:
Serializable,AutoCloseable
- Direct Known Subclasses:
InputFormatCacheLoader
public abstract class CacheLoader extends Object implements AutoCloseable, Serializable
Abstract task that loads data in Full cache from source provided byScanTableSource.ScanRuntimeProvider.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>>cacheprotected booleanisStoppedprotected static longTIMEOUT_AFTER_INTERRUPT_MS
-
Constructor Summary
Constructors Constructor Description CacheLoader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidawaitFirstLoad()voidclose()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)CompletableFuture<Void>reloadAsync()protected abstract booleanupdateCache()
-
-
-
Field Detail
-
TIMEOUT_AFTER_INTERRUPT_MS
protected static final long TIMEOUT_AFTER_INTERRUPT_MS
- See Also:
- Constant Field Values
-
cache
protected transient volatile ConcurrentHashMap<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> cache
-
isStopped
protected volatile boolean isStopped
-
-
Method Detail
-
updateCache
protected abstract boolean updateCache() throws Exception- 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
public void awaitFirstLoad() throws InterruptedException- Throws:
InterruptedException
-
reloadAsync
public CompletableFuture<Void> reloadAsync()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-