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 byte
private final boolean
private final Float
private final FieldInfo
private boolean
private final FlatFieldVectorsWriter
<float[]> private final InfoStream
private final boolean
private static final long
Fields 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 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
void
finish()
indicates that this writer is done and no new vectors are allowed to be addedList
<float[]> boolean
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 -
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:
isFinished
in classFlatFieldVectorsWriter<float[]>
- Returns:
- true if the writer is done and no new vectors are allowed to be added
-
finish
Description copied from class:FlatFieldVectorsWriter
indicates that this writer is done and no new vectors are allowed to be added- Specified by:
finish
in classFlatFieldVectorsWriter<float[]>
- Throws:
IOException
- if an I/O error occurs
-
createQuantizer
- Throws:
IOException
-
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
-
getVectors
- Specified by:
getVectors
in classFlatFieldVectorsWriter<float[]>
- Returns:
- a list of vectors to be written
-
getDocsWithFieldSet
- Specified by:
getDocsWithFieldSet
in classFlatFieldVectorsWriter<float[]>
- Returns:
- the docsWithFieldSet for the field writer
-