Class BufferingKnnVectorsWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Accountable
    Direct Known Subclasses:
    SimpleTextKnnVectorsWriter

    public abstract class BufferingKnnVectorsWriter
    extends KnnVectorsWriter
    Buffers up pending vector value(s) per doc, then flushes when segment flushes. Used for SimpleTextKnnVectorsWriter and for vectors writers before v 9.3 .
    • Constructor Detail

      • BufferingKnnVectorsWriter

        protected BufferingKnnVectorsWriter()
        Sole constructor
    • Method Detail

      • flush

        public void flush​(int maxDoc,
                          Sorter.DocMap sortMap)
                   throws java.io.IOException
        Description copied from class: KnnVectorsWriter
        Flush all buffered data on disk *
        Specified by:
        flush in class KnnVectorsWriter
        Throws:
        java.io.IOException
      • ramBytesUsed

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

        protected abstract void writeField​(FieldInfo fieldInfo,
                                           FloatVectorValues floatVectorValues,
                                           int maxDoc)
                                    throws java.io.IOException
        Write the provided float vector field
        Throws:
        java.io.IOException
      • writeField

        protected abstract void writeField​(FieldInfo fieldInfo,
                                           ByteVectorValues byteVectorValues,
                                           int maxDoc)
                                    throws java.io.IOException
        Write the provided byte vector field
        Throws:
        java.io.IOException