Package org.apache.phoenix.util
Class SimpleLRUCache<K extends Comparable,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<K,V>
org.apache.phoenix.util.SimpleLRUCache<K,V>
- All Implemented Interfaces:
Serializable,ConcurrentMap<K,,V> Map<K,V>
Minimal Cache implementation based on ConcurrentHashMap.
The maxSize logic will only work if all access is via the the computeIfAbsent() method.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,V extends Object> 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> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.concurrent.ConcurrentHashMap
clear, compute, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, valuesMethods inherited from class java.util.AbstractMap
clone
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
SimpleLRUCache
public SimpleLRUCache(long maxSize, int concurrencyLevel)
-
-
Method Details
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K extends Comparable,V> - Specified by:
computeIfAbsentin interfaceMap<K extends Comparable,V> - Overrides:
computeIfAbsentin classConcurrentHashMap<K extends Comparable,V>
-