Class ConcurrentOpenHashMap<K,V>

java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<K,V>
Type Parameters:
V -

public class ConcurrentOpenHashMap<K,V> extends Object
Concurrent hash map.

Provides similar methods as a ConcurrentMap<K,V> but since it's an open hash map with linear probing, no node allocations are required to store the values.

  • Constructor Details

    • ConcurrentOpenHashMap

      @Deprecated public ConcurrentOpenHashMap()
      Deprecated.
    • ConcurrentOpenHashMap

      @Deprecated public ConcurrentOpenHashMap(int expectedItems)
      Deprecated.
    • ConcurrentOpenHashMap

      @Deprecated public ConcurrentOpenHashMap(int expectedItems, int concurrencyLevel)
      Deprecated.
    • ConcurrentOpenHashMap

      public ConcurrentOpenHashMap(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
  • Method Details

    • newBuilder

      public static <K, V> ConcurrentOpenHashMap.Builder<K,V> newBuilder()
    • size

      public long size()
    • capacity

      public long capacity()
    • isEmpty

      public boolean isEmpty()
    • get

      public V get(K key)
    • containsKey

      public boolean containsKey(K key)
    • put

      public V put(K key, V value)
    • putIfAbsent

      public V putIfAbsent(K key, V value)
    • computeIfAbsent

      public V computeIfAbsent(K key, Function<K,V> provider)
    • remove

      public V remove(K key)
    • remove

      public boolean remove(K key, Object value)
    • removeNullValue

      public void removeNullValue(K key)
    • clear

      public void clear()
    • forEach

      public void forEach(BiConsumer<? super K,? super V> processor)
    • keys

      public List<K> keys()
      Returns:
      a new list of all keys (makes a copy)
    • values

      public List<V> values()