Package io.trino.plugin.base.cache
Class SafeCaches
- java.lang.Object
-
- io.trino.plugin.base.cache.SafeCaches
-
public final class SafeCaches extends Object
- See Also:
EvictableCache,EvictableLoadingCache
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
NonEvictableCache<K,V>buildNonEvictableCache(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder)static <K,V>
NonEvictableLoadingCache<K,V>buildNonEvictableCache(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder, com.google.common.cache.CacheLoader<? super K,V> cacheLoader)static <K,V>
NonKeyEvictableCache<K,V>buildNonEvictableCacheWithWeakInvalidateAll(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder)Builds a cache that supportsCache.invalidateAll()with best-effort semantics: there is no guarantee that cache is empty afterinvalidateAll()returns, or that subsequent read will not see stale state.static <K,V>
NonKeyEvictableLoadingCache<K,V>buildNonEvictableCacheWithWeakInvalidateAll(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder, com.google.common.cache.CacheLoader<? super K,V> cacheLoader)Builds a cache that supportsCache.invalidateAll()with best-effort semantics: there is no guarantee that cache is empty afterinvalidateAll()returns, or that subsequent read will not see stale state.
-
-
-
Method Detail
-
buildNonEvictableCache
public static <K,V> NonEvictableCache<K,V> buildNonEvictableCache(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder)
-
buildNonEvictableCacheWithWeakInvalidateAll
public static <K,V> NonKeyEvictableCache<K,V> buildNonEvictableCacheWithWeakInvalidateAll(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder)
Builds a cache that supportsCache.invalidateAll()with best-effort semantics: there is no guarantee that cache is empty afterinvalidateAll()returns, or that subsequent read will not see stale state.
-
buildNonEvictableCache
public static <K,V> NonEvictableLoadingCache<K,V> buildNonEvictableCache(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder, com.google.common.cache.CacheLoader<? super K,V> cacheLoader)
-
buildNonEvictableCacheWithWeakInvalidateAll
public static <K,V> NonKeyEvictableLoadingCache<K,V> buildNonEvictableCacheWithWeakInvalidateAll(com.google.common.cache.CacheBuilder<? super K,? super V> cacheBuilder, com.google.common.cache.CacheLoader<? super K,V> cacheLoader)
Builds a cache that supportsCache.invalidateAll()with best-effort semantics: there is no guarantee that cache is empty afterinvalidateAll()returns, or that subsequent read will not see stale state.
-
-