Class SSTableIndex
java.lang.Object
org.apache.cassandra.index.sai.disk.SSTableIndex
- All Implemented Interfaces:
Comparable<SSTableIndex>
- Direct Known Subclasses:
EmptyIndex,V1SSTableIndex
A reference-counted container of a
SSTableReader for each column index that:
- Manages references to the SSTable for each query
- Exposes a version agnostic searcher onto the column index
- Exposes the index metadata for the column index
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<SSTableIndex>protected final IndexIdentifierprotected final IndexTermTypeprotected final SSTableContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractBounds<PartitionPosition>bounds()Returns the key bounds of the index.intcompareTo(SSTableIndex index) booleanabstract longReturns the number of indexed rows in the index.inthashCode()abstract longReturns the amount of memory occupied by the index when it is initially loaded.protected abstract voidbooleanvoidabstract longReturns the maximum indexed rowId for the index.abstract ByteBuffermaxTerm()Returns the maximum term held in the index based on the natural sort order of the index column type comparator.abstract longReturns the minimum indexed rowId for the index.abstract ByteBufferminTerm()Returns the minimum term held in the index based on the natural sort order of the index column type comparator.abstract List<CloseableIterator<PrimaryKeyWithScore>>orderBy(Expression orderer, AbstractBounds<PartitionPosition> keyRange, QueryContext context) abstract List<CloseableIterator<PrimaryKeyWithScore>>orderResultsBy(QueryContext context, List<PrimaryKey> results, Expression orderer) abstract voidpopulateSegmentView(SimpleDataSet dataSet) Populates a virtual table using the index metadata owned by the indexbooleanvoidrelease()voidabstract List<KeyRangeIterator>search(Expression expression, AbstractBounds<PartitionPosition> keyRange, QueryContext context) Perform a search on the index for a single expression and keyRange.longtoString()
-
Field Details
-
COMPARATOR
-
sstableContext
-
indexTermType
-
indexIdentifier
-
-
Constructor Details
-
SSTableIndex
-
-
Method Details
-
indexFileCacheSize
public abstract long indexFileCacheSize()Returns 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. -
getRowCount
public abstract long getRowCount()Returns 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. -
minSSTableRowId
public abstract long minSSTableRowId()Returns 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. -
maxSSTableRowId
public abstract long maxSSTableRowId()Returns 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. -
minTerm
Returns 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. -
maxTerm
Returns 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. -
bounds
Returns 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. -
search
public abstract List<KeyRangeIterator> search(Expression expression, AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws IOException Perform 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.- 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 abstract List<CloseableIterator<PrimaryKeyWithScore>> orderBy(Expression orderer, AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws IOException - Throws:
IOException
-
orderResultsBy
public abstract List<CloseableIterator<PrimaryKeyWithScore>> orderResultsBy(QueryContext context, List<PrimaryKey> results, Expression orderer) throws IOException - Throws:
IOException
-
populateSegmentView
Populates a virtual table using the index metadata owned by the index -
internalRelease
protected abstract void internalRelease() -
sizeOfPerColumnComponents
public long sizeOfPerColumnComponents()- Returns:
- total size of per-column index components, in bytes
-
getIndexTermType
-
getIndexIdentifier
-
getSSTableContext
-
getVersion
-
getSSTable
-
reference
public boolean reference() -
isReleased
public boolean isReleased() -
releaseQuietly
public void releaseQuietly() -
release
public void release() -
markObsolete
public void markObsolete() -
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<SSTableIndex>
-