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:
  • Method Details

    • fill

      V fill(K key, V value)
      See OffHeapHashMap.fill(Object, Object) for a detailed description.
      Parameters:
      key - key with which the specified value is to be associated
      value - 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

      V fill(K key, V value, int metadata)
    • put

      V put(K key, V value, int metadata)
    • getMetadata

      Integer getMetadata(K key, int mask)
    • getAndSetMetadata

      Integer getAndSetMetadata(K key, int mask, int values)
    • getValueAndSetMetadata

      V getValueAndSetMetadata(K key, int mask, int values)
    • getLock

      Return the ReentrantReadWriteLock used by this segment.
      Returns:
      RRWL for this segment
      Throws:
      UnsupportedOperationException - if this segment does not use a RRWL
    • removeNoReturn

      boolean removeNoReturn(Object key)
    • 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)