Class VectorMemoryIndex
java.lang.Object
org.apache.cassandra.index.sai.memory.MemoryIndex
org.apache.cassandra.index.sai.memory.VectorMemoryIndex
- All Implemented Interfaces:
MemtableOrdering
-
Field Summary
Fields inherited from class org.apache.cassandra.index.sai.memory.MemoryIndex
index -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongadd(DecoratedKey key, Clustering<?> clustering, ByteBuffer value) static intexpectedNodesVisited(int limit, int nPermittedOrdinals, int graphSize) All parameters must be greater than zero.booleanisEmpty()iterator()Iterate all Term->PrimaryKeys mappings in sorted orderorderBy(QueryContext queryContext, Expression expr, AbstractBounds<PartitionPosition> keyRange) Order the index based on the given orderer (expression).orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) Order the given list ofPrimaryKeyresults corresponding to the given orderer.search(QueryContext queryContext, Expression expression, AbstractBounds<PartitionPosition> keyRange) longupdate(DecoratedKey key, Clustering<?> clustering, ByteBuffer oldValue, ByteBuffer newValue) writeDirect(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier, Function<PrimaryKey, Integer> postingTransformer)
-
Constructor Details
-
VectorMemoryIndex
-
-
Method Details
-
add
- Specified by:
addin classMemoryIndex
-
update
public long update(DecoratedKey key, Clustering<?> clustering, ByteBuffer oldValue, ByteBuffer newValue) - Specified by:
updatein classMemoryIndex
-
search
public KeyRangeIterator search(QueryContext queryContext, Expression expression, AbstractBounds<PartitionPosition> keyRange) - Specified by:
searchin classMemoryIndex
-
orderBy
public CloseableIterator<PrimaryKeyWithScore> orderBy(QueryContext queryContext, Expression expr, AbstractBounds<PartitionPosition> keyRange) Description copied from interface:MemtableOrderingOrder the index based on the given orderer (expression).- Parameters:
queryContext- - the query contextexpr- - the expression to order bykeyRange- - the key range to search- Returns:
- an iterator over the results in score order.
-
orderResultsBy
public CloseableIterator<PrimaryKeyWithScore> orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) Description copied from interface:MemtableOrderingOrder the given list ofPrimaryKeyresults corresponding to the given orderer. Returns an iterator over the results in score order. Assumes that the given spans the same rows as the implementing index's segment. -
expectedNodesVisited
public static int expectedNodesVisited(int limit, int nPermittedOrdinals, int graphSize) All parameters must be greater than zero. nPermittedOrdinals may be larger than graphSize. -
iterator
Description copied from class:MemoryIndexIterate all Term->PrimaryKeys mappings in sorted order- Specified by:
iteratorin classMemoryIndex
-
writeDirect
public SegmentMetadata.ComponentMetadataMap writeDirect(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier, Function<PrimaryKey, Integer> postingTransformer) throws IOException- Specified by:
writeDirectin classMemoryIndex- Throws:
IOException
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin classMemoryIndex
-
getMinTerm
- Specified by:
getMinTermin classMemoryIndex
-
getMaxTerm
- Specified by:
getMaxTermin classMemoryIndex
-