org.terracotta.offheapstore
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.

Author:
Chris Dennis
See Also:
AbstractConcurrentOffHeapMap

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 MetadataTuple<V> computeIfAbsentWithMetadata(K key, Function<? super K,? extends MetadataTuple<V>> mappingFunction)
           
 MetadataTuple<V> computeIfPresentWithMetadata(K key, BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
           
 MetadataTuple<V> computeWithMetadata(K key, BiFunction<? super K,? super MetadataTuple<V>,? extends MetadataTuple<V>> remappingFunction)
           
 void destroy()
           
 V fill(K key, V value)
          See OffHeapHashMap.fill(Object, Object) for a detailed description.
 V fill(K key, V value, int metadata)
           
 Integer getAndSetMetadata(K key, int mask, int values)
           
 ReentrantReadWriteLock getLock()
          Return the ReentrantReadWriteLock used by this segment.
 Integer getMetadata(K key, int mask)
           
 V getValueAndSetMetadata(K key, int mask, int values)
           
 V put(K key, V value, int metadata)
           
 boolean removeNoReturn(Object key)
           
 boolean shrink()
           
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, remove, replace, replace
 
Methods inherited from interface org.terracotta.offheapstore.MapInternals
getAllocatedMemory, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSize, getTableCapacity, getUsedSlotCount, getVitalMemory
 
Methods inherited from interface java.util.concurrent.locks.ReadWriteLock
readLock, writeLock
 
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
 

Method Detail

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

ReentrantReadWriteLock getLock()
                               throws UnsupportedOperationException
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)


Copyright © 2016. All rights reserved.