Package org.terracotta.offheapstore
Class ReadWriteLockedOffHeapHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.terracotta.offheapstore.OffHeapHashMap<K,V>
-
- org.terracotta.offheapstore.AbstractLockedOffHeapHashMap<K,V>
-
- org.terracotta.offheapstore.ReadWriteLockedOffHeapHashMap<K,V>
-
- Type Parameters:
K- the type of keys maintained by this mapV- the type of mapped values
- All Implemented Interfaces:
java.util.concurrent.ConcurrentMap<K,V>,java.util.concurrent.locks.ReadWriteLock,java.util.Map<K,V>,HashingMap<K,V>,MapInternals,Segment<K,V>,StorageEngine.Owner
public class ReadWriteLockedOffHeapHashMap<K,V> extends AbstractLockedOffHeapHashMap<K,V>
A concurrent-read, exclusive-write off-heap hash-map.This map uses a regular
ReentrantReadWriteLockto provide read/write exclusion/sharing properties.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terracotta.offheapstore.AbstractLockedOffHeapHashMap
AbstractLockedOffHeapHashMap.LockedEntryIterator, AbstractLockedOffHeapHashMap.LockedEntrySet, AbstractLockedOffHeapHashMap.LockedKeyIterator, AbstractLockedOffHeapHashMap.LockedKeySet
-
Nested classes/interfaces inherited from class org.terracotta.offheapstore.OffHeapHashMap
OffHeapHashMap.DirectEntry, OffHeapHashMap.EncodingIterator, OffHeapHashMap.EncodingSet, OffHeapHashMap.EntryIterator, OffHeapHashMap.EntrySet, OffHeapHashMap.HashIterator<T>, OffHeapHashMap.KeyIterator, OffHeapHashMap.KeySet, OffHeapHashMap.PendingPage
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.locks.ReentrantReadWriteLocklock-
Fields inherited from class org.terracotta.offheapstore.OffHeapHashMap
ENCODING, ENTRY_BIT_SHIFT, ENTRY_SIZE, hashtable, hashTablePage, KEY_HASHCODE, modCount, removedSlots, reprobeLimit, RESERVED_STATUS_BITS, size, STATUS, STATUS_REMOVED, STATUS_USED, storageEngine, tableSource
-
-
Constructor Summary
Constructors Constructor Description ReadWriteLockedOffHeapHashMap(PageSource tableSource, boolean tableAllocationsSteal, StorageEngine<? super K,? super V> storageEngine)ReadWriteLockedOffHeapHashMap(PageSource tableSource, boolean tableAllocationsSteal, StorageEngine<? super K,? super V> storageEngine, int tableSize)ReadWriteLockedOffHeapHashMap(PageSource tableSource, StorageEngine<? super K,? super V> storageEngine)ReadWriteLockedOffHeapHashMap(PageSource tableSource, StorageEngine<? super K,? super V> storageEngine, int tableSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.locks.ReentrantReadWriteLockgetLock()Return theReentrantReadWriteLockused by this segment.java.util.concurrent.locks.LockreadLock()java.util.concurrent.locks.LockwriteLock()-
Methods inherited from class org.terracotta.offheapstore.AbstractLockedOffHeapHashMap
clear, computeIfAbsentWithMetadata, computeIfPresentWithMetadata, computeWithMetadata, containsKey, createEntrySet, createKeySet, destroy, evict, fill, fill, get, getAndSetMetadata, getEncodingForHashAndBinary, getMetadata, getValueAndSetMetadata, installMappingForHashAndEncoding, put, put, putIfAbsent, remove, remove, removeAllWithHash, removeMapping, removeNoReturn, replace, replace, shrink, size
-
Methods inherited from class org.terracotta.offheapstore.OffHeapHashMap
added, createEncodingSet, encodingSet, entrySet, fill, freePendingTables, getAllocatedMemory, getAtTableOffset, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getEntryAtTableOffset, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSize, getSlotForHashAndEncoding, getStorageEngine, getTableCapacity, getUsedSlotCount, getVitalMemory, hit, indexFor, indexFor, isAvailable, isPresent, isRemoved, isRemoved, isTerminating, isTerminating, isThiefForTableAllocations, keySet, readLong, readLong, removeAtTableOffset, removed, shrinkTable, spread, storageEngineFailure, tableExpansionFailure, tryIncreaseReprobe, updated, updateEncoding
-
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
Methods inherited from interface java.util.Map
containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, values
-
Methods inherited from interface org.terracotta.offheapstore.MapInternals
getAllocatedMemory, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSize, getTableCapacity, getUsedSlotCount, getVitalMemory
-
-
-
-
Constructor Detail
-
ReadWriteLockedOffHeapHashMap
public ReadWriteLockedOffHeapHashMap(PageSource tableSource, StorageEngine<? super K,? super V> storageEngine)
-
ReadWriteLockedOffHeapHashMap
public ReadWriteLockedOffHeapHashMap(PageSource tableSource, boolean tableAllocationsSteal, StorageEngine<? super K,? super V> storageEngine)
-
ReadWriteLockedOffHeapHashMap
public ReadWriteLockedOffHeapHashMap(PageSource tableSource, StorageEngine<? super K,? super V> storageEngine, int tableSize)
-
ReadWriteLockedOffHeapHashMap
public ReadWriteLockedOffHeapHashMap(PageSource tableSource, boolean tableAllocationsSteal, StorageEngine<? super K,? super V> storageEngine, int tableSize)
-
-
Method Detail
-
readLock
public java.util.concurrent.locks.Lock readLock()
- Specified by:
readLockin interfacejava.util.concurrent.locks.ReadWriteLock- Specified by:
readLockin classAbstractLockedOffHeapHashMap<K,V>
-
writeLock
public java.util.concurrent.locks.Lock writeLock()
- Specified by:
writeLockin interfacejava.util.concurrent.locks.ReadWriteLock- Specified by:
writeLockin classAbstractLockedOffHeapHashMap<K,V>
-
getLock
public java.util.concurrent.locks.ReentrantReadWriteLock getLock()
Description copied from interface:SegmentReturn theReentrantReadWriteLockused by this segment.- Returns:
- RRWL for this segment
-
-