org.terracotta.offheapstore.disk.persistent
Class AbstractPersistentConcurrentOffHeapCache<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>
              extended by org.terracotta.offheapstore.disk.persistent.AbstractPersistentConcurrentOffHeapCache<K,V>
All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>, ConcurrentMapInternals, Persistent, HashingMap<K,V>, MapInternals, PinnableCache<K,V>
Direct Known Subclasses:
PersistentConcurrentOffHeapClockCache

public class AbstractPersistentConcurrentOffHeapCache<K,V>
extends AbstractConcurrentOffHeapCache<K,V>
implements Persistent

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
AbstractPersistentConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory)
          Create a concurrent map using a default number of segments.
AbstractPersistentConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory, int concurrency)
          Create a concurrent map with a defined number of segments.
 
Method Summary
 void bootstrap(ObjectInput input)
           
 void close()
           
 void flush()
           
 void persist(ObjectOutput output)
           
protected static int readSegmentCount(ObjectInput input)
           
 
Methods inherited from class org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapCache
fill, getAndPin, isPinned, putPinned, segmentFor, setPinning, shrink, shrinkOthers
 
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
 
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

AbstractPersistentConcurrentOffHeapCache

public AbstractPersistentConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory)
Create a concurrent map using a default number of segments.

Parameters:
segmentFactory - factory used to create the map segments

AbstractPersistentConcurrentOffHeapCache

public AbstractPersistentConcurrentOffHeapCache(Factory<? extends PinnableSegment<K,V>> segmentFactory,
                                                int concurrency)
Create a concurrent map with a defined number of segments.

Parameters:
segmentFactory - factory used to create the map segments
concurrency - number of segments in the map
Throws:
IllegalArgumentException - if the supplied number of segments is negative
Method Detail

flush

public void flush()
           throws IOException
Specified by:
flush in interface Persistent
Throws:
IOException

persist

public void persist(ObjectOutput output)
             throws IOException
Specified by:
persist in interface Persistent
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Persistent
Throws:
IOException

bootstrap

public void bootstrap(ObjectInput input)
               throws IOException
Specified by:
bootstrap in interface Persistent
Throws:
IOException

readSegmentCount

protected static int readSegmentCount(ObjectInput input)
                               throws IOException
Throws:
IOException


Copyright © 2016. All rights reserved.