Package com.google.gerrit.server.cache
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 Summary
Fields Modifier and Type Field Description protected Path
cacheDir
protected org.eclipse.jgit.lib.Config
config
protected boolean
diskEnabled
protected MemoryCacheFactory
memCacheFactory
-
Constructor Summary
Constructors Constructor Description PersistentCacheBaseFactory(MemoryCacheFactory memCacheFactory, org.eclipse.jgit.lib.Config config, SitePaths site)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <K,V>
com.google.common.cache.Cache<K,V>build(PersistentCacheDef<K,V> in)
<K,V>
com.google.common.cache.LoadingCache<K,V>build(PersistentCacheDef<K,V> in, com.google.common.cache.CacheLoader<K,V> loader)
protected abstract <K,V>
com.google.common.cache.Cache<K,V>buildImpl(PersistentCacheDef<K,V> in, long diskLimit)
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)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.server.cache.PersistentCacheFactory
onStop
-
-
-
-
Field Detail
-
memCacheFactory
protected final MemoryCacheFactory memCacheFactory
-
cacheDir
protected final Path cacheDir
-
diskEnabled
protected boolean diskEnabled
-
config
protected final org.eclipse.jgit.lib.Config config
-
-
Constructor Detail
-
PersistentCacheBaseFactory
public PersistentCacheBaseFactory(MemoryCacheFactory memCacheFactory, org.eclipse.jgit.lib.Config config, SitePaths site)
-
-
Method Detail
-
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 interfacePersistentCacheFactory
-
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 interfacePersistentCacheFactory
-
-