Class JdkCloseableMappedByteBuffer
java.lang.Object
org.elasticsearch.nativeaccess.jdk.JdkCloseableMappedByteBuffer
- All Implemented Interfaces:
AutoCloseable,CloseableByteBuffer,CloseableMappedByteBuffer
- Direct Known Subclasses:
PosixCloseableMappedByteBuffer
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJdkCloseableMappedByteBuffer(MemorySegment seg, Arena arena) -
Method Summary
Modifier and TypeMethodDescriptionbuffer()voidclose()voidmadvise(long offset, long length, int advice) Advises the operating system about the expected access pattern for the specified memory region, allowing the kernel to optimize paging behavior.static JdkCloseableMappedByteBufferofShared(FileChannel fileChannel, FileChannel.MapMode mode, long position, long size) voidprefetch(long offset, long length) Prefetches the given offset and length.slice(long index, long length) Returns a slice of this buffer.
-
Field Details
-
segment
-
-
Constructor Details
-
JdkCloseableMappedByteBuffer
-
-
Method Details
-
buffer
- Specified by:
bufferin interfaceCloseableByteBuffer
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableByteBuffer
-
slice
Description copied from interface:CloseableMappedByteBufferReturns a slice of this buffer. Closing a slice does not close it's parent.- Specified by:
slicein interfaceCloseableMappedByteBuffer
-
prefetch
public void prefetch(long offset, long length) Description copied from interface:CloseableMappedByteBufferPrefetches the given offset and length.- Specified by:
prefetchin interfaceCloseableMappedByteBuffer
-
madvise
public void madvise(long offset, long length, int advice) Description copied from interface:CloseableMappedByteBufferAdvises the operating system about the expected access pattern for the specified memory region, allowing the kernel to optimize paging behavior.- Specified by:
madvisein interfaceCloseableMappedByteBuffer- Parameters:
offset- the starting offset within the bufferlength- the length of the region in bytesadvice- the access pattern advice; seeMadviseAdviceconstants