Class OffHeapByteVectorValues
- java.lang.Object
-
- org.apache.lucene.search.DocIdSetIterator
-
- org.apache.lucene.index.ByteVectorValues
-
- org.apache.lucene.backward_codecs.lucene94.OffHeapByteVectorValues
-
- All Implemented Interfaces:
RandomAccessVectorValues
,RandomAccessVectorValues.Bytes
- Direct Known Subclasses:
OffHeapByteVectorValues.DenseOffHeapVectorValues
,OffHeapByteVectorValues.EmptyOffHeapVectorValues
,OffHeapByteVectorValues.SparseOffHeapVectorValues
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 Classes Modifier and Type Class Description (package private) static class
OffHeapByteVectorValues.DenseOffHeapVectorValues
private static class
OffHeapByteVectorValues.EmptyOffHeapVectorValues
private static class
OffHeapByteVectorValues.SparseOffHeapVectorValues
-
Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
RandomAccessVectorValues.Bytes, RandomAccessVectorValues.Floats
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
binaryValue
protected java.nio.ByteBuffer
byteBuffer
protected int
byteSize
protected int
dimension
protected int
lastOrd
protected int
size
protected IndexInput
slice
protected VectorSimilarityFunction
vectorSimilarityFunction
-
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
-
-
Constructor Summary
Constructors Constructor Description OffHeapByteVectorValues(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimension()
Return the dimension of the vectors(package private) static OffHeapByteVectorValues
load(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData)
private void
readValue(int targetOrd)
int
size()
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, vectorValue
-
Methods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, all, docID, empty, nextDoc, range, slowAdvance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, getSlice, ordToDoc
-
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues.Bytes
copy, getVectorByteLength
-
-
-
-
Field Detail
-
dimension
protected final int dimension
-
size
protected final int size
-
slice
protected final IndexInput slice
-
lastOrd
protected int lastOrd
-
binaryValue
protected final byte[] binaryValue
-
byteBuffer
protected final java.nio.ByteBuffer byteBuffer
-
byteSize
protected final int byteSize
-
vectorSimilarityFunction
protected final VectorSimilarityFunction vectorSimilarityFunction
-
-
Constructor Detail
-
OffHeapByteVectorValues
OffHeapByteVectorValues(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize)
-
-
Method Detail
-
dimension
public int dimension()
Description copied from class:ByteVectorValues
Return the dimension of the vectors- Specified by:
dimension
in interfaceRandomAccessVectorValues
- Specified by:
dimension
in classByteVectorValues
-
size
public int size()
Description copied from class:ByteVectorValues
Return the number of vectors for this field.- Specified by:
size
in interfaceRandomAccessVectorValues
- Specified by:
size
in classByteVectorValues
- Returns:
- the number of vectors returned by this iterator
-
vectorValue
public byte[] vectorValue(int targetOrd) throws java.io.IOException
Description copied from interface:RandomAccessVectorValues.Bytes
Return the vector value indexed at the given ordinal.- Specified by:
vectorValue
in interfaceRandomAccessVectorValues.Bytes
- Parameters:
targetOrd
- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size()
.- Throws:
java.io.IOException
-
readValue
private void readValue(int targetOrd) throws java.io.IOException
- Throws:
java.io.IOException
-
load
static OffHeapByteVectorValues load(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData) throws java.io.IOException
- Throws:
java.io.IOException
-
-