Package org.apache.lucene.codecs.lucene99

# Class OffHeapQuantizedByteVectorValues

java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.util.quantization.QuantizedByteVectorValues
org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues

All Implemented Interfaces:
  `HasIndexSlice`

Direct Known Subclasses:
  `OffHeapQuantizedByteVectorValues.DenseOffHeapVectorValues`

public abstract class OffHeapQuantizedByteVectorValues extends QuantizedByteVectorValues
Read the quantized vector values and their score correction values from the index input. This supports both iterated and random access.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `OffHeapQuantizedByteVectorValues.DenseOffHeapVectorValues`
  Dense vector values that are stored off-heap.

  ## Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues

  `KnnVectorValues.DocIndexIterator`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final byte[]`
  `binaryValue`
  `protected final ByteBuffer`
  `byteBuffer`
  `protected final int`
  `byteSize`
  `protected final boolean`
  `compress`
  `protected final int`
  `dimension`
  `protected int`
  `lastOrd`
  `protected final int`
  `numBytes`
  `protected final ScalarQuantizer`
  `scalarQuantizer`
  `protected final float[]`
  `scoreCorrectionConstant`
  `protected final VectorSimilarityFunction`
  `similarityFunction`
  `protected final int`
  `size`
  `protected final IndexInput`
  `slice`
  `protected final FlatVectorsScorer`
  `vectorsScorer`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `dimension()`
  Return the dimension of the vectors
  `ScalarQuantizer`
  `getScalarQuantizer()`
  `float`
  `getScoreCorrectionConstant(int targetOrd)`
  `IndexInput`
  `getSlice()`
  Returns an IndexInput from which to read this instance's values.
  `int`
  `getVectorByteLength()`
  Returns the vector byte length, defaults to dimension multiplied by float byte size
  `static OffHeapQuantizedByteVectorValues`
  `load(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, ScalarQuantizer scalarQuantizer, VectorSimilarityFunction similarityFunction, FlatVectorsScorer vectorsScorer, boolean compress, long quantizedVectorDataOffset, long quantizedVectorDataLength, IndexInput vectorData)`
  `int`
  `size()`
  Return the number of vectors for this field.
  `byte[]`
  `vectorValue(int targetOrd)`
  Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown.

  ### Methods inherited from class org.apache.lucene.util.quantization.QuantizedByteVectorValues

  `copy, scorer`

  ### Methods inherited from class org.apache.lucene.index.ByteVectorValues

  `checkField, fromBytes, getEncoding, scorer`

  ### Methods inherited from class org.apache.lucene.index.KnnVectorValues

  `createDenseIterator, createSparseIterator, fromDISI, getAcceptOrds, iterator, ordToDoc`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### dimension

    protected final int dimension

  - ### size

    protected final int size

  - ### numBytes

    protected final int numBytes

  - ### scalarQuantizer

    protected final ScalarQuantizer scalarQuantizer

  - ### similarityFunction

    protected final VectorSimilarityFunction similarityFunction

  - ### vectorsScorer

    protected final FlatVectorsScorer vectorsScorer

  - ### compress

    protected final boolean compress

  - ### slice

    protected final IndexInput slice

  - ### binaryValue

    protected final byte[] binaryValue

  - ### byteBuffer

    protected final ByteBuffer byteBuffer

  - ### byteSize

    protected final int byteSize

  - ### lastOrd

    protected int lastOrd

  - ### scoreCorrectionConstant

    protected final float[] scoreCorrectionConstant

- ## Method Details

  - ### getScalarQuantizer

    public ScalarQuantizer getScalarQuantizer()
    Overrides:
      `getScalarQuantizer` in class `QuantizedByteVectorValues`

  - ### dimension

    public int dimension()
    Description copied from class: `KnnVectorValues`
    Return the dimension of the vectors
    Specified by:
      `dimension` in class `KnnVectorValues`

  - ### size

    public int size()
    Description copied from class: `KnnVectorValues`
    Return the number of vectors for this field.
    Specified by:
      `size` in class `KnnVectorValues`
    Returns:
      the number of vectors returned by this iterator

  - ### vectorValue

    public byte[] vectorValue(int targetOrd) throws IOException
    Description copied from class: `ByteVectorValues`
    Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown. The returned array may be shared across calls.
    Specified by:
      `vectorValue` in class `ByteVectorValues`
    Returns:
      the vector value
    Throws:
      `IOException`

  - ### getScoreCorrectionConstant

    public float getScoreCorrectionConstant(int targetOrd) throws IOException
    Specified by:
      `getScoreCorrectionConstant` in class `QuantizedByteVectorValues`
    Throws:
      `IOException`

  - ### getSlice

    public IndexInput getSlice()
    Description copied from interface: `HasIndexSlice`
    Returns an IndexInput from which to read this instance's values.
    Specified by:
      `getSlice` in interface `HasIndexSlice`
    Overrides:
      `getSlice` in class `QuantizedByteVectorValues`

  - ### getVectorByteLength

    public int getVectorByteLength()
    Description copied from class: `KnnVectorValues`
    Returns the vector byte length, defaults to dimension multiplied by float byte size
    Overrides:
      `getVectorByteLength` in class `KnnVectorValues`

  - ### load

    public static OffHeapQuantizedByteVectorValues load(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, ScalarQuantizer scalarQuantizer, VectorSimilarityFunction similarityFunction, FlatVectorsScorer vectorsScorer, boolean compress, long quantizedVectorDataOffset, long quantizedVectorDataLength, IndexInput vectorData) throws IOException
    Throws:
      `IOException`