org.apache.cassandra.db.index
Class PerRowSecondaryIndex

java.lang.Object
  extended by org.apache.cassandra.db.index.SecondaryIndex
      extended by org.apache.cassandra.db.index.PerRowSecondaryIndex

public abstract class PerRowSecondaryIndex
extends SecondaryIndex

Base class for Secondary indexes that implement a unique index per row


Field Summary
 
Fields inherited from class org.apache.cassandra.db.index.SecondaryIndex
baseCfs, columnDefs, CUSTOM_INDEX_OPTION_NAME
 
Constructor Summary
PerRowSecondaryIndex()
           
 
Method Summary
abstract  void applyIndexUpdates(java.nio.ByteBuffer rowKey, ColumnFamily cf, java.util.SortedSet<java.nio.ByteBuffer> mutatedIndexedColumns, ColumnFamily oldIndexedColumns)
          Removes obsolete index entries and creates new ones for the given row key and mutated columns.
abstract  void deleteFromIndex(DecoratedKey<?> key, java.util.List<IColumn> indexedColumnsInRow)
          cleans up deleted columns from cassandra cleanup compaction
 java.lang.String getNameForSystemTable(java.nio.ByteBuffer columnName)
          Return the unique name for this index and column to be stored in the SystemTable that tracks if each column is built
 
Methods inherited from class org.apache.cassandra.db.index.SecondaryIndex
buildIndexAsync, buildIndexBlocking, createInstance, createSecondaryIndexSearcher, forceBlockingFlush, getBaseCFStore, getIndexName, getUnderlyingCfs, init, isIndexBuilt, removeIndex, renameIndex, unregisterMbean, validateOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerRowSecondaryIndex

public PerRowSecondaryIndex()
Method Detail

applyIndexUpdates

public abstract void applyIndexUpdates(java.nio.ByteBuffer rowKey,
                                       ColumnFamily cf,
                                       java.util.SortedSet<java.nio.ByteBuffer> mutatedIndexedColumns,
                                       ColumnFamily oldIndexedColumns)
                                throws java.io.IOException
Removes obsolete index entries and creates new ones for the given row key and mutated columns.

Parameters:
rowKey - the row key
cf - the current rows data
mutatedIndexedColumns - the set of columns that were changed or added
oldIndexedColumns - the columns which were deleted
Throws:
java.io.IOException

deleteFromIndex

public abstract void deleteFromIndex(DecoratedKey<?> key,
                                     java.util.List<IColumn> indexedColumnsInRow)
cleans up deleted columns from cassandra cleanup compaction

Parameters:
key -
indexedColumnsInRow -

getNameForSystemTable

public java.lang.String getNameForSystemTable(java.nio.ByteBuffer columnName)
Description copied from class: SecondaryIndex
Return the unique name for this index and column to be stored in the SystemTable that tracks if each column is built

Specified by:
getNameForSystemTable in class SecondaryIndex
Parameters:
columnName - the name of the column
Returns:
the unique name


Copyright © 2011 The Apache Software Foundation