@Internal public class LookupCacheManager extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
LookupCacheManager.RefCountedCache
A wrapper class of
LookupCache which also tracks the reference count of it. |
Modifier and Type | Method and Description |
---|---|
void |
checkAllReleased() |
void |
clear() |
static LookupCacheManager |
getInstance()
Get the shared instance of
LookupCacheManager . |
Map<String,LookupCacheManager.RefCountedCache> |
getManagedCaches() |
static void |
keepCacheOnRelease(boolean toKeep) |
LookupCache |
registerCacheIfAbsent(String cacheIdentifier,
LookupCache cache)
Register a cache instance with identifier to the manager.
|
void |
unregisterCache(String cacheIdentifier)
Release the cache with the given identifier from the manager.
|
public static LookupCacheManager getInstance()
LookupCacheManager
.public LookupCache registerCacheIfAbsent(String cacheIdentifier, LookupCache cache)
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.
cacheIdentifier
- identifier of the cachecache
- instance of cache trying to registerpublic void unregisterCache(String cacheIdentifier)
The manager will track a reference count of managed caches, and will close the cache if the reference count reaches 0.
public static void keepCacheOnRelease(boolean toKeep)
public void checkAllReleased()
public void clear()
public Map<String,LookupCacheManager.RefCountedCache> getManagedCaches()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.