Package one.microstream.memory.sun
Class JdkMemoryAccessor
java.lang.Object
one.microstream.memory.sun.JdkMemoryAccessor
- All Implemented Interfaces:
- MemoryAccessor,- MemorySizeProperties
public final class JdkMemoryAccessor extends Object implements MemoryAccessor, MemorySizeProperties
- 
Nested Class SummaryNested classes/interfaces inherited from interface one.microstream.memory.MemorySizePropertiesMemorySizeProperties.Unsupported
- 
Constructor SummaryConstructors Constructor Description JdkMemoryAccessor()
- 
Method SummaryModifier and Type Method Description longallocateMemory(long bytes)byte[]asByteArray(long value)byte[]asByteArray(long[] values)longbyteSizeArray_boolean(long elementCount)longbyteSizeArray_byte(long elementCount)longbyteSizeArray_char(long elementCount)longbyteSizeArray_double(long elementCount)longbyteSizeArray_float(long elementCount)longbyteSizeArray_int(long elementCount)longbyteSizeArray_long(long elementCount)longbyteSizeArray_short(long elementCount)longbyteSizeArrayObject(long elementCount)intbyteSizeFieldValue(Class<?> type)intbyteSizeInstance(Class<?> type)intbyteSizeObjectHeader(Class<?> type)intbyteSizeReference()voidcopyArrayToAddress(boolean[] array, long targetAddress)voidcopyArrayToAddress(byte[] array, long targetAddress)voidcopyArrayToAddress(char[] array, long targetAddress)voidcopyArrayToAddress(double[] array, long targetAddress)voidcopyArrayToAddress(float[] array, long targetAddress)voidcopyArrayToAddress(int[] array, long targetAddress)voidcopyArrayToAddress(long[] array, long targetAddress)voidcopyArrayToAddress(short[] array, long targetAddress)voidcopyRange(long sourceAddress, long targetAddress, long length)voidcopyRangeToArray(long sourceAddress, boolean[] target)voidcopyRangeToArray(long sourceAddress, byte[] target)voidcopyRangeToArray(long sourceAddress, char[] target)voidcopyRangeToArray(long sourceAddress, double[] target)voidcopyRangeToArray(long sourceAddress, float[] target)voidcopyRangeToArray(long sourceAddress, int[] target)voidcopyRangeToArray(long sourceAddress, long[] target)voidcopyRangeToArray(long sourceAddress, short[] target)MemoryStatisticscreateHeapMemoryStatistics()MemoryStatisticscreateNonHeapMemoryStatistics()booleandeallocateDirectByteBuffer(ByteBuffer directBuffer)voidensureClassInitialized(Class<?> c)voidensureClassInitialized(Class<?> c, Iterable<Field> usedFields)Uses the passed fields if required by the implementation.voidfillMemory(long address, long length, byte value)voidfreeMemory(long address)booleanget_boolean(long address)booleanget_boolean(Object instance, long offset)byteget_byte(long address)byteget_byte(Object instance, long offset)charget_char(long address)charget_char(Object instance, long offset)doubleget_double(long address)doubleget_double(Object instance, long offset)floatget_float(long address)floatget_float(Object instance, long offset)intget_int(long address)intget_int(Object instance, long offset)longget_long(long address)longget_long(Object instance, long offset)shortget_short(long address)shortget_short(Object instance, long offset)longgetDirectByteBufferAddress(ByteBuffer directBuffer)ObjectgetObject(Object instance, long offset)ByteBufferguaranteeDirectByteBuffer(ByteBuffer directBuffer)voidguaranteeUsability()Guarantees the full usability of this class by validating if all functionality is usable.<T> TinstantiateBlank(Class<T> c)booleanisDirectByteBuffer(ByteBuffer byteBuffer)static JdkMemoryAccessorNew()longobjectFieldOffset(Class<?> objectClass, Field field)Similar toMemoryAccessor.objectFieldOffset(Field), but with the specific object class.
 The difference is that the actual object's class is not the declaring class of its fields if it only extends another class but does not declare an object field itself.longobjectFieldOffset(Field field)Returns an unspecified, abstract "offset" of the passedFieldto specify a generic access of the field's value for an instance of its declaring class that can be used with object-based methods likeMemoryAccessor.set_int(Object,long,int).long[]objectFieldOffsets(Class<?> objectClass, Field... fields)Array alias vor #objectFieldOffset(Class, Field).long[]objectFieldOffsets(Field... fields)Array alias vor #objectFieldOffset(Field).intpageSize()Returns the system's memory "page size" (whatever that may be exactely for a given system).longreallocateMemory(long address, long bytes)voidset_boolean(long address, boolean value)voidset_boolean(Object instance, long offset, boolean value)voidset_booleanInBytes(byte[] bytes, int index, boolean value)voidset_byte(long address, byte value)voidset_byte(Object instance, long offset, byte value)voidset_byteInBytes(byte[] bytes, int index, byte value)voidset_char(long address, char value)voidset_char(Object instance, long offset, char value)voidset_charInBytes(byte[] bytes, int index, char value)voidset_double(long address, double value)voidset_double(Object instance, long offset, double value)voidset_doubleInBytes(byte[] bytes, int index, double value)voidset_float(long address, float value)voidset_float(Object instance, long offset, float value)voidset_floatInBytes(byte[] bytes, int index, float value)voidset_int(long address, int value)voidset_int(Object instance, long offset, int value)voidset_intInBytes(byte[] bytes, int index, int value)voidset_long(long address, long value)voidset_long(Object instance, long offset, long value)voidset_longInBytes(byte[] bytes, int index, long value)voidset_short(long address, short value)voidset_short(Object instance, long offset, short value)voidset_shortInBytes(byte[] bytes, int index, short value)voidsetObject(Object instance, long offset, Object value)Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.microstream.memory.MemoryAccessorisReversing, objectFieldOffsets, objectFieldOffsets, toReversing
