Package org.redisson.cache
Class LFUCacheMap<K,V>
- java.lang.Object
-
- org.redisson.cache.AbstractCacheMap<K,V>
-
- org.redisson.cache.LFUCacheMap<K,V>
-
- Type Parameters:
K
- keyV
- value
- All Implemented Interfaces:
ConcurrentMap<K,V>
,Map<K,V>
,Cache<K,V>
public class LFUCacheMap<K,V> extends AbstractCacheMap<K,V>
LFU (least frequently used) cache.- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LFUCacheMap.LFUCachedValue
static class
LFUCacheMap.MapKey
-
Constructor Summary
Constructors Constructor Description LFUCacheMap(int size, long timeToLiveInMillis, long maxIdleInMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
protected CachedValue
create(K key, V value, long ttl, long maxIdleTime)
protected void
onMapFull()
protected void
onValueCreate(CachedValue value)
protected void
onValueRead(CachedValue value)
protected void
onValueRemove(CachedValue value)
-
Methods inherited from class org.redisson.cache.AbstractCacheMap
containsKey, containsValue, entrySet, get, isEmpty, isFull, keySet, put, putAll, putIfAbsent, readValue, remove, remove, removeExpiredEntries, replace, replace, size, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
-
-
-
Method Detail
-
create
protected CachedValue create(K key, V value, long ttl, long maxIdleTime)
- Overrides:
create
in classAbstractCacheMap<K,V>
-
onValueCreate
protected void onValueCreate(CachedValue value)
- Overrides:
onValueCreate
in classAbstractCacheMap<K,V>
-
onValueRead
protected void onValueRead(CachedValue value)
- Overrides:
onValueRead
in classAbstractCacheMap<K,V>
-
onValueRemove
protected void onValueRemove(CachedValue value)
- Overrides:
onValueRemove
in classAbstractCacheMap<K,V>
-
onMapFull
protected void onMapFull()
- Specified by:
onMapFull
in classAbstractCacheMap<K,V>
-
-