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(UnfilteredRowIterator partition,
OpOrder.Group opGroup,
int nowInSec)
Delete all data from all indexes for this partition.
|
void |
flushIndexesBlocking()
Flush all indexes to disk
|
SecondaryIndexManager.Updater |
gcUpdaterFor(DecoratedKey key,
int nowInSec)
Updated closure with only the modified row key.
|
SecondaryIndexSearcher |
getBestIndexSearcherFor(ReadCommand command) |
java.util.List<java.lang.String> |
getBuiltIndexes() |
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(ColumnDefinition column) |
java.util.List<SecondaryIndexSearcher> |
getIndexSearchersFor(ReadCommand command)
Get a list of IndexSearchers from the union of expression index types
|
boolean |
hasIndexes() |
boolean |
indexes(ColumnDefinition column) |
void |
indexPartition(UnfilteredRowIterator partition,
OpOrder.Group opGroup,
java.util.Set<SecondaryIndex> allIndexes,
int nowInSec)
When building an index against existing data, add the given partition 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.
|
java.util.Set<PerColumnSecondaryIndex> |
perColumnIndexes() |
java.util.Set<PerRowSecondaryIndex> |
perRowIndexes() |
void |
reload()
Drops and adds new indexes associated with the underlying CF
|
void |
removeIndexedColumn(java.nio.ByteBuffer column)
Removes a existing index
|
void |
setIndexBuilt(java.util.Set<java.lang.String> idxNames) |
void |
setIndexRemoved(java.util.Set<java.lang.String> idxNames) |
SecondaryIndexManager.Updater |
updaterFor(PartitionUpdate update,
OpOrder.Group opGroup,
int nowInSec)
This helper acts as a closure around the indexManager and updated data
to ensure that down in Memtable's ColumnFamily implementation, the index
can get updated.
|
void |
validate(Clustering clustering) |
void |
validate(ColumnDefinition column,
java.nio.ByteBuffer value,
CellPath path) |
void |
validate(DecoratedKey partitionKey) |
void |
validateFilter(RowFilter filter)
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 java.util.Set<PerColumnSecondaryIndex> perColumnIndexes()
public java.util.Set<PerRowSecondaryIndex> perRowIndexes()
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(ColumnDefinition column)
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(ColumnDefinition 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 indexPartition(UnfilteredRowIterator partition, OpOrder.Group opGroup, java.util.Set<SecondaryIndex> allIndexes, int nowInSec)
public void deleteFromIndexes(UnfilteredRowIterator partition, OpOrder.Group opGroup, int nowInSec)
public SecondaryIndexManager.Updater updaterFor(PartitionUpdate update, OpOrder.Group opGroup, int nowInSec)
public SecondaryIndexManager.Updater gcUpdaterFor(DecoratedKey key, int nowInSec)
public java.util.List<SecondaryIndexSearcher> getIndexSearchersFor(ReadCommand command)
command
- the querypublic SecondaryIndexSearcher getBestIndexSearcherFor(ReadCommand command)
public void validateFilter(RowFilter filter) throws InvalidRequestException
InvalidRequestException
if
any of the expressions in the provided clause is not valid for its index implementation.filter
- the filter to checkInvalidRequestException
- in case of validation errorspublic 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 void validate(DecoratedKey partitionKey) throws InvalidRequestException
InvalidRequestException
public void validate(Clustering clustering) throws InvalidRequestException
InvalidRequestException
public void validate(ColumnDefinition column, java.nio.ByteBuffer value, CellPath path) throws InvalidRequestException
InvalidRequestException
Copyright © 2015 The Apache Software Foundation