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
-
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
FieldsModifier and TypeFieldDescriptionprotected final FixedSizeAllocatorprotected static final longprotected static final longprotected final intFields 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_OFFSETFields 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
ConstructorsModifierConstructorDescriptionprotectedSharedMemoryFixedMap(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
Modifier and TypeMethodDescriptionprotected longallocateEntry(K key, long hashCode, int size) protected voidprotected voidcreateAllocator(long startAddress, long totalMemory) protected voiddestroyEntry(long entry) protected static intgetEntrySize(int valueSize) longlonglongprotected voidprotected voidrelocate(long delta) protected intsizeOf(long entry) protected intprotected voidMethods inherited from class one.nio.mem.SharedMemoryMap
convert, entriesToClean, getCustomData, getHeader, headerSize, needCleanup, setCustomData, setHeader, setSerializer, setSerializer, setValueAt, valueAtMethods 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, touchMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.nio.mem.OffheapMapMXBean
getCapacity, getCleanupInterval, getCleanupThreshold, getCount, getExpirations, getLockWaitTime, getMaxSamples, getMinTimeToLive, getTimeToLive, setCleanupInterval, setCleanupThreshold, setLockWaitTime, setMaxSamples, setMinTimeToLive, setTimeToLive
-
Field Details
-
ALLOCATOR_SIZE_OFFSET
protected static final long ALLOCATOR_SIZE_OFFSET- See Also:
-
ALLOCATOR_HEAD_OFFSET
protected static final long ALLOCATOR_HEAD_OFFSET- See Also:
-
valueSize
protected final int valueSize -
allocator
-
-
Constructor Details
-
SharedMemoryFixedMap
- 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 Details
-
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
- 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
- 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>
-