Package org.apache.lucene.codecs
Class BufferingKnnVectorsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsWriter
-
- org.apache.lucene.codecs.BufferingKnnVectorsWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Accountable
public abstract class BufferingKnnVectorsWriter extends KnnVectorsWriter
Buffers up pending vector value(s) per doc, then flushes when segment flushes. Used forSimpleTextKnnVectorsWriter
and for vectors writers before v 9.3 .- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
KnnVectorsWriter.MergedVectorValues
-
-
Field Summary
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BufferingKnnVectorsWriter()
Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description KnnFieldVectorsWriter<?>
addField(FieldInfo fieldInfo)
Add new field for indexingvoid
flush(int maxDoc, Sorter.DocMap sortMap)
Flush all buffered data on disk *void
mergeOneField(FieldInfo fieldInfo, MergeState mergeState)
Write field for merginglong
ramBytesUsed()
Return the memory usage of this object in bytes.protected abstract void
writeField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc)
Write the provided byte vector fieldprotected abstract void
writeField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc)
Write the provided float vector field-
Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
finish, merge
-
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.Accountable
getChildResources
-
-
-
-
Method Detail
-
addField
public KnnFieldVectorsWriter<?> addField(FieldInfo fieldInfo) throws IOException
Description copied from class:KnnVectorsWriter
Add new field for indexing- Specified by:
addField
in classKnnVectorsWriter
- Throws:
IOException
-
flush
public void flush(int maxDoc, Sorter.DocMap sortMap) throws IOException
Description copied from class:KnnVectorsWriter
Flush all buffered data on disk *- Specified by:
flush
in classKnnVectorsWriter
- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
mergeOneField
public void mergeOneField(FieldInfo fieldInfo, MergeState mergeState) throws IOException
Description copied from class:KnnVectorsWriter
Write field for merging- Overrides:
mergeOneField
in classKnnVectorsWriter
- Throws:
IOException
-
writeField
protected abstract void writeField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc) throws IOException
Write the provided float vector field- Throws:
IOException
-
writeField
protected abstract void writeField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc) throws IOException
Write the provided byte vector field- Throws:
IOException
-
-