Module org.apache.lucene.core
Class Lucene99ScalarQuantizedVectorsWriter.FieldWriter
java.lang.Object
org.apache.lucene.codecs.KnnFieldVectorsWriter<float[]>
org.apache.lucene.codecs.FlatFieldVectorsWriter<float[]>
org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorsWriter.FieldWriter
- All Implemented Interfaces:
Accountable
- Enclosing class:
Lucene99ScalarQuantizedVectorsWriter
static class Lucene99ScalarQuantizedVectorsWriter.FieldWriter
extends FlatFieldVectorsWriter<float[]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final DocsWithFieldSetprivate final FieldInfoprivate booleanprivate final List<float[]> private final InfoStreamprivate floatprivate floatprivate final booleanprivate static final longFields inherited from class org.apache.lucene.codecs.FlatFieldVectorsWriter
indexingDelegateFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionFieldWriter(float confidenceInterval, FieldInfo fieldInfo, InfoStream infoStream, KnnFieldVectorsWriter<?> indexWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(int docID, float[] vectorValue) Add new docID with its vector value to the given field for indexing.float[]copyValue(float[] vectorValue) Used to copy values being indexed to internal storage.(package private) ScalarQuantizer(package private) voidfinish()longReturn the memory usage of this object in bytes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
SHALLOW_SIZE
private static final long SHALLOW_SIZE -
floatVectors
-
fieldInfo
-
confidenceInterval
private final float confidenceInterval -
infoStream
-
normalize
private final boolean normalize -
minQuantile
private float minQuantile -
maxQuantile
private float maxQuantile -
finished
private boolean finished -
docsWithField
-
-
Constructor Details
-
FieldWriter
FieldWriter(float confidenceInterval, FieldInfo fieldInfo, InfoStream infoStream, KnnFieldVectorsWriter<?> indexWriter)
-
-
Method Details
-
finish
- Throws:
IOException
-
createQuantizer
ScalarQuantizer createQuantizer() -
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal. -
addValue
Description copied from class:KnnFieldVectorsWriterAdd new docID with its vector value to the given field for indexing. Doc IDs must be added in increasing order.- Specified by:
addValuein classKnnFieldVectorsWriter<float[]>- Throws:
IOException
-
copyValue
public float[] copyValue(float[] vectorValue) Description copied from class:KnnFieldVectorsWriterUsed to copy values being indexed to internal storage.- Specified by:
copyValuein classKnnFieldVectorsWriter<float[]>- Parameters:
vectorValue- an array containing the vector value to add- Returns:
- a copy of the value; a new array
-