Class ObjectCacheBackend
- java.lang.Object
-
- com.linkedin.davinci.store.cache.backend.ObjectCacheBackend
-
public class ObjectCacheBackend extends java.lang.Object
This class is in charge of managing access and maintenance of a VeniceStoreCache. It makes available simple CRUD operations that can be performed on the cache
-
-
Constructor Summary
Constructors Constructor Description ObjectCacheBackend(ClientConfig clientConfig, ObjectCacheConfig cacheConfig, ReadOnlySchemaRepository schemaRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCachedPartitions(Version version)
void
close()
<K,V>
java.util.concurrent.CompletableFuture<V>get(K key, Version version, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
<K,V>
java.util.concurrent.CompletableFuture<java.util.Map<K,V>>getAll(java.lang.Iterable<K> keys, Version version, java.util.function.Function<java.lang.Iterable<K>,java.util.Map<K,V>> mappingFunction, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
StoreDataChangedListener
getCacheInvalidatingStoreChangeListener()
AbstractStorageEngine
getStorageEngine(java.lang.String topicName)
ObjectCacheConfig
getStoreCacheConfig()
<K,V>
voidupdate(K key, V val, Version version, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
-
-
-
Constructor Detail
-
ObjectCacheBackend
public ObjectCacheBackend(ClientConfig clientConfig, ObjectCacheConfig cacheConfig, ReadOnlySchemaRepository schemaRepository)
- Parameters:
clientConfig
- configurations that enabled the VeniceStoreCacheBackend to interact with a venice cluster (to set up ingestion) as well as store information (such as the store name that is being cached).cacheConfig
- configurations that configure the cache policy (TTL, size, etc.)
-
-
Method Detail
-
close
public void close()
-
clearCachedPartitions
public void clearCachedPartitions(Version version)
-
get
public <K,V> java.util.concurrent.CompletableFuture<V> get(K key, Version version, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
-
getAll
public <K,V> java.util.concurrent.CompletableFuture<java.util.Map<K,V>> getAll(java.lang.Iterable<K> keys, Version version, java.util.function.Function<java.lang.Iterable<K>,java.util.Map<K,V>> mappingFunction, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
-
getStorageEngine
public AbstractStorageEngine getStorageEngine(java.lang.String topicName)
-
update
public <K,V> void update(K key, V val, Version version, com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,V> cacheLoader)
-
getCacheInvalidatingStoreChangeListener
public StoreDataChangedListener getCacheInvalidatingStoreChangeListener()
-
getStoreCacheConfig
public ObjectCacheConfig getStoreCacheConfig()
-
-