Class EmptyIndex
java.lang.Object
org.apache.cassandra.index.sai.disk.SSTableIndex
org.apache.cassandra.index.sai.disk.EmptyIndex
- All Implemented Interfaces:
Comparable<SSTableIndex>
A placeholder index for when there is no on-disk index.
Currenly only used by vector indexes becasue ANN queries require a complete view of the table's sstables, even if
the associated sstable does not have any data indexed for the column.
-
Field Summary
Fields inherited from class org.apache.cassandra.index.sai.disk.SSTableIndex
COMPARATOR, indexIdentifier, indexTermType, sstableContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbounds()Returns the key bounds of the index.longReturns the number of indexed rows in the index.longReturns the amount of memory occupied by the index when it is initially loaded.protected voidlongReturns the maximum indexed rowId for the index.maxTerm()Returns the maximum term held in the index based on the natural sort order of the index column type comparator.longReturns the minimum indexed rowId for the index.minTerm()Returns the minimum term held in the index based on the natural sort order of the index column type comparator.orderBy(Expression orderer, AbstractBounds<PartitionPosition> keyRange, QueryContext context) orderResultsBy(QueryContext context, List<PrimaryKey> results, Expression orderer) voidpopulateSegmentView(SimpleDataSet dataSet) Populates a virtual table using the index metadata owned by the indexsearch(Expression expression, AbstractBounds<PartitionPosition> keyRange, QueryContext context) Perform a search on the index for a single expression and keyRange.Methods inherited from class org.apache.cassandra.index.sai.disk.SSTableIndex
compareTo, equals, getIndexIdentifier, getIndexTermType, getSSTable, getSSTableContext, getVersion, hashCode, isReleased, markObsolete, reference, release, releaseQuietly, sizeOfPerColumnComponents, toString
-
Constructor Details
-
EmptyIndex
-
-
Method Details
-
indexFileCacheSize
public long indexFileCacheSize()Description copied from class:SSTableIndexReturns the amount of memory occupied by the index when it is initially loaded. This is the amount of data loaded into internal memory buffers by the index and does include the class footprint overhead. It used by the index metrics.- Specified by:
indexFileCacheSizein classSSTableIndex
-
getRowCount
public long getRowCount()Description copied from class:SSTableIndexReturns the number of indexed rows in the index. This comes from the index metadata created when the index was written and is used by the index metrics.- Specified by:
getRowCountin classSSTableIndex
-
minSSTableRowId
public long minSSTableRowId()Description copied from class:SSTableIndexReturns the minimum indexed rowId for the index. This comes from the index metadata created when the index was written and is used by the index metrics.- Specified by:
minSSTableRowIdin classSSTableIndex
-
maxSSTableRowId
public long maxSSTableRowId()Description copied from class:SSTableIndexReturns the maximum indexed rowId for the index. This comes from the index metadata created when the index was written and is used by the index metrics.- Specified by:
maxSSTableRowIdin classSSTableIndex
-
minTerm
Description copied from class:SSTableIndexReturns the minimum term held in the index based on the natural sort order of the index column type comparator. It comes from the index metadata created when the index was written and is used by the index metrics and used in queries to determine whether a term, or range or terms, exists in the index.- Specified by:
minTermin classSSTableIndex
-
maxTerm
Description copied from class:SSTableIndexReturns the maximum term held in the index based on the natural sort order of the index column type comparator. It comes from the index metadata created when the index was written and is used by the index metrics and used in queries to determine whether a term, or range or terms, exists in the index.- Specified by:
maxTermin classSSTableIndex
-
bounds
Description copied from class:SSTableIndexReturns the key bounds of the index. It is created from the minimum and maximum keys held in the metadata and is used to determine whether sstable indexes overlap or not.- Specified by:
boundsin classSSTableIndex
-
search
public List<KeyRangeIterator> search(Expression expression, AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws IOException Description copied from class:SSTableIndexPerform a search on the index for a single expression and keyRange.The result is a
ListofKeyRangeIteratorbecause there will be aKeyRangeIteratorfor each segment in the index. The result will never be null but may be an emptyList.- Specified by:
searchin classSSTableIndex- Parameters:
expression- TheExpressionto be searched forkeyRange- TheAbstractBounds<PartitionPosition>defining the token range for the searchcontext- TheQueryContextholding the per-query state- Returns:
- a
ListofKeyRangeIterators containing the results of the search - Throws:
IOException
-
orderBy
public List<CloseableIterator<PrimaryKeyWithScore>> orderBy(Expression orderer, AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws IOException - Specified by:
orderByin classSSTableIndex- Throws:
IOException
-
orderResultsBy
public List<CloseableIterator<PrimaryKeyWithScore>> orderResultsBy(QueryContext context, List<PrimaryKey> results, Expression orderer) throws IOException - Specified by:
orderResultsByin classSSTableIndex- Throws:
IOException
-
populateSegmentView
Description copied from class:SSTableIndexPopulates a virtual table using the index metadata owned by the index- Specified by:
populateSegmentViewin classSSTableIndex
-
internalRelease
protected void internalRelease()- Specified by:
internalReleasein classSSTableIndex
-