Module org.apache.lucene.core
Class Lucene99ScalarQuantizedVectorsWriter.FieldWriter
java.lang.Object
org.apache.lucene.codecs.KnnFieldVectorsWriter<float[]>
org.apache.lucene.codecs.hnsw.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 byteprivate final booleanprivate final Floatprivate final FieldInfoprivate booleanprivate final FlatFieldVectorsWriter<float[]> private final InfoStreamprivate final booleanprivate static final longFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionFieldWriter(Float confidenceInterval, byte bits, boolean compress, FieldInfo fieldInfo, InfoStream infoStream, FlatFieldVectorsWriter<float[]> 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) ScalarQuantizervoidfinish()indicates that this writer is done and no new vectors are allowed to be addedList<float[]> booleanlongReturn 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 -
fieldInfo
-
confidenceInterval
-
bits
private final byte bits -
compress
private final boolean compress -
infoStream
-
normalize
private final boolean normalize -
finished
private boolean finished -
flatFieldVectorsWriter
-
-
Constructor Details
-
FieldWriter
FieldWriter(Float confidenceInterval, byte bits, boolean compress, FieldInfo fieldInfo, InfoStream infoStream, FlatFieldVectorsWriter<float[]> indexWriter)
-
-
Method Details
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin classFlatFieldVectorsWriter<float[]>- Returns:
- true if the writer is done and no new vectors are allowed to be added
-
finish
Description copied from class:FlatFieldVectorsWriterindicates that this writer is done and no new vectors are allowed to be added- Specified by:
finishin classFlatFieldVectorsWriter<float[]>- Throws:
IOException- if an I/O error occurs
-
createQuantizer
- Throws:
IOException
-
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
-
getVectors
- Specified by:
getVectorsin classFlatFieldVectorsWriter<float[]>- Returns:
- a list of vectors to be written
-
getDocsWithFieldSet
- Specified by:
getDocsWithFieldSetin classFlatFieldVectorsWriter<float[]>- Returns:
- the docsWithFieldSet for the field writer
-