Class ConcurrentLRUCache<K,V extends MemoryObject>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.apache.jackrabbit.oak.index.indexer.document.tree.store.utils.ConcurrentLRUCache<K,V>
- Type Parameters:
K
- the key typeV
- the value type
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,
V>
A synchronized LRU cache. The cache size is limited by the amount of memory
(and not number of entries).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, size
-
Constructor Details
-
ConcurrentLRUCache
public ConcurrentLRUCache(long maxMemoryBytes)
-
-
Method Details
-
toString
- Overrides:
toString
in classAbstractMap<K,
V extends MemoryObject>
-
setSize
public void setSize(int maxMemoryBytes) -
get
- Specified by:
get
in interfaceMap<K,
V extends MemoryObject> - Overrides:
get
in classLinkedHashMap<K,
V extends MemoryObject>
-
keys
-
put
- Specified by:
put
in interfaceMap<K,
V extends MemoryObject> - Overrides:
put
in classHashMap<K,
V extends MemoryObject>
-
putAll
- Specified by:
putAll
in interfaceMap<K,
V extends MemoryObject> - Overrides:
putAll
in classHashMap<K,
V extends MemoryObject>
-
remove
- Specified by:
remove
in interfaceMap<K,
V extends MemoryObject> - Overrides:
remove
in classHashMap<K,
V extends MemoryObject>
-
clear
public void clear()- Specified by:
clear
in interfaceMap<K,
V extends MemoryObject> - Overrides:
clear
in classLinkedHashMap<K,
V extends MemoryObject>
-
entryWasRemoved
-
removeEldestEntry
- Overrides:
removeEldestEntry
in classLinkedHashMap<K,
V extends MemoryObject>
-