Class RefCountingMap<K,V>
java.lang.Object
org.apache.hadoop.hbase.metrics.impl.RefCountingMap<K,V>
A map of K to V, but does ref counting for added and removed values. The values are not added
directly, but instead requested from the given Supplier if ref count == 0. Each put() call will
increment the ref count, and each remove() will decrement it. The values are removed from the map
iff ref count == 0.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
map
-
-
Constructor Details
-
RefCountingMap
-
-
Method Details
-
put
-
get
-
remove
Decrements the ref count of k, and removes from map if ref count == 0.- Parameters:
k
- the key to remove- Returns:
- the value associated with the specified key or null if key is removed from map.
-
clear
void clear() -
keySet
-
values
Collection<V> values() -
size
int size()
-