Interface Segment<K,V>
- All Superinterfaces:
ConcurrentMap<K,V>, HashingMap<K, V>, Map<K, V>, MapInternals, 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 ConcurrentMap<K,V>, MapInternals, ReadWriteLock, HashingMap<K,V>
Implemented by maps that can be used as segments in a concurrent map.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeIfAbsentWithMetadata(K key, Function<? super K, ? extends MetadataTuple<V>> mappingFunction) computeIfPresentWithMetadata(K key, BiFunction<? super K, ? super MetadataTuple<V>, ? extends MetadataTuple<V>> remappingFunction) computeWithMetadata(K key, BiFunction<? super K, ? super MetadataTuple<V>, ? extends MetadataTuple<V>> remappingFunction) voiddestroy()SeeOffHeapHashMap.fill(Object, Object)for a detailed description.getAndSetMetadata(K key, int mask, int values) getLock()Return theReentrantReadWriteLockused by this segment.getMetadata(K key, int mask) getValueAndSetMetadata(K key, int mask, int values) booleanremoveNoReturn(Object key) booleanshrink()Methods inherited from interface ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface HashingMap
removeAllWithHashMethods inherited from interface Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, valuesMethods inherited from interface MapInternals
getAllocatedMemory, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSize, getTableCapacity, getUsedSlotCount, getVitalMemoryMethods inherited from interface ReadWriteLock
readLock, writeLock
-
Method Details
-
fill
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).
-
fill
-
put
-
getMetadata
-
getAndSetMetadata
-
getValueAndSetMetadata
-
getLock
Return theReentrantReadWriteLockused by this segment.- Returns:
- RRWL for this segment
- Throws:
UnsupportedOperationException- if this segment does not use a RRWL
-
removeNoReturn
-
destroy
void destroy() -
shrink
boolean shrink() -
computeWithMetadata
MetadataTuple<V> computeWithMetadata(K key, BiFunction<? super K, ? super MetadataTuple<V>, ? extends MetadataTuple<V>> remappingFunction) -
computeIfAbsentWithMetadata
MetadataTuple<V> computeIfAbsentWithMetadata(K key, Function<? super K, ? extends MetadataTuple<V>> mappingFunction) -
computeIfPresentWithMetadata
MetadataTuple<V> computeIfPresentWithMetadata(K key, BiFunction<? super K, ? super MetadataTuple<V>, ? extends MetadataTuple<V>> remappingFunction)
-