Class LRU2Cache<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.apache.dubbo.common.utils.LRU2Cache<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K,V>

public class LRU2Cache<K,V> extends LinkedHashMap<K,V>
LRU-2

When the data accessed for the first time, add it to history list. If the size of history list reaches max capacity, eliminate the earliest data (first in first out). When the data already exists in the history list, and be accessed for the second time, then it will be put into cache.

TODO, consider replacing with ConcurrentHashMap to improve performance under concurrency
See Also: