|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.index.SecondaryIndexManager
public class SecondaryIndexManager
Manages all the indexes associated with a given CFS Different types of indexes can be created across the same CF
Nested Class Summary | |
---|---|
static interface |
SecondaryIndexManager.Updater
|
Field Summary | |
---|---|
ColumnFamilyStore |
baseCfs
The underlying column family containing the source data for these indexes |
static SecondaryIndexManager.Updater |
nullUpdater
|
Constructor Summary | |
---|---|
SecondaryIndexManager(ColumnFamilyStore baseCfs)
|
Method Summary | |
---|---|
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,
boolean includeRowIndexes)
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final SecondaryIndexManager.Updater nullUpdater
public final ColumnFamilyStore baseCfs
Constructor Detail |
---|
public SecondaryIndexManager(ColumnFamilyStore baseCfs)
Method Detail |
---|
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 data
public SecondaryIndex getIndexForColumn(java.nio.ByteBuffer column)
column
- the name of indexes column
public 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, boolean includeRowIndexes)
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 to
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |