Package com.google.gerrit.server.cache
Interface PersistentCacheBinding<K,V>
-
- All Superinterfaces:
CacheBinding<K,V>
public interface PersistentCacheBinding<K,V> extends CacheBinding<K,V>
Configure a persistent cache declared within aCacheModuleinstance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PersistentCacheBinding<K,V>diskLimit(long limit)Set the total on-disk limit of the cache.PersistentCacheBinding<K,V>expireAfterWrite(Duration duration)Set the time an element lives after last write before being expired.PersistentCacheBinding<K,V>expireFromMemoryAfterAccess(Duration duration)Set the time an element lives after last access before being expired.PersistentCacheBinding<K,V>keySerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<K> keySerializer)PersistentCacheBinding<K,V>loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)Populate the cache with items from the CacheLoader.PersistentCacheBinding<K,V>maximumWeight(long weight)Set the total size of the cache.PersistentCacheBinding<K,V>valueSerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<V> valueSerializer)PersistentCacheBinding<K,V>version(int version)PersistentCacheBinding<K,V>weigher(Class<? extends com.google.common.cache.Weigher<K,V>> clazz)Algorithm to weigh an object with a method other than the unit weight 1.-
Methods inherited from interface com.google.gerrit.server.cache.CacheBinding
configKey
-
-
-
-
Method Detail
-
maximumWeight
PersistentCacheBinding<K,V> maximumWeight(long weight)
Description copied from interface:CacheBindingSet the total size of the cache.- Specified by:
maximumWeightin interfaceCacheBinding<K,V>
-
expireAfterWrite
PersistentCacheBinding<K,V> expireAfterWrite(Duration duration)
Description copied from interface:CacheBindingSet the time an element lives after last write before being expired.- Specified by:
expireAfterWritein interfaceCacheBinding<K,V>
-
loader
PersistentCacheBinding<K,V> loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
Description copied from interface:CacheBindingPopulate the cache with items from the CacheLoader.- Specified by:
loaderin interfaceCacheBinding<K,V>
-
expireFromMemoryAfterAccess
PersistentCacheBinding<K,V> expireFromMemoryAfterAccess(Duration duration)
Description copied from interface:CacheBindingSet the time an element lives after last access before being expired.- Specified by:
expireFromMemoryAfterAccessin interfaceCacheBinding<K,V>
-
weigher
PersistentCacheBinding<K,V> weigher(Class<? extends com.google.common.cache.Weigher<K,V>> clazz)
Description copied from interface:CacheBindingAlgorithm to weigh an object with a method other than the unit weight 1.- Specified by:
weigherin interfaceCacheBinding<K,V>
-
version
PersistentCacheBinding<K,V> version(int version)
-
diskLimit
PersistentCacheBinding<K,V> diskLimit(long limit)
Set the total on-disk limit of the cache.If 0 or negative, persistence for the cache is disabled by default, but may still be overridden in the config.
-
keySerializer
PersistentCacheBinding<K,V> keySerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<K> keySerializer)
-
valueSerializer
PersistentCacheBinding<K,V> valueSerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<V> valueSerializer)
-
-