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 float
private final DocsWithFieldSet
private final FieldInfo
private boolean
private final List
<float[]> private final InfoStream
private float
private float
private final boolean
private static final long
Fields inherited from class org.apache.lucene.codecs.FlatFieldVectorsWriter
indexingDelegate
Fields 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 TypeMethodDescriptionvoid
addValue
(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) void
finish()
long
Return 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, wait
Methods 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:Accountable
Return the memory usage of this object in bytes. Negative values are illegal. -
addValue
Description copied from class:KnnFieldVectorsWriter
Add new docID with its vector value to the given field for indexing. Doc IDs must be added in increasing order.- Specified by:
addValue
in classKnnFieldVectorsWriter<float[]>
- Throws:
IOException
-
copyValue
public float[] copyValue(float[] vectorValue) Description copied from class:KnnFieldVectorsWriter
Used to copy values being indexed to internal storage.- Specified by:
copyValue
in classKnnFieldVectorsWriter<float[]>
- Parameters:
vectorValue
- an array containing the vector value to add- Returns:
- a copy of the value; a new array
-