org.apache.cassandra.db.index.composites
Class CompositesIndex

java.lang.Object
  extended by org.apache.cassandra.db.index.SecondaryIndex
      extended by org.apache.cassandra.db.index.PerColumnSecondaryIndex
          extended by org.apache.cassandra.db.index.AbstractSimplePerColumnSecondaryIndex
              extended by org.apache.cassandra.db.index.composites.CompositesIndex

public class CompositesIndex
extends AbstractSimplePerColumnSecondaryIndex

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
static java.lang.String PREFIX_SIZE_OPTION
           
 
Fields inherited from class org.apache.cassandra.db.index.SecondaryIndex
baseCfs, columnDefs, CUSTOM_INDEX_OPTION_NAME, logger
 
Constructor Summary
CompositesIndex()
           
 
Method Summary
 SecondaryIndexSearcher createSecondaryIndexSearcher(java.util.Set<java.nio.ByteBuffer> columns)
          Called at query time Creates a implementation specific searcher instance for this index type
protected  AbstractType getExpressionComparator()
           
 boolean indexes(java.nio.ByteBuffer name)
          Returns true if the provided column name is indexed by this secondary index.
 void init(ColumnDefinition columnDef)
           
protected  java.nio.ByteBuffer makeIndexColumnName(java.nio.ByteBuffer rowKey, IColumn column)
           
 void validateOptions()
          Validates the index_options passed in the ColumnDef
 
Methods inherited from class org.apache.cassandra.db.index.AbstractSimplePerColumnSecondaryIndex
delete, expressionString, forceBlockingFlush, getIndexCfs, getIndexName, getLiveSize, init, insert, invalidate, reload, removeIndex, truncate, update
 
Methods inherited from class org.apache.cassandra.db.index.PerColumnSecondaryIndex
getNameForSystemTable, validate
 
Methods inherited from class org.apache.cassandra.db.index.SecondaryIndex
buildIndexAsync, buildIndexBlocking, createInstance, getBaseCfs, getColumnDefs, getIndexComparator, getIndexKeyFor, isIndexBuilt, setIndexBuilt, setIndexRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_SIZE_OPTION

public static final java.lang.String PREFIX_SIZE_OPTION
See Also:
Constant Field Values
Constructor Detail

CompositesIndex

public CompositesIndex()
Method Detail

init

public void init(ColumnDefinition columnDef)
Specified by:
init in class AbstractSimplePerColumnSecondaryIndex

makeIndexColumnName

protected java.nio.ByteBuffer makeIndexColumnName(java.nio.ByteBuffer rowKey,
                                                  IColumn column)
Specified by:
makeIndexColumnName in class AbstractSimplePerColumnSecondaryIndex

getExpressionComparator

protected AbstractType getExpressionComparator()
Specified by:
getExpressionComparator in class AbstractSimplePerColumnSecondaryIndex

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

createSecondaryIndexSearcher

public SecondaryIndexSearcher createSecondaryIndexSearcher(java.util.Set<java.nio.ByteBuffer> columns)
Description copied from class: SecondaryIndex
Called at query time Creates a implementation specific searcher instance for this index type

Specified by:
createSecondaryIndexSearcher in class SecondaryIndex
Parameters:
columns - the list of columns which belong to this index type
Returns:
the secondary index search impl

validateOptions

public void validateOptions()
                     throws ConfigurationException
Description copied from class: SecondaryIndex
Validates the index_options passed in the ColumnDef

Specified by:
validateOptions in class SecondaryIndex
Throws:
ConfigurationException


Copyright © 2012 The Apache Software Foundation