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
(TimeValue expireAfterAccess) Sets the amount of time before an entry in the cache expires after it was last accessed.setExpireAfterWrite
(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
-