public class LongConcurrentLRUMap<V> extends LongMap<V>
LongMap.LongMapIterator<V>
Modifier and Type | Field and Description |
---|---|
protected int |
acceptableWaterMark |
protected AtomicLong |
accessCounter |
protected AtomicLong |
evictionCounter |
protected boolean |
isCleaning |
protected int |
lowerWaterMark |
protected LongConcurrentHashMap<org.mapdb.LongConcurrentLRUMap.CacheEntry<V>> |
map |
protected ReentrantLock |
markAndSweepLock |
protected AtomicLong |
missCounter |
protected long |
oldestEntry |
protected AtomicLong |
putCounter |
protected AtomicInteger |
size |
protected int |
upperWaterMark |
Constructor and Description |
---|
LongConcurrentLRUMap(int size,
int lowerWatermark) |
LongConcurrentLRUMap(int upperWaterMark,
int lowerWaterMark,
int acceptableWatermark,
int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all mappings from this hash map, leaving it empty.
|
protected void |
evictedEntry(long key,
V value)
override this method to get notified about evicted entries
|
V |
get(long key)
Returns the value of the mapping with the specified key.
|
LongMap<org.mapdb.LongConcurrentLRUMap.CacheEntry<V>> |
getMap() |
boolean |
isEmpty()
Returns whether this map is empty.
|
LongMap.LongMapIterator<V> |
longMapIterator() |
V |
put(long key,
V val)
Maps the specified key to the specified value.
|
V |
remove(long key)
Removes the mapping from this map
|
int |
size()
Returns the number of elements in this map.
|
Iterator<V> |
valuesIterator() |
protected final LongConcurrentHashMap<org.mapdb.LongConcurrentLRUMap.CacheEntry<V>> map
protected final int upperWaterMark
protected final int lowerWaterMark
protected final ReentrantLock markAndSweepLock
protected boolean isCleaning
protected final int acceptableWaterMark
protected long oldestEntry
protected final AtomicLong accessCounter
protected final AtomicLong putCounter
protected final AtomicLong missCounter
protected final AtomicLong evictionCounter
protected final AtomicInteger size
public LongConcurrentLRUMap(int upperWaterMark, int lowerWaterMark, int acceptableWatermark, int initialSize)
public LongConcurrentLRUMap(int size, int lowerWatermark)
public V get(long key)
LongMap
public boolean isEmpty()
LongMap
isEmpty
in class LongMap<V>
true
if this map has no elements, false
otherwise.LongMap.size()
public V remove(long key)
LongMap
public V put(long key, V val)
LongMap
public int size()
LongMap
public Iterator<V> valuesIterator()
valuesIterator
in class LongMap<V>
public LongMap.LongMapIterator<V> longMapIterator()
longMapIterator
in class LongMap<V>
public void clear()
LongMap
clear
in class LongMap<V>
LongMap.isEmpty()
,
LongMap.size()
protected void evictedEntry(long key, V value)
Copyright © 2017. All rights reserved.