Class OrdToDocDISIReaderConfiguration

  • All Implemented Interfaces:
    Accountable

    public class OrdToDocDISIReaderConfiguration
    extends java.lang.Object
    implements Accountable
    Configuration for DirectMonotonicReader and IndexedDISI for reading sparse vectors. The format in the static writing methods adheres to the Lucene95HnswVectorsFormat
    • Field Detail

      • SHALLOW_SIZE

        private static final long SHALLOW_SIZE
      • size

        final int size
      • jumpTableEntryCount

        final short jumpTableEntryCount
      • docsWithFieldOffset

        final long docsWithFieldOffset
      • docsWithFieldLength

        final long docsWithFieldLength
      • denseRankPower

        final byte denseRankPower
      • addressesOffset

        final long addressesOffset
      • addressesLength

        final long addressesLength
    • Constructor Detail

      • OrdToDocDISIReaderConfiguration

        OrdToDocDISIReaderConfiguration​(int size,
                                        short jumpTableEntryCount,
                                        long addressesOffset,
                                        long addressesLength,
                                        long docsWithFieldOffset,
                                        long docsWithFieldLength,
                                        byte denseRankPower,
                                        DirectMonotonicReader.Meta meta)
    • Method Detail

      • writeStoredMeta

        public static void writeStoredMeta​(int directMonotonicBlockShift,
                                           IndexOutput outputMeta,
                                           IndexOutput vectorData,
                                           int count,
                                           int maxDoc,
                                           DocsWithFieldSet docsWithField)
                                    throws java.io.IOException
        Writes out the docsWithField and ordToDoc mapping to the outputMeta and vectorData respectively. This is in adherence to the Lucene95HnswVectorsFormat.

        Within outputMeta the format is as follows:

        Within the vectorData the format is as follows:

        Parameters:
        outputMeta - the outputMeta
        vectorData - the vectorData
        count - the count of docs with vectors
        maxDoc - the maxDoc for the index
        docsWithField - the docs contaiting a vector field
        Throws:
        java.io.IOException - thrown when writing data fails to either output
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable
      • getIndexedDISI

        public IndexedDISI getIndexedDISI​(IndexInput dataIn)
                                   throws java.io.IOException
        Parameters:
        dataIn - the dataIn
        Returns:
        the IndexedDISI for sparse values
        Throws:
        java.io.IOException - thrown when reading data fails
      • getDirectMonotonicReader

        public DirectMonotonicReader getDirectMonotonicReader​(IndexInput dataIn)
                                                       throws java.io.IOException
        Parameters:
        dataIn - the dataIn
        Returns:
        the DirectMonotonicReader for sparse values
        Throws:
        java.io.IOException - thrown when reading data fails
      • isEmpty

        public boolean isEmpty()
        Returns:
        If true, the field is empty, no vector values. If false, the field is either dense or sparse.
      • isDense

        public boolean isDense()
        Returns:
        If true, the field is dense, all documents have values for a field. If false, the field is sparse, some documents missing values.