Class PersistentCacheBaseFactory

java.lang.Object
com.google.gerrit.server.cache.PersistentCacheBaseFactory
All Implemented Interfaces:
PersistentCacheFactory

public abstract class PersistentCacheBaseFactory extends Object implements PersistentCacheFactory
Base class for persistent cache factory. If the cache.directory property is unset, or disk limit is zero or negative, it will fall back to in-memory only caches.
  • Field Details

    • memCacheFactory

      protected final MemoryCacheFactory memCacheFactory
    • cacheDir

      protected final Path cacheDir
    • diskEnabled

      protected boolean diskEnabled
    • config

      protected final org.eclipse.jgit.lib.Config config
  • Constructor Details

    • PersistentCacheBaseFactory

      public PersistentCacheBaseFactory(MemoryCacheFactory memCacheFactory, org.eclipse.jgit.lib.Config config, SitePaths site)
  • Method Details

    • buildImpl

      protected abstract <K, V> com.google.common.cache.Cache<K,V> buildImpl(PersistentCacheDef<K,V> in, long diskLimit)
    • buildImpl

      protected abstract <K, V> com.google.common.cache.LoadingCache<K,V> buildImpl(PersistentCacheDef<K,V> in, com.google.common.cache.CacheLoader<K,V> loader, long diskLimit)
    • build

      public <K, V> com.google.common.cache.Cache<K,V> build(PersistentCacheDef<K,V> in)
      Specified by:
      build in interface PersistentCacheFactory
    • build

      public <K, V> com.google.common.cache.LoadingCache<K,V> build(PersistentCacheDef<K,V> in, com.google.common.cache.CacheLoader<K,V> loader)
      Specified by:
      build in interface PersistentCacheFactory