Package org.elasticsearch.common.cache
Class CacheBuilder<K,V>
java.lang.Object
org.elasticsearch.common.cache.CacheBuilder<K,V>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static <K, V> CacheBuilder<K,V>
builder()
removalListener(RemovalListener<K,V> removalListener)
setExpireAfterAccess(org.elasticsearch.core.TimeValue expireAfterAccess)
Sets the amount of time before an entry in the cache expires after it was last accessed.setExpireAfterWrite(org.elasticsearch.core.TimeValue expireAfterWrite)
Sets the amount of time before an entry in the cache expires after it was written.setMaximumWeight(long maximumWeight)
weigher(ToLongBiFunction<K,V> weigher)
-
Method Details
-
builder
-
setMaximumWeight
-
setExpireAfterAccess
Sets the amount of time before an entry in the cache expires after it was last accessed.- Parameters:
expireAfterAccess
- The amount of time before an entry expires after it was last accessed. Must not benull
and must be greater than 0.
-
setExpireAfterWrite
Sets the amount of time before an entry in the cache expires after it was written.- Parameters:
expireAfterWrite
- The amount of time before an entry expires after it was written. Must not benull
and must be greater than 0.
-
weigher
-
removalListener
-
build
-