Package org.terracotta.offheapstore
Interface Segment<K,V>
-
- All Superinterfaces:
java.util.concurrent.ConcurrentMap<K,V>,HashingMap<K,V>,java.util.Map<K,V>,MapInternals,java.util.concurrent.locks.ReadWriteLock
- All Known Subinterfaces:
PinnableSegment<K,V>
- All Known Implementing Classes:
AbstractLockedOffHeapHashMap,AbstractOffHeapClockCache,AbstractPersistentLockedOffHeapHashMap,AbstractPersistentOffHeapCache,EvictionListeningReadWriteLockedOffHeapClockCache,EvictionListeningWriteLockedOffHeapClockCache,PersistentReadWriteLockedOffHeapClockCache,PersistentReadWriteLockedOffHeapHashMap,ReadWriteLockedOffHeapClockCache,ReadWriteLockedOffHeapHashMap,WriteLockedOffHeapClockCache,WriteLockedOffHeapHashMap
public interface Segment<K,V> extends java.util.concurrent.ConcurrentMap<K,V>, MapInternals, java.util.concurrent.locks.ReadWriteLock, HashingMap<K,V>
Implemented by maps that can be used as segments in a concurrent map.- See Also:
AbstractConcurrentOffHeapMap
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MetadataTuple<V>computeIfAbsentWithMetadata(K key, java.util.function.Function<? super K,? extends MetadataTuple<V>> mappingFunction)MetadataTuple<V>computeIfPresentWithMetadata(K key, java.util.function.BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)MetadataTuple<V>computeWithMetadata(K key, java.util.function.BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)voiddestroy()Vfill(K key, V value)SeeOffHeapHashMap.fill(Object, Object)for a detailed description.Vfill(K key, V value, int metadata)java.lang.IntegergetAndSetMetadata(K key, int mask, int values)java.util.concurrent.locks.ReentrantReadWriteLockgetLock()Return theReentrantReadWriteLockused by this segment.java.lang.IntegergetMetadata(K key, int mask)VgetValueAndSetMetadata(K key, int mask, int values)Vput(K key, V value, int metadata)booleanremoveNoReturn(java.lang.Object key)booleanshrink()-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from interface org.terracotta.offheapstore.HashingMap
removeAllWithHash
-
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
-
Methods inherited from interface org.terracotta.offheapstore.MapInternals
getAllocatedMemory, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSize, getTableCapacity, getUsedSlotCount, getVitalMemory
-
-
-
-
Method Detail
-
fill
V fill(K key, V value)
SeeOffHeapHashMap.fill(Object, Object)for a detailed description.- Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified key- Returns:
- the previous value associated with key, or null if there was no mapping for key (irrespective of whether the value was successfully installed).
-
getMetadata
java.lang.Integer getMetadata(K key, int mask)
-
getAndSetMetadata
java.lang.Integer getAndSetMetadata(K key, int mask, int values)
-
getLock
java.util.concurrent.locks.ReentrantReadWriteLock getLock() throws java.lang.UnsupportedOperationExceptionReturn theReentrantReadWriteLockused by this segment.- Returns:
- RRWL for this segment
- Throws:
java.lang.UnsupportedOperationException- if this segment does not use a RRWL
-
removeNoReturn
boolean removeNoReturn(java.lang.Object key)
-
destroy
void destroy()
-
shrink
boolean shrink()
-
computeWithMetadata
MetadataTuple<V> computeWithMetadata(K key, java.util.function.BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
-
computeIfAbsentWithMetadata
MetadataTuple<V> computeIfAbsentWithMetadata(K key, java.util.function.Function<? super K,? extends MetadataTuple<V>> mappingFunction)
-
computeIfPresentWithMetadata
MetadataTuple<V> computeIfPresentWithMetadata(K key, java.util.function.BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
-
-