Class CollectionKeyIndex

  • All Implemented Interfaces:
    Index

    public class CollectionKeyIndex
    extends CollectionKeyIndexBase
    Index on the collection element of the cell name of a collection. The row keys for this index are given by the collection element for indexed columns.
    • Method Detail

      • getIndexedValue

        public java.nio.ByteBuffer getIndexedValue​(java.nio.ByteBuffer partitionKey,
                                                   Clustering<?> clustering,
                                                   CellPath path,
                                                   java.nio.ByteBuffer cellValue)
        Description copied from class: CassandraIndex
        Extract the value to be inserted into the index from the components of the base data
        Specified by:
        getIndexedValue in class CassandraIndex
        Parameters:
        partitionKey - from the primary data
        clustering - from the primary data
        path - from the primary data
        cellValue - from the primary data
        Returns:
        a ByteBuffer containing the value to be inserted in the index. This will be used to make the partition key in the index table
      • isStale

        public boolean isStale​(Row data,
                               java.nio.ByteBuffer indexValue,
                               long nowInSec)
        Description copied from class: CassandraIndex
        Check whether a value retrieved from an index is still valid by comparing it to current row from the base table. Used at read time to identify out of date index entries so that they can be excluded from search results and repaired
        Specified by:
        isStale in class CassandraIndex
        Parameters:
        data - the current row from the primary data table
        indexValue - the value we retrieved from the index
        Returns:
        true if the index is out of date and the entry should be dropped