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,org.elasticsearch.core.DirectAccessInput
public class DirectAccessIndexInput
extends org.apache.lucene.store.FilterIndexInput
implements org.elasticsearch.core.DirectAccessInput
A test utility that wraps an
IndexInput and implements DirectAccessInput,
serving direct ByteBuffer 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, NativeAccess nativeAccess) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.store.IndexInputclone()org.apache.lucene.store.IndexInputbooleanwithByteBufferSlice(long offset, long length, org.elasticsearch.core.CheckedConsumer<ByteBuffer, IOException> action) booleanwithByteBufferSlices(long[] offsets, int length, int count, org.elasticsearch.core.CheckedConsumer<ByteBuffer[], 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, NativeAccess nativeAccess)
-
-
Method Details
-
withByteBufferSlice
public boolean withByteBufferSlice(long offset, long length, org.elasticsearch.core.CheckedConsumer<ByteBuffer, IOException> action) throws IOException- Specified by:
withByteBufferSlicein interfaceorg.elasticsearch.core.DirectAccessInput- Throws:
IOException
-
withByteBufferSlices
public boolean withByteBufferSlices(long[] offsets, int length, int count, org.elasticsearch.core.CheckedConsumer<ByteBuffer[], IOException> action) throws IOException- Specified by:
withByteBufferSlicesin interfaceorg.elasticsearch.core.DirectAccessInput- 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
-