Class SpanConcurrentHashMap<K,​V extends AbstractSpan<?>>

  • Type Parameters:
    K - key type
    V - 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>
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      static <K,​V extends AbstractSpan<?>>
      com.blogspot.mydailyjava.weaklockfree.WeakConcurrentMap<K,​V>
      createWeakMap()  
      V put​(K key, V value)  
      V putIfAbsent​(K key, V value)  
      V remove​(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
      • Methods inherited from class java.util.AbstractMap

        clone
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SpanConcurrentHashMap

        public SpanConcurrentHashMap()
    • 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:
        remove in interface java.util.Map<K,​V extends AbstractSpan<?>>
        Overrides:
        remove in class java.util.concurrent.ConcurrentHashMap<K,​V extends AbstractSpan<?>>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V extends AbstractSpan<?>>
        Overrides:
        put in class java.util.concurrent.ConcurrentHashMap<K,​V extends AbstractSpan<?>>
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value)
        Specified by:
        putIfAbsent in interface java.util.concurrent.ConcurrentMap<K,​V extends AbstractSpan<?>>
        Specified by:
        putIfAbsent in interface java.util.Map<K,​V extends AbstractSpan<?>>
        Overrides:
        putIfAbsent in class java.util.concurrent.ConcurrentHashMap<K,​V extends AbstractSpan<?>>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<K,​V extends AbstractSpan<?>>
        Overrides:
        clear in class java.util.concurrent.ConcurrentHashMap<K,​V extends AbstractSpan<?>>