Class ConcurrentLongHashMap<V>
- java.lang.Object
-
- org.apache.pulsar.common.util.collections.ConcurrentLongHashMap<V>
-
- Type Parameters:
V-
public class ConcurrentLongHashMap<V> extends java.lang.ObjectMap from long to an Object.Provides similar methods as a
ConcurrentMap<long,Object>with 2 differences:- No boxing/unboxing from long -> Long
- Open hash map with linear probing, no node allocations to store the values
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConcurrentLongHashMap.Builder<T>Builder of ConcurrentLongHashMap.static interfaceConcurrentLongHashMap.EntryProcessor<V>Processor for one key-value entry, where the key islong.
-
Constructor Summary
Constructors Constructor Description ConcurrentLongHashMap()Deprecated.ConcurrentLongHashMap(int expectedItems)Deprecated.ConcurrentLongHashMap(int expectedItems, int concurrencyLevel)Deprecated.ConcurrentLongHashMap(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcapacity()voidclear()VcomputeIfAbsent(long key, java.util.function.LongFunction<V> provider)booleancontainsKey(long key)voidforEach(ConcurrentLongHashMap.EntryProcessor<V> processor)Vget(long key)booleanisEmpty()java.util.List<java.lang.Long>keys()static <V> ConcurrentLongHashMap.Builder<V>newBuilder()Vput(long key, V value)VputIfAbsent(long key, V value)Vremove(long key)booleanremove(long key, java.lang.Object value)longsize()java.util.List<V>values()
-
-
-
Constructor Detail
-
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 Detail
-
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)
-
remove
public V remove(long key)
-
remove
public boolean remove(long key, java.lang.Object value)
-
clear
public void clear()
-
forEach
public void forEach(ConcurrentLongHashMap.EntryProcessor<V> processor)
-
keys
public java.util.List<java.lang.Long> keys()
- Returns:
- a new list of all keys (makes a copy)
-
values
public java.util.List<V> values()
-
-