- 
Constructor Details- 
JdkMemoryAccessorpublic JdkMemoryAccessor()
 
- 
- 
Method Details- 
New
- 
guaranteeUsabilitypublic final void guaranteeUsability()Description copied from interface:MemoryAccessorGuarantees the full usability of this class by validating if all functionality is usable.- Specified by:
- guaranteeUsabilityin interface- MemoryAccessor
 
- 
getDirectByteBufferAddress- Specified by:
- getDirectByteBufferAddressin interface- MemoryAccessor
 
- 
deallocateDirectByteBuffer- Specified by:
- deallocateDirectByteBufferin interface- MemoryAccessor
 
- 
isDirectByteBuffer- Specified by:
- isDirectByteBufferin interface- MemoryAccessor
 
- 
guaranteeDirectByteBuffer- Specified by:
- guaranteeDirectByteBufferin interface- MemoryAccessor
 
- 
allocateMemorypublic final long allocateMemory(long bytes)- Specified by:
- allocateMemoryin interface- MemoryAccessor
 
- 
reallocateMemorypublic final long reallocateMemory(long address, long bytes)- Specified by:
- reallocateMemoryin interface- MemoryAccessor
 
- 
freeMemorypublic final void freeMemory(long address)- Specified by:
- freeMemoryin interface- MemoryAccessor
 
- 
fillMemorypublic final void fillMemory(long address, long length, byte value)- Specified by:
- fillMemoryin interface- MemoryAccessor
 
- 
get_bytepublic final byte get_byte(long address)- Specified by:
- get_bytein interface- MemoryAccessor
 
- 
get_booleanpublic final boolean get_boolean(long address)- Specified by:
- get_booleanin interface- MemoryAccessor
 
- 
get_shortpublic final short get_short(long address)- Specified by:
- get_shortin interface- MemoryAccessor
 
- 
get_charpublic final char get_char(long address)- Specified by:
- get_charin interface- MemoryAccessor
 
- 
get_intpublic final int get_int(long address)- Specified by:
- get_intin interface- MemoryAccessor
 
- 
get_floatpublic final float get_float(long address)- Specified by:
- get_floatin interface- MemoryAccessor
 
- 
get_longpublic final long get_long(long address)- Specified by:
- get_longin interface- MemoryAccessor
 
- 
get_doublepublic final double get_double(long address)- Specified by:
- get_doublein interface- MemoryAccessor
 
- 
get_byte- Specified by:
- get_bytein interface- MemoryAccessor
 
- 
get_boolean- Specified by:
- get_booleanin interface- MemoryAccessor
 
- 
get_short- Specified by:
- get_shortin interface- MemoryAccessor
 
- 
get_char- Specified by:
- get_charin interface- MemoryAccessor
 
- 
get_int- Specified by:
- get_intin interface- MemoryAccessor
 
- 
get_float- Specified by:
- get_floatin interface- MemoryAccessor
 
