Package org.apache.shenyu.common.cache
Class MemorySafeWindowTinyLFUMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.apache.shenyu.common.cache.MemorySafeWindowTinyLFUMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Map<K,V>
@ThreadSafe public class MemorySafeWindowTinyLFUMap<K,V> extends java.util.AbstractMap<K,V> implements java.io.SerializableThe differences between this class andMemorySafeLRUMapis that this class is thread safe, and it use WindowTinyLFU algorithm provided by caffeine which is better than LRU algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MemorySafeWindowTinyLFUMap(int maxFreeMemory, int initialSize)MemorySafeWindowTinyLFUMap(int maxFreeMemory, int initialSize, long expireAfterWrite, long maximumSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()clean invalidated cache now.java.util.Set<java.util.Map.Entry<K,V>>entrySet()booleanequals(java.lang.Object o)Vget(java.lang.Object key)inthashCode()voidinvalidate()invalidate coldest cache now.booleanisFull()whether to full.Vput(K key, V value)Vremove(java.lang.Object key)-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, isEmpty, keySet, putAll, size, toString, values
-
-
-
-
Method Detail
-
get
public V get(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
cleanUp
public void cleanUp()
clean invalidated cache now.
-
invalidate
public void invalidate()
invalidate coldest cache now.
-
isFull
public boolean isFull()
whether to full.- Returns:
- true if it's full
-
equals
public boolean equals(java.lang.Object o)
-
-