Class DirectAccessIndexInput
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.FilterIndexInput
org.elasticsearch.common.lucene.store.DirectAccessIndexInput
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable,DirectAccessInput
public class DirectAccessIndexInput
extends org.apache.lucene.store.FilterIndexInput
implements DirectAccessInput
A test utility that wraps an
IndexInput and implements DirectAccessInput,
serving direct MemorySegment slices backed by CloseableByteBuffer for
deterministic native memory management. The buffers are allocated via NativeAccess
and freed eagerly when the action completes.-
Field Summary
Fields inherited from class org.apache.lucene.store.FilterIndexInput
in -
Constructor Summary
ConstructorsConstructorDescriptionDirectAccessIndexInput(String resourceDescription, org.apache.lucene.store.IndexInput delegate, byte[] data) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.store.IndexInputclone()org.apache.lucene.store.IndexInputbooleanwithMemorySegmentSlice(long offset, long length, CheckedConsumer<MemorySegment, IOException> action) booleanwithMemorySegmentSlices(long[] offsets, int length, int count, CheckedConsumer<MemorySegment[], IOException> action) Methods inherited from class org.apache.lucene.store.FilterIndexInput
close, getDelegate, getFilePointer, length, readByte, readBytes, seek, unwrap, unwrapOnlyTestMethods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, isLoaded, prefetch, randomAccessSlice, skipBytes, slice, toString, updateIOContextMethods inherited from class org.apache.lucene.store.DataInput
readBytes, readFloats, readGroupVInt, readInt, readInts, readLong, readLongs, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong
-
Constructor Details
-
DirectAccessIndexInput
public DirectAccessIndexInput(String resourceDescription, org.apache.lucene.store.IndexInput delegate, byte[] data)
-
-
Method Details
-
withMemorySegmentSlice
public boolean withMemorySegmentSlice(long offset, long length, CheckedConsumer<MemorySegment, IOException> action) throws IOException- Specified by:
withMemorySegmentSlicein interfaceDirectAccessInput- Throws:
IOException
-
withMemorySegmentSlices
public boolean withMemorySegmentSlices(long[] offsets, int length, int count, CheckedConsumer<MemorySegment[], IOException> action) throws IOException- Specified by:
withMemorySegmentSlicesin interfaceDirectAccessInput- Throws:
IOException
-
clone
public org.apache.lucene.store.IndexInput clone()- Overrides:
clonein classorg.apache.lucene.store.IndexInput
-
slice
public org.apache.lucene.store.IndexInput slice(String sliceDescription, long offset, long length) throws IOException - Overrides:
slicein classorg.apache.lucene.store.FilterIndexInput- Throws:
IOException
-