Package org.elasticsearch.nativeaccess
Interface MappedSegment
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
JdkMappedSegment,PosixMappedSegment
A closeable segment backed by a mapped file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.voidprefetch(long offset, long length) Prefetches the given offset and length.segment()Returns the underlyingMemorySegmentbacking this mapped region.slice(long index, long length) Returns a slice of this segment.
-
Method Details
-
segment
MemorySegment segment()Returns the underlyingMemorySegmentbacking this mapped region. -
slice
Returns a slice of this segment. Closing a slice does not close its parent. -
prefetch
void prefetch(long offset, long length) Prefetches the given offset and length. -
madvise
void madvise(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.- Parameters:
offset- the starting offset within the bufferlength- the length of the region in bytesadvice- the access pattern advice; seeMadviseAdviceconstants
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-