Package co.elastic.apm.agent.util
Class SpanConcurrentHashMap<K,V extends AbstractSpan<?>>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.concurrent.ConcurrentHashMap<K,V>
-
- co.elastic.apm.agent.util.SpanConcurrentHashMap<K,V>
-
- Type Parameters:
K- key typeV- context type
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.ConcurrentMap<K,V>,java.util.Map<K,V>
public class SpanConcurrentHashMap<K,V extends AbstractSpan<?>> extends java.util.concurrent.ConcurrentHashMap<K,V>Hash map dedicated to storage of in-flight spans and transactions, reference count is being incremented/decremented when entry is added/removed. Usage of this map is intended for providing GC-based storage of context associated to a framework-level object key, when the latter is collected by GC it allows to decrement and then recycle the span/transaction.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
java.util.concurrent.ConcurrentHashMap.KeySetView<K extends java.lang.Object,V extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description SpanConcurrentHashMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()static <K,V extends AbstractSpan<?>>
com.blogspot.mydailyjava.weaklockfree.WeakConcurrentMap<K,V>createWeakMap()Vput(K key, V value)VputIfAbsent(K key, V value)Vremove(java.lang.Object key)-
Methods inherited from class java.util.concurrent.ConcurrentHashMap
compute, computeIfAbsent, 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, putAll, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
-
-
-
-
Method Detail
-
createWeakMap
public static <K,V extends AbstractSpan<?>> com.blogspot.mydailyjava.weaklockfree.WeakConcurrentMap<K,V> createWeakMap()
-
remove
@Nullable public V remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<K,V extends AbstractSpan<?>>- Overrides:
removein classjava.util.concurrent.ConcurrentHashMap<K,V extends AbstractSpan<?>>
-
put
public V put(K key, V value)
- Specified by:
putin interfacejava.util.Map<K,V extends AbstractSpan<?>>- Overrides:
putin classjava.util.concurrent.ConcurrentHashMap<K,V extends AbstractSpan<?>>
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfacejava.util.concurrent.ConcurrentMap<K,V extends AbstractSpan<?>>- Specified by:
putIfAbsentin interfacejava.util.Map<K,V extends AbstractSpan<?>>- Overrides:
putIfAbsentin classjava.util.concurrent.ConcurrentHashMap<K,V extends AbstractSpan<?>>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<K,V extends AbstractSpan<?>>- Overrides:
clearin classjava.util.concurrent.ConcurrentHashMap<K,V extends AbstractSpan<?>>
-
-