java.lang.Object
org.elasticsearch.index.codec.vectors.diskbbq.DiskBBQBulkWriter

public abstract sealed class DiskBBQBulkWriter extends Object
Base class for bulk writers that write vectors to disk using the BBQ encoding. This class provides the structure for writing vectors in bulk, with specific implementations for different bit sizes strategies.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
     
    protected final org.apache.lucene.store.IndexOutput
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DiskBBQBulkWriter(int bulkSize, org.apache.lucene.store.IndexOutput out)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fromBitSize(int bitSize, int bulkSize, org.apache.lucene.store.IndexOutput out)
    Factory method to create a DiskBBQBulkWriter based on the bit size.
    fromBitSize(int bitSize, int bulkSize, org.apache.lucene.store.IndexOutput out, boolean blockEncodeTailVectors, boolean writeComponentSumAsInt)
    Factory method to create a DiskBBQBulkWriter based on the bit size.
    abstract void
    writeVectors(QuantizedVectorValues qvv, org.apache.lucene.search.CheckedIntConsumer<IOException> docsWriter)
    Bulk write vectors to disk.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • bulkSize

      protected final int bulkSize
    • out

      protected final org.apache.lucene.store.IndexOutput out
  • Constructor Details

    • DiskBBQBulkWriter

      protected DiskBBQBulkWriter(int bulkSize, org.apache.lucene.store.IndexOutput out)
  • Method Details

    • writeVectors

      public abstract void writeVectors(QuantizedVectorValues qvv, org.apache.lucene.search.CheckedIntConsumer<IOException> docsWriter) throws IOException
      Bulk write vectors to disk. Tail vectors are not block encoded.
      Parameters:
      qvv - quantized vector values
      docsWriter - docs writer
      Throws:
      IOException - if writing fails
    • fromBitSize

      public static DiskBBQBulkWriter fromBitSize(int bitSize, int bulkSize, org.apache.lucene.store.IndexOutput out)
      Factory method to create a DiskBBQBulkWriter based on the bit size.
      Parameters:
      bitSize - the bit size of the quantized vectors
      bulkSize - the number of vectors to write in bulk
      out - the IndexOutput to write to
      Returns:
      a DiskBBQBulkWriter instance
    • fromBitSize

      public static DiskBBQBulkWriter fromBitSize(int bitSize, int bulkSize, org.apache.lucene.store.IndexOutput out, boolean blockEncodeTailVectors, boolean writeComponentSumAsInt)
      Factory method to create a DiskBBQBulkWriter based on the bit size.
      Parameters:
      bitSize - the bit size of the quantized vectors
      bulkSize - the number of vectors to write in bulk
      out - the IndexOutput to write to
      blockEncodeTailVectors - whether to block encode tail vectors
      Returns:
      a DiskBBQBulkWriter instance