org.terracotta.offheapstore.concurrent
Class AbstractConcurrentOffHeapCache<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap<K,V>
          extended by org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapCache<K,V>
All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>, ConcurrentMapInternals, MapInternals, PinnableCache<K,V>
Direct Known Subclasses:
ConcurrentOffHeapClockCache, ConcurrentWriteLockedOffHeapClockCache

public abstract class AbstractConcurrentOffHeapCache<K,V>
extends AbstractConcurrentOffHeapMap<K,V>
implements PinnableCache<K,V>

Author:
cdennis

Nested Class Summary
 
Nested classes/interfaces inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
AbstractConcurrentOffHeapMap.AggregateIterator<T>
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
segments
 
Constructor Summary
AbstractConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory)
           
AbstractConcurrentOffHeapCache(Factory<? extends Segment<K,V>> segmentFactory, int concurrency)
           
 
Method Summary
 V fill(K key, V value)
          See OffHeapHashMap.fill(Object, Object) for a detailed description.
 V getAndPin(K key)
           
 boolean isPinned(Object key)
           
 boolean pin(K key)
           
 V putPinned(K key, V value)
           
protected  PinnableSegment<K,V> segmentFor(Object key)
           
 void setPinning(K key, boolean pinned)
           
 boolean shrink()
           
 boolean shrinkOthers(int excludedHash)
           
 boolean unpin(K key)
           
 
Methods inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap
clear, containsKey, containsValue, destroy, entrySet, fill, get, getAllocatedMemory, getConcurrency, getDataAllocatedMemory, getDataOccupiedMemory, getDataSize, getDataVitalMemory, getIndexFor, getOccupiedMemory, getRemovedSlotCount, getReprobeLength, getSegmentInternals, getSegments, getSize, getTableCapacity, getUsedSlotCount, getVitalMemory, handleOversizeMappingException, keySet, put, put, putIfAbsent, readLockAll, readUnlockAll, remove, remove, removeNoReturn, replace, replace, segmentFor, size, updateMetadata, 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
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, remove, replace, replace
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

AbstractConcurrentOffHeapCache

public AbstractConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory)

AbstractConcurrentOffHeapCache

public AbstractConcurrentOffHeapCache(Factory<? extends Segment<K,V>> segmentFactory,
                                      int concurrency)
Method Detail

fill

public V fill(K key,
              V value)
Description copied from class: AbstractConcurrentOffHeapMap
See OffHeapHashMap.fill(Object, Object) for a detailed description.

Overrides:
fill in class AbstractConcurrentOffHeapMap<K,V>
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).

getAndPin

public V getAndPin(K key)

putPinned

public V putPinned(K key,
                   V value)
Specified by:
putPinned in interface PinnableCache<K,V>

pin

public boolean pin(K key)

unpin

public boolean unpin(K key)

isPinned

public boolean isPinned(Object key)
Specified by:
isPinned in interface PinnableCache<K,V>

setPinning

public void setPinning(K key,
                       boolean pinned)
Specified by:
setPinning in interface PinnableCache<K,V>

segmentFor

protected PinnableSegment<K,V> segmentFor(Object key)
Overrides:
segmentFor in class AbstractConcurrentOffHeapMap<K,V>

shrink

public boolean shrink()

shrinkOthers

public boolean shrinkOthers(int excludedHash)


Copyright © 2015. All Rights Reserved.