Package org.apache.lucene.index
Class BufferingKnnVectorsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsWriter
-
- org.apache.lucene.index.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 forSimpleTextKnnVectorsWriterand 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 protectedBufferingKnnVectorsWriter()Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description KnnFieldVectorsWriter<float[]>addField(FieldInfo fieldInfo)Add new field for indexingvoidflush(int maxDoc, Sorter.DocMap sortMap)Flush all buffered data on disk *voidmergeOneField(FieldInfo fieldInfo, MergeState mergeState)Write field for merginglongramBytesUsed()Return the memory usage of this object in bytes.protected abstract voidwriteField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader, int maxDoc)Write the provided 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<float[]> addField(FieldInfo fieldInfo) throws IOException
Description copied from class:KnnVectorsWriterAdd new field for indexing- Specified by:
addFieldin classKnnVectorsWriter- Throws:
IOException
-
flush
public void flush(int maxDoc, Sorter.DocMap sortMap) throws IOExceptionDescription copied from class:KnnVectorsWriterFlush all buffered data on disk *- Specified by:
flushin classKnnVectorsWriter- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:AccountableReturn 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:KnnVectorsWriterWrite field for merging- Overrides:
mergeOneFieldin classKnnVectorsWriter- Throws:
IOException
-
writeField
protected abstract void writeField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader, int maxDoc) throws IOException
Write the provided field- Throws:
IOException
-
-