org.apache.cassandra.index.internal.composites

## Class CollectionKeyIndexBase

- java.lang.Object
- - org.apache.cassandra.index.internal.CassandraIndex
  - - org.apache.cassandra.index.internal.composites.CollectionKeyIndexBase

- All Implemented Interfaces:
    Index
  Direct Known Subclasses:
    CollectionEntryIndex, CollectionKeyIndex

      public abstract class CollectionKeyIndexBase
      extends CassandraIndex

  Common superclass for indexes that capture collection keys, including indexes on such keys themselves. A cell indexed by this index will have the general form: ck_0 ... ck_n c_name [col_elt] : v where ck_i are the cluster keys, c_name the CQL3 column name, col_elt the collection element that we want to index (which may or may not be there depending on whether c_name is the collection we're indexing), and v the cell value. Such a cell is indexed if c_name is the indexed collection (in which case we are guaranteed to have col_elt). The index entry can be viewed in the following way: - the row key is determined by subclasses of this type. - the cell name will be 'rk ck_0 ... ck_n' where rk is the row key of the initial cell.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.cassandra.index.Index

      `Index.CollatedViewIndexBuildingSupport, Index.IndexBuildingSupport, Index.Indexer, Index.Searcher`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.index.internal.CassandraIndex

      `baseCfs, functions, indexCfs, indexedColumn, metadata`

    - ### Fields inherited from interface org.apache.cassandra.index.Index

      `INDEX_BUILDER_SUPPORT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectionKeyIndexBase(ColumnFamilyStore baseCfs, IndexMetadata indexDef)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CBuilder` | `buildIndexClusteringPrefix(java.nio.ByteBuffer partitionKey, ClusteringPrefix prefix, CellPath path)` Used to construct an the clustering for an entry in the index table based on values from the base data.
    `IndexEntry` | `decodeEntry(DecoratedKey indexedValue, Row indexEntry)` Used at search time to convert a row in the index table into a simple struct containing the values required to retrieve the corresponding row from the base table.

    - ### Methods inherited from class org.apache.cassandra.index.internal.CassandraIndex

      `customExpressionValueType, deleteStaleEntry, dependsOn, getBackingTable, getBlockingFlushTask, getEstimatedResultRows, getIndexCfs, getIndexComparator, getIndexedColumn, getIndexedValue, getIndexMetadata, getInitializationTask, getInvalidateTask, getMetadataReloadTask, getPostIndexQueryFilter, getTruncateTask, indexCfsMetadata, indexerFor, isStale, newIndex, postProcessorFor, register, searcherFor, shouldBuildBlocking, supportsExpression, supportsOperator, validate, validate`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.cassandra.index.Index

      `getBuildTaskSupport, getFlushObserver, getPreJoinTask`

- - ### Constructor Detail

    - #### CollectionKeyIndexBase

          public CollectionKeyIndexBase(ColumnFamilyStore baseCfs,
                                        IndexMetadata indexDef)

  - ### Method Detail

    - #### buildIndexClusteringPrefix

          public CBuilder buildIndexClusteringPrefix(java.nio.ByteBuffer partitionKey,
                                                     ClusteringPrefix prefix,
                                                     CellPath path)

      Description copied from class: `CassandraIndex`
      Used to construct an the clustering for an entry in the index table based on values from the base data. The clustering columns in the index table encode the values required to retrieve the correct data from the base table and varies depending on the kind of the indexed column. See indexCfsMetadata for more details Used whenever a row in the index table is written or deleted.
      Specified by:
        `buildIndexClusteringPrefix` in class `CassandraIndex`
      Parameters:
        `partitionKey` - from the base data being indexed
        `prefix` - from the base data being indexed
        `path` - from the base data being indexed
      Returns:
        a clustering prefix to be used to insert into the index table

    - #### decodeEntry

          public IndexEntry decodeEntry(DecoratedKey indexedValue,
                                        Row indexEntry)

      Description copied from class: `CassandraIndex`
      Used at search time to convert a row in the index table into a simple struct containing the values required to retrieve the corresponding row from the base table.
      Specified by:
        `decodeEntry` in class `CassandraIndex`
      Parameters:
        `indexedValue` - the partition key of the indexed table (i.e. the value that was indexed)
        `indexEntry` - a row from the index table
      Returns:

Copyright © 2018 The Apache Software Foundation