Class VectorQueryContext


  • public class VectorQueryContext
    extends java.lang.Object
    This represents the state of a vector query. It is repsonsible for maintaining a list of any PrimaryKeys 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 a PrimaryKey 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 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