public class SecondaryIndexManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SecondaryIndexManager.Updater |
Modifier and Type | Field and Description |
---|---|
ColumnFamilyStore |
baseCfs
The underlying column family containing the source data for these indexes
|
static SecondaryIndexManager.Updater |
nullUpdater |
Constructor and Description |
---|
SecondaryIndexManager(ColumnFamilyStore baseCfs) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<?> |
addIndexedColumn(ColumnDefinition cdef)
Adds and builds a index for a column
|
java.util.Set<java.lang.String> |
allIndexesNames() |
void |
deleteFromIndexes(DecoratedKey key,
java.util.List<IColumn> indexedColumnsInRow)
Delete all columns from all indexes for this row.
|
void |
flushIndexesBlocking()
Flush all indexes to disk
|
java.util.List<java.lang.String> |
getBuiltIndexes() |
java.nio.ByteBuffer |
getColumnByIdxName(java.lang.String idxName) |
java.util.Collection<SecondaryIndex> |
getIndexes() |
java.util.Collection<ColumnFamilyStore> |
getIndexesBackedByCfs() |
java.util.Collection<SecondaryIndex> |
getIndexesByNames(java.util.Set<java.lang.String> idxNames) |
java.util.Collection<SecondaryIndex> |
getIndexesNotBackedByCfs() |
SecondaryIndex |
getIndexForColumn(java.nio.ByteBuffer column) |
long |
getTotalLiveSize() |
boolean |
hasIndexFor(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause) |
boolean |
indexes(java.nio.ByteBuffer name) |
boolean |
indexes(java.nio.ByteBuffer name,
java.util.Collection<SecondaryIndex> indexes) |
boolean |
indexes(IColumn column) |
SecondaryIndex |
indexFor(java.nio.ByteBuffer name) |
SecondaryIndex |
indexFor(java.nio.ByteBuffer name,
java.util.Collection<SecondaryIndex> indexes) |
void |
indexRow(java.nio.ByteBuffer key,
ColumnFamily cf)
When building an index against existing data, add the given row to the index
|
void |
invalidate()
Remove the index
|
void |
maybeBuildSecondaryIndexes(java.util.Collection<SSTableReader> sstables,
java.util.Set<java.lang.String> idxNames)
Does a full, blocking rebuild of the indexes specified by columns from the sstables.
|
void |
reload()
Drops and adds new indexes associated with the underlying CF
|
void |
removeIndexedColumn(java.nio.ByteBuffer column)
Removes a existing index
|
java.util.List<Row> |
search(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause,
AbstractBounds<RowPosition> range,
int maxResults,
IDiskAtomFilter dataFilter,
boolean countCQL3Rows)
Performs a search across a number of column indexes
TODO: add support for querying across index types
|
void |
setIndexBuilt(java.util.Set<java.lang.String> idxNames) |
void |
setIndexRemoved(java.util.Set<java.lang.String> idxNames) |
SecondaryIndexManager.Updater |
updaterFor(DecoratedKey key)
This helper acts as a closure around the indexManager
and row key to ensure that down in Memtable's ColumnFamily implementation, the index
can get updated.
|
boolean |
validate(org.apache.cassandra.thrift.Column column) |
public static final SecondaryIndexManager.Updater nullUpdater
public final ColumnFamilyStore baseCfs
public SecondaryIndexManager(ColumnFamilyStore baseCfs)
public void reload()
public java.util.Set<java.lang.String> allIndexesNames()
public void maybeBuildSecondaryIndexes(java.util.Collection<SSTableReader> sstables, java.util.Set<java.lang.String> idxNames)
sstables
- the data to build fromidxNames
- the list of columns to index, ordered by comparatorpublic boolean indexes(java.nio.ByteBuffer name, java.util.Collection<SecondaryIndex> indexes)
public SecondaryIndex indexFor(java.nio.ByteBuffer name, java.util.Collection<SecondaryIndex> indexes)
public boolean indexes(IColumn column)
public boolean indexes(java.nio.ByteBuffer name)
public SecondaryIndex indexFor(java.nio.ByteBuffer name)
public boolean hasIndexFor(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause)
public void removeIndexedColumn(java.nio.ByteBuffer column)
column
- the indexed column to removepublic java.util.concurrent.Future<?> addIndexedColumn(ColumnDefinition cdef)
cdef
- the column definition holding the index datapublic SecondaryIndex getIndexForColumn(java.nio.ByteBuffer column)
column
- the name of indexes columnpublic void invalidate()
public void flushIndexesBlocking()
public java.util.List<java.lang.String> getBuiltIndexes()
public java.nio.ByteBuffer getColumnByIdxName(java.lang.String idxName)
public java.util.Collection<ColumnFamilyStore> getIndexesBackedByCfs()
public java.util.Collection<SecondaryIndex> getIndexesNotBackedByCfs()
public java.util.Collection<SecondaryIndex> getIndexes()
public long getTotalLiveSize()
public void indexRow(java.nio.ByteBuffer key, ColumnFamily cf)
key
- the row keycf
- the current rows datapublic void deleteFromIndexes(DecoratedKey key, java.util.List<IColumn> indexedColumnsInRow)
key
- the row keyindexedColumnsInRow
- all column names in rowpublic SecondaryIndexManager.Updater updaterFor(DecoratedKey key)
public java.util.List<Row> search(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean countCQL3Rows)
clause
- the index query clauserange
- the row range to restrict todataFilter
- the column range to restrict topublic java.util.Collection<SecondaryIndex> getIndexesByNames(java.util.Set<java.lang.String> idxNames)
public void setIndexBuilt(java.util.Set<java.lang.String> idxNames)
public void setIndexRemoved(java.util.Set<java.lang.String> idxNames)
public boolean validate(org.apache.cassandra.thrift.Column column)
Copyright © 2013 The Apache Software Foundation