Class V1SSTableIndex
- java.lang.Object
-
- org.apache.cassandra.index.sai.disk.SSTableIndex
-
- org.apache.cassandra.index.sai.disk.v1.V1SSTableIndex
-
- All Implemented Interfaces:
SegmentOrdering
public class V1SSTableIndex extends SSTableIndex
A version specific implementation of theSSTableIndex
where the index is segmented
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.index.sai.disk.SSTableIndex
COMPARATOR, indexIdentifier, indexTermType, sstableContext
-
-
Constructor Summary
Constructors Constructor Description V1SSTableIndex(SSTableContext sstableContext, StorageAttachedIndex index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractBounds<PartitionPosition>
bounds()
Returns the key bounds of the index.long
getRowCount()
Returns the number of indexed rows in the index.long
indexFileCacheSize()
Returns the amount of memory occupied by the index when it is initially loaded.protected void
internalRelease()
KeyRangeIterator
limitToTopKResults(QueryContext context, java.util.List<PrimaryKey> primaryKeys, Expression expression)
Reorder, limit, and put back into original order the results from a single sstablelong
maxSSTableRowId()
Returns the maximum indexed rowId for the index.java.nio.ByteBuffer
maxTerm()
Returns the maximum term held in the index based on the natural sort order of the index column type comparator.long
minSSTableRowId()
Returns the minimum indexed rowId for the index.java.nio.ByteBuffer
minTerm()
Returns the minimum term held in the index based on the natural sort order of the index column type comparator.void
populateSegmentView(SimpleDataSet dataset)
Populates a virtual table using the index metadata owned by the indexjava.util.List<KeyRangeIterator>
search(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
equals, getIndexIdentifier, getIndexTermType, getSSTable, getSSTableContext, getVersion, hashCode, isReleased, markObsolete, reference, release, releaseQuietly, sizeOfPerColumnComponents, toString
-
-
-
-
Constructor Detail
-
V1SSTableIndex
public V1SSTableIndex(SSTableContext sstableContext, StorageAttachedIndex index)
-
-
Method Detail
-
indexFileCacheSize
public long indexFileCacheSize()
Description copied from class:SSTableIndex
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.- Specified by:
indexFileCacheSize
in classSSTableIndex
-
getRowCount
public long getRowCount()
Description copied from class:SSTableIndex
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.- Specified by:
getRowCount
in classSSTableIndex
-
minSSTableRowId
public long minSSTableRowId()
Description copied from class:SSTableIndex
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.- Specified by:
minSSTableRowId
in classSSTableIndex
-
maxSSTableRowId
public long maxSSTableRowId()
Description copied from class:SSTableIndex
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.- Specified by:
maxSSTableRowId
in classSSTableIndex
-
minTerm
public java.nio.ByteBuffer minTerm()
Description copied from class:SSTableIndex
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.- Specified by:
minTerm
in classSSTableIndex
-
maxTerm
public java.nio.ByteBuffer maxTerm()
Description copied from class:SSTableIndex
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.- Specified by:
maxTerm
in classSSTableIndex
-
bounds
public AbstractBounds<PartitionPosition> bounds()
Description copied from class:SSTableIndex
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.- Specified by:
bounds
in classSSTableIndex
-
search
public java.util.List<KeyRangeIterator> search(Expression expression, AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws java.io.IOException
Description copied from class:SSTableIndex
Perform a search on the index for a single expression and keyRange.The result is a
List
ofKeyRangeIterator
because there will be aKeyRangeIterator
for each segment in the index. The result will never be null but may be an emptyList
.- Specified by:
search
in classSSTableIndex
- Parameters:
expression
- TheExpression
to be searched forkeyRange
- TheAbstractBounds<PartitionPosition>
defining the token range for the searchcontext
- TheQueryContext
holding the per-query state- Returns:
- a
List
ofKeyRangeIterator
s containing the results of the search - Throws:
java.io.IOException
-
limitToTopKResults
public KeyRangeIterator limitToTopKResults(QueryContext context, java.util.List<PrimaryKey> primaryKeys, Expression expression) throws java.io.IOException
Description copied from interface:SegmentOrdering
Reorder, limit, and put back into original order the results from a single sstable- Throws:
java.io.IOException
-
populateSegmentView
public void populateSegmentView(SimpleDataSet dataset)
Description copied from class:SSTableIndex
Populates a virtual table using the index metadata owned by the index- Specified by:
populateSegmentView
in classSSTableIndex
-
internalRelease
protected void internalRelease()
- Specified by:
internalRelease
in classSSTableIndex
-
-