org.apache.cassandra.db.index.composites

## Class CompositesIndexOnClusteringKey

- java.lang.Object
- - org.apache.cassandra.db.index.SecondaryIndex
  - - org.apache.cassandra.db.index.PerColumnSecondaryIndex
    - - org.apache.cassandra.db.index.AbstractSimplePerColumnSecondaryIndex
      - - org.apache.cassandra.db.index.composites.CompositesIndex
        - - org.apache.cassandra.db.index.composites.CompositesIndexOnClusteringKey

    public class CompositesIndexOnClusteringKey
    extends CompositesIndex

Index on a CLUSTERING_KEY column definition. A cell indexed by this index will have the general form: ck_0 ... ck_n c_name : v where ck_i are the cluster keys, c_name the last component of the cell composite name (or second to last if collections are in use, but this has no impact) and v the cell value. Such a cell is always indexed by this index (or rather, it is indexed if n >= columnDef.componentIndex, which will always be the case in practice) and it will generate (makeIndexColumnName()) an index entry whose: - row key will be ck_i (getIndexedValue()) where i == columnDef.componentIndex. - cell name will rk ck_0 ... ck_{i-1} ck_{i+1} ck_n where rk is the row key of the initial cell and i == columnDef.componentIndex.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.cassandra.db.index.composites.CompositesIndex

`CompositesIndex.IndexedEntry`

### Field Summary

### Fields inherited from class org.apache.cassandra.db.index.AbstractSimplePerColumnSecondaryIndex

`columnDef, indexCfs`

### Fields inherited from class org.apache.cassandra.db.index.SecondaryIndex

`baseCfs, columnDefs, CUSTOM_INDEX_OPTION_NAME, keyComparator, logger`

### Constructor Summary

Constructors
Constructor and Description
`CompositesIndexOnClusteringKey()`

### Method Summary

Methods
`static CompositeType` `buildIndexComparator(CFMetaData baseMetadata, ColumnDefinition columnDef)`
`CompositesIndex.IndexedEntry` `decodeEntry(DecoratedKey indexedValue, Column indexEntry)`
`protected java.nio.ByteBuffer` `getIndexedValue(java.nio.ByteBuffer rowKey, Column column)`
`boolean` `indexes(java.nio.ByteBuffer name)` Returns true if the provided column name is indexed by this secondary index.
`boolean` `isStale(CompositesIndex.IndexedEntry entry, ColumnFamily data, long now)`
`protected ColumnNameBuilder` `makeIndexColumnNameBuilder(java.nio.ByteBuffer rowKey, java.nio.ByteBuffer columnName)`

### Methods inherited from class org.apache.cassandra.db.index.composites.CompositesIndex

`create, createSecondaryIndexSearcher, delete, getBaseComparator, getExpressionComparator, getIndexComparator, getIndexComparator, makeIndexColumnName, validateOptions`

### Methods inherited from class org.apache.cassandra.db.index.AbstractSimplePerColumnSecondaryIndex

`delete, expressionString, forceBlockingFlush, getIndexCfs, getIndexName, getLiveSize, init, insert, invalidate, reload, removeIndex, truncateBlocking, update`

### Methods inherited from class org.apache.cassandra.db.index.PerColumnSecondaryIndex

`getNameForSystemKeyspace, validate`

### Methods inherited from class org.apache.cassandra.db.index.SecondaryIndex

`buildIndexAsync, buildIndexBlocking, createInstance, getBaseCfs, getColumnDefs, getIndexKeyFor, isIndexBuilt, setIndexBuilt, setIndexRemoved`

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

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

### Constructor Detail

#### CompositesIndexOnClusteringKey

    public CompositesIndexOnClusteringKey()

### Method Detail

#### buildIndexComparator

    public static CompositeType buildIndexComparator(CFMetaData baseMetadata,
                                     ColumnDefinition columnDef)

#### getIndexedValue

    protected java.nio.ByteBuffer getIndexedValue(java.nio.ByteBuffer rowKey,
                                      Column column)

Specified by:
  `getIndexedValue` in class `AbstractSimplePerColumnSecondaryIndex`

#### makeIndexColumnNameBuilder

    protected ColumnNameBuilder makeIndexColumnNameBuilder(java.nio.ByteBuffer rowKey,
                                               java.nio.ByteBuffer columnName)

Specified by:
  `makeIndexColumnNameBuilder` in class `CompositesIndex`

#### decodeEntry

    public CompositesIndex.IndexedEntry decodeEntry(DecoratedKey indexedValue,
                                           Column indexEntry)

Specified by:
  `decodeEntry` in class `CompositesIndex`

#### indexes

    public boolean indexes(java.nio.ByteBuffer name)

Description copied from class: `SecondaryIndex`
Returns true if the provided column name is indexed by this secondary index. The default implement checks whether the name is one the columnDef name, but this should be overriden but subclass if needed.

Overrides:
  `indexes` in class `SecondaryIndex`

#### isStale

    public boolean isStale(CompositesIndex.IndexedEntry entry,
                  ColumnFamily data,
                  long now)

Specified by:
  `isStale` in class `CompositesIndex`