Package com.google.gerrit.server.cache
Interface CacheBinding<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 long
diskLimit()
CacheBinding<K,V>
diskLimit(long limit)
Set the total on-disk limit of the cacheCacheBinding<K,V>
expireAfterWrite(long duration, TimeUnit durationUnits)
Set the time an element lives before being expired.Long
expireAfterWrite(TimeUnit unit)
com.google.inject.TypeLiteral<K>
keyType()
com.google.common.cache.CacheLoader<K,V>
loader()
CacheBinding<K,V>
loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
Populate the cache with items from the CacheLoader.long
maximumWeight()
CacheBinding<K,V>
maximumWeight(long weight)
Set the total size of the cache.String
name()
com.google.inject.TypeLiteral<V>
valueType()
com.google.common.cache.Weigher<K,V>
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.
-
-
-
Method Detail
-
maximumWeight
CacheBinding<K,V> maximumWeight(long weight)
Set the total size of the cache.
-
diskLimit
CacheBinding<K,V> diskLimit(long limit)
Set the total on-disk limit of the cache
-
expireAfterWrite
CacheBinding<K,V> expireAfterWrite(long duration, TimeUnit durationUnits)
Set the time an element lives before being expired.
-
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.
-
name
String name()
-
keyType
com.google.inject.TypeLiteral<K> keyType()
-
valueType
com.google.inject.TypeLiteral<V> valueType()
-
maximumWeight
long maximumWeight()
-
diskLimit
long diskLimit()
-
-