Class ConcurrentLongHashMap<V>
java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentLongHashMap<V>
- Type Parameters:
V-
Map 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 ClassesModifier and TypeClassDescriptionstatic classBuilder of ConcurrentLongHashMap.static interfaceProcessor for one key-value entry, where the key islong. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.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
Modifier and TypeMethodDescriptionlongcapacity()voidclear()computeIfAbsent(long key, LongFunction<V> provider) booleancontainsKey(long key) voidforEach(ConcurrentLongHashMap.EntryProcessor<V> processor) get(long key) booleanisEmpty()keys()static <V> ConcurrentLongHashMap.Builder<V>putIfAbsent(long key, V value) remove(long key) booleanlongsize()values()
-
Constructor Details
-
ConcurrentLongHashMap
Deprecated. -
ConcurrentLongHashMap
Deprecated. -
ConcurrentLongHashMap
Deprecated. -
ConcurrentLongHashMap
public ConcurrentLongHashMap(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
public boolean containsKey(long key) -
put
-
putIfAbsent
-
computeIfAbsent
-
remove
-
remove
-
clear
public void clear() -
forEach
-
keys
- Returns:
- a new list of all keys (makes a copy)
-
values
-