Package org.apache.cassandra.index.sai
Class VectorQueryContext
- java.lang.Object
-
- org.apache.cassandra.index.sai.VectorQueryContext
-
public class VectorQueryContext extends java.lang.Object
This represents the state of a vector query. It is repsonsible for maintaining a list of anyPrimaryKey
s that have been updated or deleted during a search of the indexes.The number of
shadowedPrimaryKeys
is compared before and after a search is performed. If it changes, it means that aPrimaryKey
was found to have been changed. In this case the whole search is repeated until the counts match.When this process has completed, a
Bits
array is generated. This is used by the vector graph search to identify which nodes in the graph to include in the results.
-
-
Constructor Summary
Constructors Constructor Description VectorQueryContext(ReadCommand readCommand)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.github.jbellis.jvector.util.Bits
bitsetForShadowedPrimaryKeys(SegmentMetadata metadata, PrimaryKeyMap primaryKeyMap, DiskAnn graph)
io.github.jbellis.jvector.util.Bits
bitsetForShadowedPrimaryKeys(OnHeapGraph<PrimaryKey> graph)
boolean
containsShadowedPrimaryKey(PrimaryKey primaryKey)
java.util.NavigableSet<PrimaryKey>
getShadowedPrimaryKeys()
int
limit()
void
recordShadowedPrimaryKey(PrimaryKey primaryKey)
boolean
shouldInclude(long sstableRowId, PrimaryKeyMap primaryKeyMap)
boolean
shouldInclude(PrimaryKey pk)
-
-
-
Constructor Detail
-
VectorQueryContext
public VectorQueryContext(ReadCommand readCommand)
-
-
Method Detail
-
limit
public int limit()
-
recordShadowedPrimaryKey
public void recordShadowedPrimaryKey(PrimaryKey primaryKey)
-
shouldInclude
public boolean shouldInclude(long sstableRowId, PrimaryKeyMap primaryKeyMap)
-
shouldInclude
public boolean shouldInclude(PrimaryKey pk)
-
containsShadowedPrimaryKey
public boolean containsShadowedPrimaryKey(PrimaryKey primaryKey)
-
getShadowedPrimaryKeys
public java.util.NavigableSet<PrimaryKey> getShadowedPrimaryKeys()
- Returns:
- shadowed primary keys, in ascending order
-
bitsetForShadowedPrimaryKeys
public io.github.jbellis.jvector.util.Bits bitsetForShadowedPrimaryKeys(OnHeapGraph<PrimaryKey> graph)
-
bitsetForShadowedPrimaryKeys
public io.github.jbellis.jvector.util.Bits bitsetForShadowedPrimaryKeys(SegmentMetadata metadata, PrimaryKeyMap primaryKeyMap, DiskAnn graph) throws java.io.IOException
- Throws:
java.io.IOException
-
-