AbstractSimplePerColumnSecondaryIndex (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db.index

## Class AbstractSimplePerColumnSecondaryIndex

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

- Direct Known Subclasses:
    CompositesIndex, KeysIndex

      public abstract class AbstractSimplePerColumnSecondaryIndex
      extends PerColumnSecondaryIndex

  Implements a secondary index for a column family using a second column family in which the row keys are indexed values, and column names are base row keys.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ColumnDefinition` | `columnDef`
    `protected ColumnFamilyStore` | `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
    `AbstractSimplePerColumnSecondaryIndex()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(java.nio.ByteBuffer rowKey, Cell cell, OpOrder.Group opGroup)` Delete a column from the index.
    `long` | `estimateResultRows()`
    `java.lang.String` | `expressionString(IndexExpression expr)`
    `void` | `forceBlockingFlush()` Forces this indexes' in memory data to disk
    `protected abstract AbstractType` | `getExpressionComparator()`
    `ColumnFamilyStore` | `getIndexCfs()` Allow access to the underlying column family store if there is one
    `protected abstract java.nio.ByteBuffer` | `getIndexedValue(java.nio.ByteBuffer rowKey, Cell cell)`
    `protected AbstractType<?>` | `getIndexKeyComparator()`
    `DecoratedKey` | `getIndexKeyFor(java.nio.ByteBuffer value)` Returns the decoratedKey for a column value
    `java.lang.String` | `getIndexName()`
    `void` | `init()` Perform any initialization work
    `void` | `insert(java.nio.ByteBuffer rowKey, Cell cell, OpOrder.Group opGroup)` insert a column to the index
    `void` | `invalidate()` Remove the index and unregisters this index's mbean if one exists
    `protected abstract CellName` | `makeIndexColumnName(java.nio.ByteBuffer rowKey, Cell cell)`
    `void` | `reload()` Reload an existing index following a change to its configuration, or that of the indexed column(s).
    `void` | `removeIndex(java.nio.ByteBuffer columnName)` Delete all files and references to this index
    `void` | `truncateBlocking(long truncatedAt)` Truncate all the data from the current index
    `void` | `update(java.nio.ByteBuffer rowKey, Cell oldCol, Cell col, OpOrder.Group opGroup)` update a column from the index

    - ### 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, createSecondaryIndexSearcher, getBaseCfs, getColumnDefs, getIndexComparator, indexes, isIndexBuilt, setIndexBuilt, setIndexRemoved, validateOptions`

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

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

- - ### Field Detail

    - #### indexCfs

          protected ColumnFamilyStore indexCfs

    - #### columnDef

          protected ColumnDefinition columnDef

  - ### Constructor Detail

    - #### AbstractSimplePerColumnSecondaryIndex

          public AbstractSimplePerColumnSecondaryIndex()

  - ### Method Detail

    - #### init

          public void init()

      Description copied from class: `SecondaryIndex`
      Perform any initialization work
      Specified by:
        `init` in class `SecondaryIndex`

    - #### getIndexKeyComparator

          protected AbstractType<?> getIndexKeyComparator()

    - #### getIndexKeyFor

          public DecoratedKey getIndexKeyFor(java.nio.ByteBuffer value)

      Description copied from class: `SecondaryIndex`
      Returns the decoratedKey for a column value
      Overrides:
        `getIndexKeyFor` in class `SecondaryIndex`
      Parameters:
        `value` - column value
      Returns:
        decorated key

    - #### makeIndexColumnName

          protected abstract CellName makeIndexColumnName(java.nio.ByteBuffer rowKey,
                                     Cell cell)

    - #### getIndexedValue

          protected abstract java.nio.ByteBuffer getIndexedValue(java.nio.ByteBuffer rowKey,
                                            Cell cell)

    - #### getExpressionComparator

          protected abstract AbstractType getExpressionComparator()

    - #### expressionString

          public java.lang.String expressionString(IndexExpression expr)

    - #### delete

          public void delete(java.nio.ByteBuffer rowKey,
                    Cell cell,
                    OpOrder.Group opGroup)

      Description copied from class: `PerColumnSecondaryIndex`
      Delete a column from the index.
      Specified by:
        `delete` in class `PerColumnSecondaryIndex`
      Parameters:
        `rowKey` - the underlying row key which is indexed
        `cell` - all the column info

    - #### insert

          public void insert(java.nio.ByteBuffer rowKey,
                    Cell cell,
                    OpOrder.Group opGroup)

      Description copied from class: `PerColumnSecondaryIndex`
      insert a column to the index
      Specified by:
        `insert` in class `PerColumnSecondaryIndex`
      Parameters:
        `rowKey` - the underlying row key which is indexed
        `cell` - all the column info

    - #### update

          public void update(java.nio.ByteBuffer rowKey,
                    Cell oldCol,
                    Cell col,
                    OpOrder.Group opGroup)

      Description copied from class: `PerColumnSecondaryIndex`
      update a column from the index
      Specified by:
        `update` in class `PerColumnSecondaryIndex`
      Parameters:
        `rowKey` - the underlying row key which is indexed
        `oldCol` - the previous column info
        `col` - all the column info

    - #### removeIndex

          public void removeIndex(java.nio.ByteBuffer columnName)

      Description copied from class: `SecondaryIndex`
      Delete all files and references to this index
      Specified by:
        `removeIndex` in class `SecondaryIndex`
      Parameters:
        `columnName` - the indexed column to remove

    - #### forceBlockingFlush

          public void forceBlockingFlush()

      Description copied from class: `SecondaryIndex`
      Forces this indexes' in memory data to disk
      Specified by:
        `forceBlockingFlush` in class `SecondaryIndex`

    - #### invalidate

          public void invalidate()

      Description copied from class: `SecondaryIndex`
      Remove the index and unregisters this index's mbean if one exists
      Specified by:
        `invalidate` in class `SecondaryIndex`

    - #### truncateBlocking

          public void truncateBlocking(long truncatedAt)

      Description copied from class: `SecondaryIndex`
      Truncate all the data from the current index
      Specified by:
        `truncateBlocking` in class `SecondaryIndex`
      Parameters:
        `truncatedAt` - The truncation timestamp, all data before that timestamp should be rejected.

    - #### getIndexCfs

          public ColumnFamilyStore getIndexCfs()

      Description copied from class: `SecondaryIndex`
      Allow access to the underlying column family store if there is one
      Specified by:
        `getIndexCfs` in class `SecondaryIndex`
      Returns:
        the underlying column family store or null

    - #### getIndexName

          public java.lang.String getIndexName()

      Specified by:
        `getIndexName` in class `SecondaryIndex`
      Returns:
        The name of the index

    - #### reload

          public void reload()

      Description copied from class: `SecondaryIndex`
      Reload an existing index following a change to its configuration, or that of the indexed column(s). Differs from init() in that we expect expect new resources (such as CFS for a KEYS index) to be created by init() but not here
      Specified by:
        `reload` in class `SecondaryIndex`

    - #### estimateResultRows

          public long estimateResultRows()

      Specified by:
        `estimateResultRows` in class `SecondaryIndex`

Copyright © 2014 The Apache Software Foundation