Package com.google.gerrit.server.cache
Interface PersistentCacheBinding<K,V>
- All Superinterfaces:
CacheBinding<K,
V>
Configure a persistent cache declared within a
CacheModule
instance.-
Method Summary
Modifier and TypeMethodDescriptiondiskLimit
(long limit) Set the total on-disk limit of the cache.expireAfterWrite
(Duration duration) Set the time an element lives after last write before being expired.expireFromMemoryAfterAccess
(Duration duration) Set the time an element lives after last access before being expired.keySerializer
(com.google.gerrit.server.cache.serialize.CacheSerializer<K> keySerializer) Populate the cache with items from the CacheLoader.maximumWeight
(long weight) Set the total size of the cache.valueSerializer
(com.google.gerrit.server.cache.serialize.CacheSerializer<V> valueSerializer) version
(int version) 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, refreshAfterWrite
-
Method Details
-
maximumWeight
Description copied from interface:CacheBinding
Set the total size of the cache.- Specified by:
maximumWeight
in interfaceCacheBinding<K,
V>
-
expireAfterWrite
Description copied from interface:CacheBinding
Set the time an element lives after last write before being expired.- Specified by:
expireAfterWrite
in interfaceCacheBinding<K,
V>
-
loader
@CanIgnoreReturnValue PersistentCacheBinding<K,V> loader(Class<? extends com.google.common.cache.CacheLoader<K, V>> clazz) Description copied from interface:CacheBinding
Populate the cache with items from the CacheLoader.- Specified by:
loader
in interfaceCacheBinding<K,
V>
-
expireFromMemoryAfterAccess
Description copied from interface:CacheBinding
Set the time an element lives after last access before being expired.- Specified by:
expireFromMemoryAfterAccess
in interfaceCacheBinding<K,
V>
-
weigher
@CanIgnoreReturnValue PersistentCacheBinding<K,V> weigher(Class<? extends com.google.common.cache.Weigher<K, V>> clazz) Description copied from interface:CacheBinding
Algorithm to weigh an object with a method other than the unit weight 1.- Specified by:
weigher
in interfaceCacheBinding<K,
V>
-
version
-
diskLimit
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
@CanIgnoreReturnValue PersistentCacheBinding<K,V> keySerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<K> keySerializer) -
valueSerializer
@CanIgnoreReturnValue PersistentCacheBinding<K,V> valueSerializer(com.google.gerrit.server.cache.serialize.CacheSerializer<V> valueSerializer)
-