public interface BaseState
| Modifier and Type | Field and Description |
|---|---|
static MemoryRequestServer |
defaultMemReqSvr
The placeholder for the default MemoryRequestServer, if set at all.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkValidAndBounds(long offsetBytes,
long lengthBytes)
Checks that the specified range of bytes is within bounds of this object, throws
IllegalArgumentException if it's not: i. |
boolean |
equals(Object that)
Returns true if the given object is an instance of this class and has equal data contents.
|
boolean |
equalTo(long thisOffsetBytes,
Object that,
long thatOffsetBytes,
long lengthBytes)
Returns true if the given object is an instance of this class and has equal contents to
this object in the given range of bytes.
|
ByteBuffer |
getByteBuffer()
Gets the backing ByteBuffer if it exists, otherwise returns null.
|
long |
getCapacity()
Gets the capacity of this object in bytes
|
long |
getCumulativeOffset()
Gets the cumulative offset in bytes of this object from the backing resource.
|
long |
getCumulativeOffset(long offsetBytes)
Gets the cumulative offset in bytes of this object from the backing resource including the given
offsetBytes.
|
static long |
getCurrentDirectMemoryAllocated()
Gets the current size of active direct memory allocated.
|
static long |
getCurrentDirectMemoryAllocations()
Gets the current number of active direct memory allocations.
|
static long |
getCurrentDirectMemoryMapAllocated()
Gets the current size of active direct memory map allocated.
|
static long |
getCurrentDirectMemoryMapAllocations()
Gets the current number of active direct memory map allocations.
|
long |
getRegionOffset()
Returns the offset of address zero of this object relative to the address zero of the
backing resource but not including the size of any Java object header.
|
long |
getRegionOffset(long offsetBytes)
Returns the offset of address zero of this object relative to the address zero of the
backing resource plus the given offsetBytes but not including the size of any Java object
header.
|
ByteOrder |
getTypeByteOrder()
Gets the current Type ByteOrder.
|
boolean |
hasArray()
Returns true if this object is backed by an on-heap primitive array
|
boolean |
hasByteBuffer()
Returns true if this Memory is backed by a ByteBuffer.
|
int |
hashCode()
Returns the hashCode of this object.
|
boolean |
isByteOrderCompatible(ByteOrder byteOrder)
Returns true if the Native ByteOrder is the same as the ByteOrder of the
current Buffer or Memory and the same ByteOrder as the given byteOrder.
|
boolean |
isDirect()
Returns true if the backing resource is direct (off-heap) memory.
|
boolean |
isReadOnly()
Returns true if this object or the backing resource is read-only.
|
boolean |
isSameResource(Object that)
Returns true if the backing resource of this is identical with the backing resource
of that.
|
boolean |
isValid()
Returns true if this object is valid and has not been closed.
|
String |
toHexString(String header,
long offsetBytes,
int lengthBytes)
Returns a formatted hex string of a range of this object.
|
long |
xxHash64(long in,
long seed)
Returns a 64-bit hash from a single long.
|
long |
xxHash64(long offsetBytes,
long lengthBytes,
long seed)
Returns the 64-bit hash of the sequence of bytes in this object specified by
offsetBytes, lengthBytes and a seed.
|
static final MemoryRequestServer defaultMemReqSvr
ByteOrder getTypeByteOrder()
boolean isByteOrderCompatible(ByteOrder byteOrder)
byteOrder - the given ByteOrderboolean equals(Object that)
boolean equalTo(long thisOffsetBytes,
Object that,
long thatOffsetBytes,
long lengthBytes)
thisOffsetBytes - the starting offset in bytes for this object.that - the given objectthatOffsetBytes - the starting offset in bytes for the given objectlengthBytes - the size of the range in bytesByteBuffer getByteBuffer()
long getCapacity()
long getCumulativeOffset()
long getCumulativeOffset(long offsetBytes)
offsetBytes - offset to be added to the cumulative offset.long getRegionOffset()
long getRegionOffset(long offsetBytes)
offsetBytes - the given offsetBytesboolean hasArray()
int hashCode()
The hash code of this object depends upon all of its contents. Because of this, it is inadvisable to use these objects as keys in hash maps or similar data structures unless it is known that their contents will not change.
If it is desirable to use these objects in a hash map depending only on object identity,
than the IdentityHashMap can be used.
long xxHash64(long offsetBytes,
long lengthBytes,
long seed)
offsetBytes - the given offset in bytes to the first byte of the byte sequence.lengthBytes - the given length in bytes of the byte sequence.seed - the given long seed.long xxHash64(long in,
long seed)
in - A long.seed - A long valued seed.boolean hasByteBuffer()
boolean isDirect()
boolean isReadOnly()
boolean isSameResource(Object that)
that - A different non-null objectboolean isValid()
void checkValidAndBounds(long offsetBytes,
long lengthBytes)
IllegalArgumentException if it's not: i. e. if offsetBytes < 0, or length < 0,
or offsetBytes + length > getCapacity().offsetBytes - the given offset in bytes of this objectlengthBytes - the given length in bytes of this objectstatic long getCurrentDirectMemoryAllocations()
static long getCurrentDirectMemoryAllocated()
static long getCurrentDirectMemoryMapAllocations()
static long getCurrentDirectMemoryMapAllocated()
String toHexString(String header, long offsetBytes, int lengthBytes)
header - a descriptive headeroffsetBytes - offset bytes relative to this object startlengthBytes - number of bytes to convert to a hex stringCopyright © 2015–2020 The Apache Software Foundation. All rights reserved.