K - the type of keys maintained by this mapV - the type of mapped valuespublic abstract class AbstractConcurrentOffHeapMap<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V>, ConcurrentMapInternals, HashingMap<K,V>
This is an n-way hashcode striped map implementation. Subclasses must
provide a Factory instance at construction time from which
the required number of segments are created.
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractConcurrentOffHeapMap.AggregateIterator<T> |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
AbstractConcurrentOffHeapMap(Factory<? extends Segment<K,V>> segmentFactory)
Create a concurrent map using a default number of segments.
|
AbstractConcurrentOffHeapMap(Factory<? extends Segment<K,V>> segmentFactory,
int concurrency)
Create a concurrent map with a defined number of segments.
|
clone, equals, hashCode, isEmpty, putAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllpublic AbstractConcurrentOffHeapMap(Factory<? extends Segment<K,V>> segmentFactory)
segmentFactory - factory used to create the map segmentspublic AbstractConcurrentOffHeapMap(Factory<? extends Segment<K,V>> segmentFactory, int concurrency)
segmentFactory - factory used to create the map segmentsconcurrency - number of segments in the mapIllegalArgumentException - if the supplied number of segments is
negativepublic int getIndexFor(int hash)
protected int getConcurrency()
public int size()
public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in class AbstractMap<K,V>public V fill(K key, V value)
OffHeapHashMap.fill(Object, Object) for a detailed description.key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic boolean removeNoReturn(Object key)
public Integer getMetadata(K key, int mask) throws IllegalArgumentException
IllegalArgumentExceptionpublic Integer getAndSetMetadata(K key, int mask, int values) throws IllegalArgumentException
IllegalArgumentExceptionpublic void clear()
public void destroy()
public V putIfAbsent(K key, V value)
putIfAbsent in interface ConcurrentMap<K,V>putIfAbsent in interface Map<K,V>public Collection<V> values()
protected void readLockAll()
protected void readUnlockAll()
public final void writeLockAll()
public final void writeUnlockAll()
public List<MapInternals> getSegmentInternals()
getSegmentInternals in interface ConcurrentMapInternalspublic long getSize()
getSize in interface MapInternalspublic long getTableCapacity()
getTableCapacity in interface MapInternalspublic long getUsedSlotCount()
getUsedSlotCount in interface MapInternalspublic long getRemovedSlotCount()
getRemovedSlotCount in interface MapInternalspublic int getReprobeLength()
getReprobeLength in interface MapInternalspublic long getAllocatedMemory()
getAllocatedMemory in interface MapInternalspublic long getOccupiedMemory()
getOccupiedMemory in interface MapInternalspublic long getVitalMemory()
getVitalMemory in interface MapInternalspublic long getDataAllocatedMemory()
getDataAllocatedMemory in interface MapInternalspublic long getDataOccupiedMemory()
getDataOccupiedMemory in interface MapInternalspublic long getDataVitalMemory()
getDataVitalMemory in interface MapInternalspublic long getDataSize()
getDataSize in interface MapInternalspublic final boolean handleOversizeMappingException(int hash)
public MetadataTuple<V> computeWithMetadata(K key, BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
public MetadataTuple<V> computeIfAbsentWithMetadata(K key, Function<? super K,? extends MetadataTuple<V>> mappingFunction)
public MetadataTuple<V> computeIfPresentWithMetadata(K key, BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
public Map<K,V> removeAllWithHash(int keyHash)
HashingMapremoveAllWithHash in interface HashingMap<K,V>keyHash - the hashcode of the keys to be removed.Map containing the removed mappings.Copyright © 2015–2024. All rights reserved.