Module org.elasticsearch.server
Class IVFVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.elasticsearch.index.codec.vectors.diskbbq.IVFVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable
- Direct Known Subclasses:
ES920DiskBBQVectorsWriter,ESNextDiskBBQVectorsWriter
public abstract class IVFVectorsWriter
extends org.apache.lucene.codecs.KnnVectorsWriter
Base class for IVF vectors writer.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.KnnVectorsWriter.MergedVectorValues -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIVFVectorsWriter(org.apache.lucene.index.SegmentWriteState state, String rawVectorFormatName, Boolean useDirectIOReads, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, int writeVersion) -
Method Summary
Modifier and TypeMethodDescriptionfinal org.apache.lucene.codecs.KnnFieldVectorsWriter<?> addField(org.apache.lucene.index.FieldInfo fieldInfo) buildAndWritePostingsLists(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.store.IndexOutput postingsOutput, long fileOffset, int[] assignments, int[] overspillAssignments) buildAndWritePostingsLists(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.store.IndexOutput postingsOutput, long fileOffset, org.apache.lucene.index.MergeState mergeState, int[] assignments, int[] overspillAssignments) abstract CentroidAssignmentscalculateCentroids(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.FloatVectorValues floatVectorValues) abstract CentroidAssignmentscalculateCentroids(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.index.MergeState mergeState) final voidclose()abstract CentroidSuppliercreateCentroidSupplier(org.apache.lucene.store.IndexInput centroidsInput, int numCentroids, org.apache.lucene.index.FieldInfo fieldInfo, float[] globalCentroid) protected abstract voiddoWriteMeta(org.apache.lucene.store.IndexOutput metaOutput, org.apache.lucene.index.FieldInfo field, int numCentroids) final voidfinish()final voidflush(int maxDoc, org.apache.lucene.index.Sorter.DocMap sortMap) final voidmergeOneField(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) final longabstract voidwriteCentroids(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, int[] centroidAssignments, float[] globalCentroid, IVFVectorsWriter.CentroidOffsetAndLength centroidOffsetAndLength, org.apache.lucene.store.IndexOutput centroidOutput) Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
mapOldOrdToNewOrd, mergeMethods 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
-
Constructor Details
-
IVFVectorsWriter
protected IVFVectorsWriter(org.apache.lucene.index.SegmentWriteState state, String rawVectorFormatName, Boolean useDirectIOReads, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, int writeVersion) throws IOException - Throws:
IOException
-
-
Method Details
-
addField
public final org.apache.lucene.codecs.KnnFieldVectorsWriter<?> addField(org.apache.lucene.index.FieldInfo fieldInfo) throws IOException - Specified by:
addFieldin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
calculateCentroids
public abstract CentroidAssignments calculateCentroids(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.FloatVectorValues floatVectorValues) throws IOException - Throws:
IOException
-
calculateCentroids
public abstract CentroidAssignments calculateCentroids(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.index.MergeState mergeState) throws IOException - Throws:
IOException
-
writeCentroids
public abstract void writeCentroids(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, int[] centroidAssignments, float[] globalCentroid, IVFVectorsWriter.CentroidOffsetAndLength centroidOffsetAndLength, org.apache.lucene.store.IndexOutput centroidOutput) throws IOException - Throws:
IOException
-
buildAndWritePostingsLists
public abstract IVFVectorsWriter.CentroidOffsetAndLength buildAndWritePostingsLists(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.store.IndexOutput postingsOutput, long fileOffset, int[] assignments, int[] overspillAssignments) throws IOException - Throws:
IOException
-
buildAndWritePostingsLists
public abstract IVFVectorsWriter.CentroidOffsetAndLength buildAndWritePostingsLists(org.apache.lucene.index.FieldInfo fieldInfo, CentroidSupplier centroidSupplier, org.apache.lucene.index.FloatVectorValues floatVectorValues, org.apache.lucene.store.IndexOutput postingsOutput, long fileOffset, org.apache.lucene.index.MergeState mergeState, int[] assignments, int[] overspillAssignments) throws IOException - Throws:
IOException
-
createCentroidSupplier
public abstract CentroidSupplier createCentroidSupplier(org.apache.lucene.store.IndexInput centroidsInput, int numCentroids, org.apache.lucene.index.FieldInfo fieldInfo, float[] globalCentroid) throws IOException - Throws:
IOException
-
flush
public final void flush(int maxDoc, org.apache.lucene.index.Sorter.DocMap sortMap) throws IOException - Specified by:
flushin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
mergeOneField
public final void mergeOneField(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeOneFieldin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
doWriteMeta
protected abstract void doWriteMeta(org.apache.lucene.store.IndexOutput metaOutput, org.apache.lucene.index.FieldInfo field, int numCentroids) throws IOException - Throws:
IOException
-
finish
- Specified by:
finishin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
close
- Throws:
IOException
-
ramBytesUsed
public final long ramBytesUsed()
-