Class ConcurrentOpenHashMap<K,V>
java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<K,V>
- Type Parameters:
V-
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder of ConcurrentOpenHashMap. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ConcurrentOpenHashMap(int expectedItems) Deprecated.ConcurrentOpenHashMap(int expectedItems, int concurrencyLevel) Deprecated.ConcurrentOpenHashMap(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor) -
Method Summary
Modifier and TypeMethodDescriptionlongcapacity()voidclear()computeIfAbsent(K key, Function<K, V> provider) booleancontainsKey(K key) voidforEach(BiConsumer<? super K, ? super V> processor) booleanisEmpty()keys()static <K,V> ConcurrentOpenHashMap.Builder<K, V> putIfAbsent(K key, V value) booleanvoidremoveNullValue(K key) longsize()values()
-
Constructor Details
-
ConcurrentOpenHashMap
Deprecated. -
ConcurrentOpenHashMap
Deprecated. -
ConcurrentOpenHashMap
Deprecated. -
ConcurrentOpenHashMap
public ConcurrentOpenHashMap(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
-
Method Details
-
newBuilder
-
size
public long size() -
capacity
public long capacity() -
isEmpty
public boolean isEmpty() -
get
-
containsKey
-
put
-
putIfAbsent
-
computeIfAbsent
-
remove
-
remove
-
removeNullValue
-
clear
public void clear() -
forEach
-
keys
- Returns:
- a new list of all keys (makes a copy)
-
values
-