Class 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 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)
      • update

        public <K,​V> void update​(K key,
                                       V val,
                                       Version version,
                                       com.github.benmanes.caffeine.cache.AsyncCacheLoader<K,​V> cacheLoader)