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<Cell> indexedColumnsInRow,
OpOrder.Group opGroup)
Delete all columns from all indexes for this row.
|
void |
flushIndexesBlocking()
Flush all indexes to disk
|
SecondaryIndexManager.Updater |
gcUpdaterFor(DecoratedKey key)
Updated closure with only the modified row key.
|
java.util.List<java.lang.String> |
getBuiltIndexes() |
SecondaryIndexSearcher |
getHighestSelectivityIndexSearcher(java.util.List<IndexExpression> clause) |
SecondaryIndex |
getIndexByName(java.lang.String idxName) |
java.util.Set<SecondaryIndex> |
getIndexes() |
java.util.Set<ColumnFamilyStore> |
getIndexesBackedByCfs() |
java.util.Set<SecondaryIndex> |
getIndexesByNames(java.util.Set<java.lang.String> idxNames) |
java.util.Set<SecondaryIndex> |
getIndexesNotBackedByCfs() |
SecondaryIndex |
getIndexForColumn(java.nio.ByteBuffer column) |
java.util.List<SecondaryIndexSearcher> |
getIndexSearchersForQuery(java.util.List<IndexExpression> clause)
Get a list of IndexSearchers from the union of expression index types
|
boolean |
hasIndexes() |
boolean |
hasIndexFor(java.util.List<IndexExpression> clause) |
boolean |
indexes(Cell cell) |
boolean |
indexes(CellName name) |
boolean |
indexes(CellName name,
java.util.Set<SecondaryIndex> indexes) |
java.util.Set<SecondaryIndex> |
indexFor(CellName name) |
java.util.Set<SecondaryIndex> |
indexFor(CellName name,
java.util.Set<SecondaryIndex> indexes) |
void |
indexRow(java.nio.ByteBuffer key,
ColumnFamily cf,
OpOrder.Group opGroup)
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(ExtendedFilter filter)
Performs a search across a number of column indexes
|
void |
setIndexBuilt(java.util.Set<java.lang.String> idxNames) |
void |
setIndexRemoved(java.util.Set<java.lang.String> idxNames) |
SecondaryIndexManager.Updater |
updaterFor(DecoratedKey key,
ColumnFamily cf,
OpOrder.Group opGroup)
This helper acts as a closure around the indexManager
and updated cf data to ensure that down in
Memtable's ColumnFamily implementation, the index
can get updated.
|
SecondaryIndex |
validate(java.nio.ByteBuffer rowKey,
Cell cell) |
void |
validateIndexSearchersForQuery(java.util.List<IndexExpression> clause)
Validates an union of expression index types.
|
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(CellName name, java.util.Set<SecondaryIndex> indexes)
public java.util.Set<SecondaryIndex> indexFor(CellName name, java.util.Set<SecondaryIndex> indexes)
public boolean indexes(Cell cell)
public boolean indexes(CellName name)
public java.util.Set<SecondaryIndex> indexFor(CellName name)
public boolean hasIndexFor(java.util.List<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.util.Set<ColumnFamilyStore> getIndexesBackedByCfs()
public java.util.Set<SecondaryIndex> getIndexesNotBackedByCfs()
public java.util.Set<SecondaryIndex> getIndexes()
public boolean hasIndexes()
public void indexRow(java.nio.ByteBuffer key, ColumnFamily cf, OpOrder.Group opGroup)
key
- the row keycf
- the current rows datapublic void deleteFromIndexes(DecoratedKey key, java.util.List<Cell> indexedColumnsInRow, OpOrder.Group opGroup)
key
- the row keyindexedColumnsInRow
- all column names in rowpublic SecondaryIndexManager.Updater updaterFor(DecoratedKey key, ColumnFamily cf, OpOrder.Group opGroup)
public SecondaryIndexManager.Updater gcUpdaterFor(DecoratedKey key)
public java.util.List<SecondaryIndexSearcher> getIndexSearchersForQuery(java.util.List<IndexExpression> clause)
clause
- the query clausepublic void validateIndexSearchersForQuery(java.util.List<IndexExpression> clause) throws InvalidRequestException
RuntimeException
if
any of the expressions in the provided clause is not valid for its index implementation.clause
- the query clauseInvalidRequestException
- in case of validation errorspublic java.util.List<Row> search(ExtendedFilter filter)
filter
- the column range to restrict topublic java.util.Set<SecondaryIndex> getIndexesByNames(java.util.Set<java.lang.String> idxNames)
public SecondaryIndex getIndexByName(java.lang.String idxName)
public void setIndexBuilt(java.util.Set<java.lang.String> idxNames)
public void setIndexRemoved(java.util.Set<java.lang.String> idxNames)
public SecondaryIndex validate(java.nio.ByteBuffer rowKey, Cell cell)
public SecondaryIndexSearcher getHighestSelectivityIndexSearcher(java.util.List<IndexExpression> clause)
Copyright © 2015 The Apache Software Foundation