Class AbstractConcurrentOffHeapCache<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap<K,V>
-
- org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapCache<K,V>
-
- All Implemented Interfaces:
java.util.concurrent.ConcurrentMap<K,V>,java.util.Map<K,V>,ConcurrentMapInternals,HashingMap<K,V>,MapInternals,PinnableCache<K,V>
- Direct Known Subclasses:
AbstractPersistentConcurrentOffHeapCache,ConcurrentOffHeapClockCache,ConcurrentWriteLockedOffHeapClockCache
public abstract class AbstractConcurrentOffHeapCache<K,V> extends AbstractConcurrentOffHeapMap<K,V> implements PinnableCache<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
AbstractConcurrentOffHeapMap.AggregatedValuesCollection, AbstractConcurrentOffHeapMap.AggregateEntrySet, AbstractConcurrentOffHeapMap.AggregateIterator<T>, AbstractConcurrentOffHeapMap.AggregateKeySet
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Comparator<Segment<?,?>>SIZE_COMPARATOR-
Fields inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
segments
-
-
Constructor Summary
Constructors Constructor Description AbstractConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory)AbstractConcurrentOffHeapCache(Factory<? extends Segment<K,V>> segmentFactory, int concurrency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vfill(K key, V value)SeeOffHeapHashMap.fill(Object, Object)for a detailed description.VgetAndPin(K key)booleanisPinned(java.lang.Object key)VputPinned(K key, V value)protected PinnableSegment<K,V>segmentFor(java.lang.Object key)voidsetPinning(K key, boolean pinned)booleanshrink()booleanshrinkOthers(int excludedHash)-
Methods inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
clear, computeIfAbsentWithMetadata, computeIfPresentWithMetadata, computeWithMetadata, containsKey, containsValue, destroy, entrySet, fill, get, getAllocatedMemory, getAndSetMetadata, getConcurrency, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getIndexFor, getMetadata, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSegmentInternals, getSegments, getSize, getTableCapacity, getUsedSlotCount, getValueAndSetMetadata, getVitalMemory, handleOversizeMappingException, keySet, put, put, putIfAbsent, readLockAll, readUnlockAll, remove, remove, removeAllWithHash, removeNoReturn, replace, replace, segmentFor, size, values, writeLockAll, writeUnlockAll
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
SIZE_COMPARATOR
private static final java.util.Comparator<Segment<?,?>> SIZE_COMPARATOR
-
-
Method Detail
-
fill
public V fill(K key, V value)
Description copied from class:AbstractConcurrentOffHeapMapSeeOffHeapHashMap.fill(Object, Object)for a detailed description.- Overrides:
fillin classAbstractConcurrentOffHeapMap<K,V>- 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).
-
putPinned
public V putPinned(K key, V value)
- Specified by:
putPinnedin interfacePinnableCache<K,V>
-
isPinned
public boolean isPinned(java.lang.Object key)
- Specified by:
isPinnedin interfacePinnableCache<K,V>
-
setPinning
public void setPinning(K key, boolean pinned)
- Specified by:
setPinningin interfacePinnableCache<K,V>
-
segmentFor
protected PinnableSegment<K,V> segmentFor(java.lang.Object key)
- Overrides:
segmentForin classAbstractConcurrentOffHeapMap<K,V>
-
shrink
public boolean shrink()
-
shrinkOthers
public boolean shrinkOthers(int excludedHash)
-
-