Package com.google.gerrit.server.cache
Class PersistentCacheBaseFactory
java.lang.Object
com.google.gerrit.server.cache.PersistentCacheBaseFactory
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected final Path
protected final org.eclipse.jgit.lib.Config
protected boolean
protected final MemoryCacheFactory
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentCacheBaseFactory
(MemoryCacheFactory memCacheFactory, org.eclipse.jgit.lib.Config config, SitePaths site) -
Method Summary
Modifier and TypeMethodDescription<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 Details
-
memCacheFactory
-
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
- 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
-