Package one.nio.mem
Class SharedMemoryFixedMap<K,V>
- java.lang.Object
-
- one.nio.mem.OffheapMap<K,V>
-
- one.nio.mem.SharedMemoryMap<K,V>
-
- one.nio.mem.SharedMemoryFixedMap<K,V>
-
- All Implemented Interfaces:
OffheapMapMXBean,SharedMemoryMapMXBean
public abstract class SharedMemoryFixedMap<K,V> extends SharedMemoryMap<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class one.nio.mem.OffheapMap
OffheapMap.BasicCleanup, OffheapMap.Record<K,V>, OffheapMap.SamplingCleanup, OffheapMap.Visitor<K,V>, OffheapMap.WritableRecord<K,V>, OffheapMap.WritableVisitor<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected FixedSizeAllocatorallocatorprotected static longALLOCATOR_HEAD_OFFSETprotected static longALLOCATOR_SIZE_OFFSETprotected intvalueSize-
Fields inherited from class one.nio.mem.SharedMemoryMap
BASE_OFFSET, CAPACITY_OFFSET, className, CUSTOM_DATA_OFFSET, CUSTOM_SIZE_OFFSET, MAP_OFFSET, MAX_CUSTOM_DATA_SIZE, mmap, name, serializer, SIGNATURE_CLEAR, SIGNATURE_DIRTY, SIGNATURE_LEGACY, SIGNATURE_OFFSET, TIMESTAMP_OFFSET, UID_OFFSET
-
Fields inherited from class one.nio.mem.OffheapMap
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSharedMemoryFixedMap(int capacity, String fileName, long fileSize, int valueSize, long expirationTime)protectedSharedMemoryFixedMap(String fileName, long fileSize, int valueSize)protectedSharedMemoryFixedMap(String fileName, long fileSize, int valueSize, long expirationTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longallocateEntry(K key, long hashCode, int size)protected voidcloseInternal()protected voidcreateAllocator(long startAddress, long totalMemory)protected voiddestroyEntry(long entry)protected static intgetEntrySize(int valueSize)longgetFreeMemory()longgetTotalMemory()longgetUsedMemory()protected voidloadSchema()protected voidrelocate(long delta)protected intsizeOf(long entry)protected intsizeOf(V value)protected voidstoreSchema()-
Methods inherited from class one.nio.mem.SharedMemoryMap
convert, entriesToClean, getCustomData, getHeader, headerSize, needCleanup, setCustomData, setHeader, setSerializer, setSerializer, setValueAt, valueAt
-
Methods inherited from class one.nio.mem.OffheapMap
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, reuseEntry, setCleanupInterval, setCleanupThreshold, setLockWaitTime, setMaxSamples, setMinTimeToLive, setTimeAt, setTimeAt, setTimeToLive, shouldCleanup, timeAt, touch
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface one.nio.mem.OffheapMapMXBean
getCapacity, getCleanupInterval, getCleanupThreshold, getCount, getExpirations, getLockWaitTime, getMaxSamples, getMinTimeToLive, getTimeToLive, setCleanupInterval, setCleanupThreshold, setLockWaitTime, setMaxSamples, setMinTimeToLive, setTimeToLive
-
-
-
-
Field Detail
-
ALLOCATOR_SIZE_OFFSET
protected static final long ALLOCATOR_SIZE_OFFSET
- See Also:
- Constant Field Values
-
ALLOCATOR_HEAD_OFFSET
protected static final long ALLOCATOR_HEAD_OFFSET
- See Also:
- Constant Field Values
-
valueSize
protected final int valueSize
-
allocator
protected final FixedSizeAllocator allocator
-
-
Constructor Detail
-
SharedMemoryFixedMap
protected SharedMemoryFixedMap(String fileName, long fileSize, int valueSize) throws IOException
- Throws:
IOException
-
SharedMemoryFixedMap
protected SharedMemoryFixedMap(String fileName, long fileSize, int valueSize, long expirationTime) throws IOException
- Throws:
IOException
-
SharedMemoryFixedMap
protected SharedMemoryFixedMap(int capacity, String fileName, long fileSize, int valueSize, long expirationTime) throws IOException- Throws:
IOException
-
-
Method Detail
-
getEntrySize
protected static int getEntrySize(int valueSize)
-
closeInternal
protected void closeInternal()
- Overrides:
closeInternalin classSharedMemoryMap<K,V>
-
createAllocator
protected void createAllocator(long startAddress, long totalMemory)- Overrides:
createAllocatorin classSharedMemoryMap<K,V>
-
loadSchema
protected void loadSchema()
- Overrides:
loadSchemain classSharedMemoryMap<K,V>
-
storeSchema
protected void storeSchema()
- Overrides:
storeSchemain classSharedMemoryMap<K,V>
-
relocate
protected void relocate(long delta)
- Overrides:
relocatein classSharedMemoryMap<K,V>
-
allocateEntry
protected long allocateEntry(K key, long hashCode, int size)
- Overrides:
allocateEntryin classSharedMemoryMap<K,V>
-
destroyEntry
protected void destroyEntry(long entry)
- Overrides:
destroyEntryin classSharedMemoryMap<K,V>
-
sizeOf
protected int sizeOf(long entry)
- Overrides:
sizeOfin classSharedMemoryMap<K,V>
-
sizeOf
protected int sizeOf(V value)
- Overrides:
sizeOfin classSharedMemoryMap<K,V>
-
getTotalMemory
public long getTotalMemory()
- Specified by:
getTotalMemoryin interfaceSharedMemoryMapMXBean- Overrides:
getTotalMemoryin classSharedMemoryMap<K,V>
-
getFreeMemory
public long getFreeMemory()
- Specified by:
getFreeMemoryin interfaceSharedMemoryMapMXBean- Overrides:
getFreeMemoryin classSharedMemoryMap<K,V>
-
getUsedMemory
public long getUsedMemory()
- Specified by:
getUsedMemoryin interfaceSharedMemoryMapMXBean- Overrides:
getUsedMemoryin classSharedMemoryMap<K,V>
-
-