Class JdkMappedSegment
java.lang.Object
org.elasticsearch.nativeaccess.jdk.JdkMappedSegment
- All Implemented Interfaces:
AutoCloseable,MappedSegment
- Direct Known Subclasses:
PosixMappedSegment
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.static JdkMappedSegmentofShared(FileChannel fileChannel, FileChannel.MapMode mode, long position, long size) 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.
-
Field Details
-
segment
-
-
Constructor Details
-
JdkMappedSegment
-
-
Method Details
-
segment
Description copied from interface:MappedSegmentReturns the underlyingMemorySegmentbacking this mapped region.- Specified by:
segmentin interfaceMappedSegment
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMappedSegment
-
slice
Description copied from interface:MappedSegmentReturns a slice of this segment. Closing a slice does not close its parent.- Specified by:
slicein interfaceMappedSegment
-
prefetch
public void prefetch(long offset, long length) Description copied from interface:MappedSegmentPrefetches the given offset and length.- Specified by:
prefetchin interfaceMappedSegment
-
madvise
public void madvise(long offset, long length, int advice) Description copied from interface:MappedSegmentAdvises the operating system about the expected access pattern for the specified memory region, allowing the kernel to optimize paging behavior.- Specified by:
madvisein interfaceMappedSegment- Parameters:
offset- the starting offset within the bufferlength- the length of the region in bytesadvice- the access pattern advice; seeMadviseAdviceconstants