Interface SegmentOrdering
- All Known Implementing Classes:
IndexSegmentSearcher,LiteralIndexSegmentSearcher,NumericIndexSegmentSearcher,Segment,VectorIndexSegmentSearcher
public interface SegmentOrdering
A
SegmentOrdering orders an index and produces a stream of PrimaryKeyWithScores.
The limit can be used to lazily order the PrimaryKeys. Due to the possiblity for
shadowed or updated keys, a SegmentOrdering should be able to order the whole index
until exhausted.
When using SegmentOrdering there are several steps to
build the list of Primary Keys to be ordered:
1. Find all primary keys that match each non-ordering query predicate.
2. Union and intersect the results of step 1 to build a single KeyRangeIterator
ordered by PrimaryKey.
3. Fan the primary keys from step 2 out to each sstable segment to order the list of primary keys.
SegmentOrdering handles the third step.
Note: a segment ordering is only used when a query has both ordering and non-ordering predicates.
Where a query has only ordering predicates, the ordering is handled by
SSTableIndex.search(Expression, AbstractBounds, QueryContext).
-
Method Summary
Modifier and TypeMethodDescriptiondefault CloseableIterator<PrimaryKeyWithScore>orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) Reorder, limit, and put back into original order the results from a single sstable
-
Method Details
-
orderResultsBy
default CloseableIterator<PrimaryKeyWithScore> orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) throws IOException Reorder, limit, and put back into original order the results from a single sstable- Throws:
IOException
-