Package com.google.gerrit.server.cache
Interface CacheBinding<K,V>
-
- All Known Subinterfaces:
PersistentCacheBinding<K,V>
public interface CacheBinding<K,V>
Configure a cache declared within aCacheModule
instance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheBinding<K,V>
configKey(String configKey)
Set the config name to something other than the cache name.CacheBinding<K,V>
expireAfterWrite(Duration duration)
Set the time an element lives after last write before being expired.CacheBinding<K,V>
expireFromMemoryAfterAccess(Duration duration)
Set the time an element lives after last access before being expired.CacheBinding<K,V>
loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
Populate the cache with items from the CacheLoader.CacheBinding<K,V>
maximumWeight(long weight)
Set the total size of the cache.CacheBinding<K,V>
refreshAfterWrite(Duration duration)
Set the time that an element will be refreshed after.CacheBinding<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.
-
-
-
Method Detail
-
maximumWeight
CacheBinding<K,V> maximumWeight(long weight)
Set the total size of the cache.
-
expireAfterWrite
CacheBinding<K,V> expireAfterWrite(Duration duration)
Set the time an element lives after last write before being expired.
-
expireFromMemoryAfterAccess
CacheBinding<K,V> expireFromMemoryAfterAccess(Duration duration)
Set the time an element lives after last access before being expired.
-
refreshAfterWrite
CacheBinding<K,V> refreshAfterWrite(Duration duration)
Set the time that an element will be refreshed after. Elements older than this but younger thanexpireAfterWrite(Duration)
will still be returned, but on access a task is queued to refresh their value asynchronously.
-
loader
CacheBinding<K,V> loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
Populate the cache with items from the CacheLoader.
-
weigher
CacheBinding<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.
-
configKey
CacheBinding<K,V> configKey(String configKey)
Set the config name to something other than the cache name.- See Also:
CacheDef.configKey()
-
-