Package org.redisson.cache
Class LRUCacheMap<K,V>
java.lang.Object
org.redisson.cache.AbstractCacheMap<K,V>
org.redisson.cache.LRUCacheMap<K,V>
- Type Parameters:
K- keyV- value
- All Implemented Interfaces:
ConcurrentMap<K,,V> Map<K,,V> Cache<K,V>
LRU (least recently used) cache.
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected voidprotected voidonValueCreate(CachedValue<K, V> value) protected voidonValueRead(CachedValue<K, V> value) protected voidonValueRemove(CachedValue<K, V> value) Methods inherited from class org.redisson.cache.AbstractCacheMap
computeIfAbsent, computeIfPresent, containsKey, containsValue, create, entrySet, get, isEmpty, isFull, keySet, put, putAll, putIfAbsent, readValue, removalListener, remove, remove, removeExpiredEntries, replace, replace, size, valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
compute, forEach, getOrDefault, merge, replaceAll
-
Constructor Details
-
LRUCacheMap
public LRUCacheMap(int size, long timeToLiveInMillis, long maxIdleInMillis)
-
-
Method Details
-
onValueCreate
- Overrides:
onValueCreatein classAbstractCacheMap<K,V>
-
onValueRemove
- Overrides:
onValueRemovein classAbstractCacheMap<K,V>
-
onValueRead
- Overrides:
onValueReadin classAbstractCacheMap<K,V>
-
onMapFull
protected void onMapFull()- Specified by:
onMapFullin classAbstractCacheMap<K,V>
-
clear
public void clear()
-