Module org.apache.lucene.core
Class Lucene99HnswVectorsWriter.FieldWriter<T>
- java.lang.Object
-
- org.apache.lucene.codecs.KnnFieldVectorsWriter<T>
-
- org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsWriter.FieldWriter<T>
-
- All Implemented Interfaces:
Accountable
- Enclosing class:
- Lucene99HnswVectorsWriter
private static class Lucene99HnswVectorsWriter.FieldWriter<T> extends KnnFieldVectorsWriter<T>
-
-
Field Summary
Fields Modifier and Type Field Description private DocsWithFieldSet
docsWithField
private FieldInfo
fieldInfo
private HnswGraphBuilder
hnswGraphBuilder
private int
lastDocID
private int
node
private static long
SHALLOW_SIZE
private java.util.List<T>
vectors
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description FieldWriter(FieldInfo fieldInfo, int M, int beamWidth, InfoStream infoStream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(int docID, T vectorValue)
Add new docID with its vector value to the given field for indexing.T
copyValue(T vectorValue)
Used to copy values being indexed to internal storage.(package private) static Lucene99HnswVectorsWriter.FieldWriter<?>
create(FieldInfo fieldInfo, int M, int beamWidth, InfoStream infoStream)
(package private) OnHeapHnswGraph
getGraph()
long
ramBytesUsed()
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 Detail
-
SHALLOW_SIZE
private static final long SHALLOW_SIZE
-
fieldInfo
private final FieldInfo fieldInfo
-
docsWithField
private final DocsWithFieldSet docsWithField
-
vectors
private final java.util.List<T> vectors
-
hnswGraphBuilder
private final HnswGraphBuilder hnswGraphBuilder
-
lastDocID
private int lastDocID
-
node
private int node
-
-
Constructor Detail
-
FieldWriter
FieldWriter(FieldInfo fieldInfo, int M, int beamWidth, InfoStream infoStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
create
static Lucene99HnswVectorsWriter.FieldWriter<?> create(FieldInfo fieldInfo, int M, int beamWidth, InfoStream infoStream) throws java.io.IOException
- Throws:
java.io.IOException
-
addValue
public void addValue(int docID, T vectorValue) throws java.io.IOException
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<T>
- Throws:
java.io.IOException
-
copyValue
public T copyValue(T vectorValue)
Description copied from class:KnnFieldVectorsWriter
Used to copy values being indexed to internal storage.- Specified by:
copyValue
in classKnnFieldVectorsWriter<T>
- Parameters:
vectorValue
- an array containing the vector value to add- Returns:
- a copy of the value; a new array
-
getGraph
OnHeapHnswGraph getGraph()
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
-