Class BlockingConcurrentHashMap<K,​V>

  • Type Parameters:
    K - a key type for the map
    V - a value type to store

    public class BlockingConcurrentHashMap<K,​V>
    extends java.lang.Object
    This class ensures that Map.computeIfAbsent(Object, Function) is called only once for the same key. It has inner blocking timeout of 1 minute to wait for the value to be computed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void computeIfAbsent​(K key, java.util.function.Function<K,​V> mappingFunction)  
      V get​(K key)  
      V remove​(K key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockingConcurrentHashMap

        public BlockingConcurrentHashMap()
    • Method Detail

      • computeIfAbsent

        public void computeIfAbsent​(@Nonnull
                                    K key,
                                    java.util.function.Function<K,​V> mappingFunction)
      • get

        @Nullable
        public V get​(@Nonnull
                     K key)
      • remove

        @Nullable
        public V remove​(@Nonnull
                        K key)