Class ConcurrentLongHashMap<V>

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

public class ConcurrentLongHashMap<V> extends Object
Map from long to an Object.

Provides similar methods as a ConcurrentMap<long,Object> with 2 differences:

  1. No boxing/unboxing from long -> Long
  2. Open hash map with linear probing, no node allocations to store the values
  • Constructor Details

    • ConcurrentLongHashMap

      @Deprecated public ConcurrentLongHashMap()
      Deprecated.
    • ConcurrentLongHashMap

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

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

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

    • newBuilder

      public static <V> ConcurrentLongHashMap.Builder<V> newBuilder()
    • size

      public long size()
    • capacity

      public long capacity()
    • isEmpty

      public boolean isEmpty()
    • get

      public V get(long key)
    • containsKey

      public boolean containsKey(long key)
    • put

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

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

      public V computeIfAbsent(long key, LongFunction<V> provider)
    • remove

      public V remove(long key)
    • remove

      public boolean remove(long key, Object value)
    • clear

      public void clear()
    • forEach

      public void forEach(ConcurrentLongHashMap.EntryProcessor<V> processor)
    • keys

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

      public List<V> values()