- 
get_long- Specified by:
- get_longin interface- MemoryAccessor
 
- 
get_double- Specified by:
- get_doublein interface- MemoryAccessor
 
- 
getObject- Specified by:
- getObjectin interface- MemoryAccessor
 
- 
set_bytepublic final void set_byte(long address, byte value)- Specified by:
- set_bytein interface- MemoryAccessor
 
- 
set_booleanpublic final void set_boolean(long address, boolean value)- Specified by:
- set_booleanin interface- MemoryAccessor
 
- 
set_shortpublic void set_short(long address, short value)- Specified by:
- set_shortin interface- MemoryAccessor
 
- 
set_charpublic final void set_char(long address, char value)- Specified by:
- set_charin interface- MemoryAccessor
 
- 
set_intpublic final void set_int(long address, int value)- Specified by:
- set_intin interface- MemoryAccessor
 
- 
set_floatpublic final void set_float(long address, float value)- Specified by:
- set_floatin interface- MemoryAccessor
 
- 
set_longpublic final void set_long(long address, long value)- Specified by:
- set_longin interface- MemoryAccessor
 
- 
set_doublepublic final void set_double(long address, double value)- Specified by:
- set_doublein interface- MemoryAccessor
 
- 
set_byte- Specified by:
- set_bytein interface- MemoryAccessor
 
- 
set_boolean- Specified by:
- set_booleanin interface- MemoryAccessor
 
- 
set_short- Specified by:
- set_shortin interface- MemoryAccessor
 
- 
set_char- Specified by:
- set_charin interface- MemoryAccessor
 
- 
set_int- Specified by:
- set_intin interface- MemoryAccessor
 
- 
set_float- Specified by:
- set_floatin interface- MemoryAccessor
 
- 
set_long- Specified by:
- set_longin interface- MemoryAccessor
 
- 
set_double- Specified by:
- set_doublein interface- MemoryAccessor
 
- 
setObject- Specified by:
- setObjectin interface- MemoryAccessor
 
- 
set_byteInBytespublic final void set_byteInBytes(byte[] bytes, int index, byte value)- Specified by:
- set_byteInBytesin interface- MemoryAccessor
 
- 
set_booleanInBytespublic final void set_booleanInBytes(byte[] bytes, int index, boolean value)- Specified by:
- set_booleanInBytesin interface- MemoryAccessor
 
- 
set_shortInBytespublic final void set_shortInBytes(byte[] bytes, int index, short value)- Specified by:
- set_shortInBytesin interface- MemoryAccessor
 
- 
set_charInBytespublic final void set_charInBytes(byte[] bytes, int index, char value)- Specified by:
- set_charInBytesin interface- MemoryAccessor
 
- 
set_intInBytespublic final void set_intInBytes(byte[] bytes, int index, int value)- Specified by:
- set_intInBytesin interface- MemoryAccessor
 
- 
set_floatInBytespublic final void set_floatInBytes(byte[] bytes, int index, float value)- Specified by:
- set_floatInBytesin interface- MemoryAccessor
 
- 
set_longInBytespublic final void set_longInBytes(byte[] bytes, int index, long value)- Specified by:
- set_longInBytesin interface- MemoryAccessor
 
- 
set_doubleInBytespublic final void set_doubleInBytes(byte[] bytes, int index, double value)- Specified by:
- set_doubleInBytesin interface- MemoryAccessor
 
