Class SSTableIndex

  • All Implemented Interfaces:
    SegmentOrdering
    Direct Known Subclasses:
    V1SSTableIndex

    public abstract class SSTableIndex
    extends java.lang.Object
    implements SegmentOrdering
    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
    • Method Detail

      • 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

        public abstract java.nio.ByteBuffer 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

        public abstract java.nio.ByteBuffer 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

        public abstract AbstractBounds<PartitionPosition> 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 java.util.List<KeyRangeIterator> search​(Expression expression,
                                                                AbstractBounds<PartitionPosition> keyRange,
                                                                QueryContext context)
                                                         throws java.io.IOException
        Perform a search on the index for a single expression and keyRange.

        The result is a List of KeyRangeIterator because there will be a KeyRangeIterator for each segment in the index. The result will never be null but may be an empty List.

        Parameters:
        expression - The Expression to be searched for
        keyRange - The AbstractBounds<PartitionPosition> defining the token range for the search
        context - The QueryContext holding the per-query state
        Returns:
        a List of KeyRangeIterators containing the results of the search
        Throws:
        java.io.IOException
      • populateSegmentView

        public abstract void populateSegmentView​(SimpleDataSet dataSet)
        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
      • getVersion

        public Version getVersion()
      • reference

        public boolean reference()
      • isReleased

        public boolean isReleased()
      • releaseQuietly

        public void releaseQuietly()
      • release

        public void release()
      • markObsolete

        public void markObsolete()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object