public abstract class SharedMemoryMap<K,V> extends OffheapMap<K,V> implements SharedMemoryMapMXBean
OffheapMap.BasicCleanup, OffheapMap.Record<K,V>, OffheapMap.SamplingCleanup, OffheapMap.Visitor<K,V>, OffheapMap.WritableRecord<K,V>, OffheapMap.WritableVisitor<K,V>| Modifier and Type | Field and Description |
|---|---|
protected MallocMT |
allocator |
protected static long |
BASE_OFFSET |
protected static long |
CAPACITY_OFFSET |
protected String |
className |
protected static long |
CUSTOM_DATA_OFFSET |
protected static long |
CUSTOM_SIZE_OFFSET |
protected static long |
MAP_OFFSET |
protected static int |
MAX_CUSTOM_DATA_SIZE |
protected MappedFile |
mmap |
protected String |
name |
protected Serializer<V> |
serializer |
protected static long |
SIGNATURE_CLEAR |
protected static long |
SIGNATURE_DIRTY |
protected static long |
SIGNATURE_LEGACY |
protected static long |
SIGNATURE_OFFSET |
protected static long |
TIMESTAMP_OFFSET |
protected static long |
UID_OFFSET |
byteArrayOffset, capacity, cleanupInterval, cleanupThread, cleanupThreshold, CONCURRENCY_LEVEL, count, expirations, HASH_OFFSET, HEADER_SIZE, locks, lockWaitTime, log, mapBase, maxSamples, MB, minTimeToLive, NEXT_OFFSET, TIME_OFFSET, timeToLive, unsafe| Modifier | Constructor and Description |
|---|---|
protected |
SharedMemoryMap(int capacity,
String fileName,
long fileSize) |
protected |
SharedMemoryMap(int capacity,
String fileName,
long fileSize,
long expirationTime) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
allocateEntry(K key,
long hashCode,
int size) |
protected void |
closeInternal() |
protected void |
convert(Serializer<V> oldSerializer,
Serializer<V> newSerializer) |
protected void |
createAllocator(long startAddress,
long totalMemory) |
protected void |
destroyEntry(long entry) |
int |
entriesToClean() |
protected byte[] |
getCustomData() |
long |
getFreeMemory() |
protected long |
getHeader(long offset) |
long |
getTotalMemory() |
long |
getUsedMemory() |
protected int |
headerSize(long entry) |
protected void |
loadSchema() |
protected boolean |
needCleanup(long expirationTime) |
protected void |
relocate(long delta) |
protected void |
setCustomData(byte[] data) |
protected void |
setHeader(long offset,
long value) |
void |
setSerializer(Class<V> valueType) |
void |
setSerializer(Serializer<V> serializer) |
protected void |
setValueAt(long entry,
V value) |
protected int |
sizeOf(long entry) |
protected int |
sizeOf(V value) |
protected void |
storeSchema() |
protected V |
valueAt(long entry) |
bucketFor, clear, close, equalsAt, get, getCapacity, getCleanupInterval, getCleanupThreshold, getCount, getExpirations, getLockWaitTime, getMaxSamples, getMinTimeToLive, getTimeToLive, hashCode, isExpired, iterate, iterate, iterate, iterate, iterate, iterate, keyAt, lockFor, lockRecordForRead, lockRecordForRead, lockRecordForWrite, lockRecordForWrite, put, putIfAbsent, remove, removeExpired, setCleanupInterval, setCleanupThreshold, setLockWaitTime, setMaxSamples, setMinTimeToLive, setTimeAt, setTimeAt, setTimeToLive, shouldCleanup, timeAt, touchclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCapacity, getCleanupInterval, getCleanupThreshold, getCount, getExpirations, getLockWaitTime, getMaxSamples, getMinTimeToLive, getTimeToLive, setCleanupInterval, setCleanupThreshold, setLockWaitTime, setMaxSamples, setMinTimeToLive, setTimeToLiveprotected static final long SIGNATURE_CLEAR
protected static final long SIGNATURE_LEGACY
protected static final long SIGNATURE_DIRTY
protected static final long SIGNATURE_OFFSET
protected static final long TIMESTAMP_OFFSET
protected static final long CAPACITY_OFFSET
protected static final long BASE_OFFSET
protected static final long UID_OFFSET
protected static final long CUSTOM_SIZE_OFFSET
protected static final long CUSTOM_DATA_OFFSET
protected static final long MAP_OFFSET
protected static final int MAX_CUSTOM_DATA_SIZE
protected final String className
protected final MappedFile mmap
protected final String name
protected MallocMT allocator
protected Serializer<V> serializer
protected SharedMemoryMap(int capacity,
String fileName,
long fileSize)
throws IOException
IOExceptionprotected SharedMemoryMap(int capacity,
String fileName,
long fileSize,
long expirationTime)
throws IOException
IOExceptionprotected void closeInternal()
closeInternal in class OffheapMap<K,V>protected boolean needCleanup(long expirationTime)
protected void relocate(long delta)
protected long getHeader(long offset)
protected void setHeader(long offset,
long value)
protected byte[] getCustomData()
protected void setCustomData(byte[] data)
protected long allocateEntry(K key, long hashCode, int size)
allocateEntry in class OffheapMap<K,V>protected void destroyEntry(long entry)
destroyEntry in class OffheapMap<K,V>protected int sizeOf(long entry)
sizeOf in class OffheapMap<K,V>protected V valueAt(long entry)
valueAt in class OffheapMap<K,V>protected void setValueAt(long entry,
V value)
setValueAt in class OffheapMap<K,V>protected int sizeOf(V value)
sizeOf in class OffheapMap<K,V>protected int headerSize(long entry)
public long getTotalMemory()
getTotalMemory in interface SharedMemoryMapMXBeanpublic long getFreeMemory()
getFreeMemory in interface SharedMemoryMapMXBeanpublic long getUsedMemory()
getUsedMemory in interface SharedMemoryMapMXBeanpublic int entriesToClean()
entriesToClean in class OffheapMap<K,V>protected void createAllocator(long startAddress,
long totalMemory)
public void setSerializer(Class<V> valueType) throws IOException
IOExceptionpublic void setSerializer(Serializer<V> serializer) throws IOException
IOExceptionprotected void loadSchema()
throws IOException
IOExceptionprotected void storeSchema()
protected void convert(Serializer<V> oldSerializer, Serializer<V> newSerializer)
Copyright © 2019. All rights reserved.