- 
copyRangepublic final void copyRange(long sourceAddress, long targetAddress, long length)- Specified by:
- copyRangein interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, byte[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, boolean[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, short[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, char[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, int[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, float[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, long[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyRangeToArraypublic final void copyRangeToArray(long sourceAddress, double[] target)- Specified by:
- copyRangeToArrayin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(byte[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(boolean[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(short[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(char[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(int[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(float[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(long[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
copyArrayToAddresspublic final void copyArrayToAddress(double[] array, long targetAddress)- Specified by:
- copyArrayToAddressin interface- MemoryAccessor
 
- 
asByteArraypublic final byte[] asByteArray(long[] values)- Specified by:
- asByteArrayin interface- MemoryAccessor
 
- 
asByteArraypublic final byte[] asByteArray(long value)- Specified by:
- asByteArrayin interface- MemoryAccessor
 
- 
objectFieldOffsetDescription copied from interface:MemoryAccessorReturns an unspecified, abstract "offset" of the passedFieldto specify a generic access of the field's value for an instance of its declaring class that can be used with object-based methods likeMemoryAccessor.set_int(Object,long,int). Whether that offset is an actual low-level memory offset relative to an instance' field offset base or simply an index of the passed field in its declaring class' list of fields, is implementation-specific.- Specified by:
- objectFieldOffsetin interface- MemoryAccessor
- Parameters:
- field- the- Fieldwhose abstract offset shall be determined.
- Returns:
- the passed Field's abstract offset.
 
- 
objectFieldOffsetsDescription copied from interface:MemoryAccessorArray alias vor #objectFieldOffset(Field).- Specified by:
- objectFieldOffsetsin interface- MemoryAccessor
 
- 
objectFieldOffsetDescription copied from interface:MemoryAccessorSimilar toMemoryAccessor.objectFieldOffset(Field), but with the specific object class.
 The difference is that the actual object's class is not the declaring class of its fields if it only extends another class but does not declare an object field itself.- Specified by:
- objectFieldOffsetin interface- MemoryAccessor
- Returns:
 
- 
objectFieldOffsetsDescription copied from interface:MemoryAccessorArray alias vor #objectFieldOffset(Class, Field).- Specified by:
- objectFieldOffsetsin interface- MemoryAccessor
 
- 
ensureClassInitialized- Specified by:
- ensureClassInitializedin interface- MemoryAccessor
 
- 
ensureClassInitializedDescription copied from interface:MemoryAccessorUses the passed fields if required by the implementation. If not, this method behaves exactely likeMemoryAccessor.ensureClassInitialized(Class).- Specified by:
- ensureClassInitializedin interface- MemoryAccessor
 
- 
instantiateBlank- Specified by:
- instantiateBlankin interface- MemoryAccessor
- Throws:
- InstantiationRuntimeException
 
- 
pageSizepublic final int pageSize()Description copied from interface:MemorySizePropertiesReturns the system's memory "page size" (whatever that may be exactely for a given system). Use with care (and the dependency to a system value in mind!).- Specified by:
- pageSizein interface- MemorySizeProperties
- Returns:
- the system's memory "page size".
 
- 
byteSizeReferencepublic final int byteSizeReference()- Specified by:
- byteSizeReferencein interface- MemorySizeProperties
 
- 
byteSizeInstance- Specified by:
- byteSizeInstancein interface- MemorySizeProperties
 
- 
byteSizeObjectHeader- Specified by:
- byteSizeObjectHeaderin interface- MemorySizeProperties
 
- 
byteSizeFieldValue- Specified by:
- byteSizeFieldValuein interface- MemorySizeProperties
 
- 
byteSizeArray_bytepublic final long byteSizeArray_byte(long elementCount)- Specified by:
- byteSizeArray_bytein interface- MemorySizeProperties
 
- 
byteSizeArray_booleanpublic final long byteSizeArray_boolean(long elementCount)- Specified by:
- byteSizeArray_booleanin interface- MemorySizeProperties
 
- 
byteSizeArray_shortpublic final long byteSizeArray_short(long elementCount)- Specified by:
- byteSizeArray_shortin interface- MemorySizeProperties
 
- 
byteSizeArray_charpublic final long byteSizeArray_char(long elementCount)- Specified by:
- byteSizeArray_charin interface- MemorySizeProperties
 
- 
byteSizeArray_intpublic final long byteSizeArray_int(long elementCount)- Specified by:
- byteSizeArray_intin interface- MemorySizeProperties
 
- 
byteSizeArray_floatpublic final long byteSizeArray_float(long elementCount)- Specified by:
- byteSizeArray_floatin interface- MemorySizeProperties
 
- 
byteSizeArray_longpublic final long byteSizeArray_long(long elementCount)- Specified by:
- byteSizeArray_longin interface- MemorySizeProperties
 
- 
byteSizeArray_doublepublic final long byteSizeArray_double(long elementCount)- Specified by:
- byteSizeArray_doublein interface- MemorySizeProperties
 
- 
byteSizeArrayObjectpublic final long byteSizeArrayObject(long elementCount)- Specified by:
- byteSizeArrayObjectin interface- MemorySizeProperties
 
- 
createHeapMemoryStatistics- Specified by:
- createHeapMemoryStatisticsin interface- MemoryAccessor
 
- 
createNonHeapMemoryStatistics- Specified by:
- createNonHeapMemoryStatisticsin interface- MemoryAccessor
 
 
-