Module org.apache.lucene.core
Class OffHeapByteVectorValues
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.codecs.lucene95.OffHeapByteVectorValues
- All Implemented Interfaces:
RandomAccessVectorValues,RandomAccessVectorValues.Bytes
- Direct Known Subclasses:
OffHeapByteVectorValues.DenseOffHeapVectorValues,OffHeapByteVectorValues.EmptyOffHeapVectorValues,OffHeapByteVectorValues.SparseOffHeapVectorValues
public abstract class OffHeapByteVectorValues
extends ByteVectorValues
implements RandomAccessVectorValues.Bytes
Read the vector values from the index input. This supports both iterated and random access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDense vector values that are stored off-heap.private static classprivate static classNested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
RandomAccessVectorValues.Bytes, RandomAccessVectorValues.Floats -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected final ByteBufferprotected final intprotected final intprotected final FlatVectorsScorerprotected intprotected final VectorSimilarityFunctionprotected final intprotected final IndexInputFields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS -
Constructor Summary
ConstructorsConstructorDescriptionOffHeapByteVectorValues(int dimension, int size, IndexInput slice, int byteSize, FlatVectorsScorer flatVectorsScorer, VectorSimilarityFunction similarityFunction) -
Method Summary
Modifier and TypeMethodDescriptionintReturn the dimension of the vectorsgetSlice()Returns a slice of the underlyingIndexInputthat contains the vector values if availablestatic OffHeapByteVectorValuesload(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData) private voidreadValue(int targetOrd) intsize()Return the number of vectors for this field.byte[]vectorValue(int targetOrd) Return the vector value indexed at the given ordinal.Methods inherited from class org.apache.lucene.index.ByteVectorValues
checkField, cost, scorer, vectorValueMethods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, all, docID, empty, nextDoc, range, slowAdvanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, ordToDocMethods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues.Bytes
copy, getVectorByteLength
-
Field Details
-
dimension
protected final int dimension -
size
protected final int size -
slice
-
lastOrd
protected int lastOrd -
binaryValue
protected final byte[] binaryValue -
byteBuffer
-
byteSize
protected final int byteSize -
similarityFunction
-
flatVectorsScorer
-
-
Constructor Details
-
OffHeapByteVectorValues
OffHeapByteVectorValues(int dimension, int size, IndexInput slice, int byteSize, FlatVectorsScorer flatVectorsScorer, VectorSimilarityFunction similarityFunction)
-
-
Method Details
-
dimension
public int dimension()Description copied from class:ByteVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin interfaceRandomAccessVectorValues- Specified by:
dimensionin classByteVectorValues
-
size
public int size()Description copied from class:ByteVectorValuesReturn the number of vectors for this field.- Specified by:
sizein interfaceRandomAccessVectorValues- Specified by:
sizein classByteVectorValues- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from interface:RandomAccessVectorValues.BytesReturn the vector value indexed at the given ordinal.- Specified by:
vectorValuein interfaceRandomAccessVectorValues.Bytes- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- Throws:
IOException
-
getSlice
Description copied from interface:RandomAccessVectorValuesReturns a slice of the underlyingIndexInputthat contains the vector values if available- Specified by:
getSlicein interfaceRandomAccessVectorValues
-
readValue
- Throws:
IOException
-
load
public static OffHeapByteVectorValues load(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData) throws IOException - Throws:
IOException
-