Class LookupCacheManager
java.lang.Object
org.apache.flink.table.runtime.functions.table.lookup.LookupCacheManager
Managing shared caches across different subtasks.
In order to reduce the memory usage of cache, different subtasks of the same lookup join runner will share the same cache instance. Caches are managed by the identifier of the lookup table for which it is serving.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA wrapper class ofLookupCachewhich also tracks the reference count of it. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()static LookupCacheManagerGet the shared instance ofLookupCacheManager.static voidkeepCacheOnRelease(boolean toKeep) org.apache.flink.table.connector.source.lookup.cache.LookupCacheregisterCacheIfAbsent(String cacheIdentifier, org.apache.flink.table.connector.source.lookup.cache.LookupCache cache) Register a cache instance with identifier to the manager.voidunregisterCache(String cacheIdentifier) Release the cache with the given identifier from the manager.
-
Method Details
-
getInstance
Get the shared instance ofLookupCacheManager. -
registerCacheIfAbsent
public org.apache.flink.table.connector.source.lookup.cache.LookupCache registerCacheIfAbsent(String cacheIdentifier, org.apache.flink.table.connector.source.lookup.cache.LookupCache cache) Register a cache instance with identifier to the manager.If the cache with the given identifier is already registered in the manager, this method will return the registered one, otherwise this method will register the given cache into the manager then return.
- Parameters:
cacheIdentifier- identifier of the cachecache- instance of cache trying to register- Returns:
- instance of the shared cache
-
unregisterCache
Release the cache with the given identifier from the manager.The manager will track a reference count of managed caches, and will close the cache if the reference count reaches 0.
-
keepCacheOnRelease
public static void keepCacheOnRelease(boolean toKeep) -
checkAllReleased
public void checkAllReleased() -
clear
public void clear() -
getManagedCaches
-