Class StorageAttachedIndexSearcher.ScoreOrderedResultRetriever
java.lang.Object
org.apache.cassandra.utils.AbstractIterator<UnfilteredRowIterator>
org.apache.cassandra.index.sai.plan.StorageAttachedIndexSearcher.ScoreOrderedResultRetriever
- All Implemented Interfaces:
com.google.common.collect.PeekingIterator<UnfilteredRowIterator>,AutoCloseable,Iterator<UnfilteredRowIterator>,BasePartitionIterator<UnfilteredRowIterator>,UnfilteredPartitionIterator,CloseableIterator<UnfilteredRowIterator>
- Enclosing class:
- StorageAttachedIndexSearcher
public class StorageAttachedIndexSearcher.ScoreOrderedResultRetriever
extends AbstractIterator<UnfilteredRowIterator>
A result retriever that consumes an iterator primary keys sorted by some score, materializes the row for each
primary key (currently, each primary key is required to be fully qualified and should only point to one row),
apply the filter tree to the row to test that the real row satisfies the WHERE clause, and finally tests
that the row is valid for the ORDER BY clause. The class performs some optimizations to avoid materializing
rows unnecessarily. See the class for more details.
The resulting UnfilteredRowIterator objects are not guaranteed to be in any particular order. It is
the responsibility of the caller to sort the results if necessary.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()metadata()readAndValidatePartition(PrimaryKey pk, List<PrimaryKeyWithScore> sourceKeys) Reads and validates a partition for a given primary key against its sources.Methods inherited from class org.apache.cassandra.utils.AbstractIterator
endOfData, hasNext, next, peek, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext
-
Method Details
-
computeNext
- Specified by:
computeNextin classAbstractIterator<UnfilteredRowIterator>
-
readAndValidatePartition
public UnfilteredRowIterator readAndValidatePartition(PrimaryKey pk, List<PrimaryKeyWithScore> sourceKeys) Reads and validates a partition for a given primary key against its sources.- Parameters:
pk- The primary key of the partition to read and validatesourceKeys- A list of PrimaryKeyWithScore objects associated with the primary key. Multiple sort keys can exist for the same primary key when data comes from different sstables or memtables.- Returns:
- An UnfilteredRowIterator containing the validated partition data, or null if: - The key has already been processed - The partition does not pass index filters - The partition contains no valid rows - The row data does not match the index metadata for any of the provided primary keys
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBasePartitionIterator<UnfilteredRowIterator>- Specified by:
closein interfaceCloseableIterator<UnfilteredRowIterator>- Overrides:
closein classAbstractIterator<UnfilteredRowIterator>
-
metadata
- Specified by:
metadatain interfaceUnfilteredPartitionIterator
-