public class SecondaryIndexManager extends java.lang.Object implements IndexRegistry
Modifier and Type | Field and Description |
---|---|
ColumnFamilyStore |
baseCfs
The underlying column family containing the source data for these indexes
|
Constructor and Description |
---|
SecondaryIndexManager(ColumnFamilyStore baseCfs) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<?> |
addIndex(IndexMetadata indexDef)
Adds and builds a index
|
void |
buildAllIndexesBlocking(java.util.Collection<SSTableReader> sstables) |
void |
buildIndexBlocking(Index index) |
void |
deletePartition(UnfilteredRowIterator partition,
int nowInSec)
Delete all data from all indexes for this partition.
|
void |
flushAllCustomIndexesBlocking()
Performs a blocking flush of all custom indexes
|
void |
flushAllIndexesBlocking()
Perform a blocking flush all indexes
|
void |
flushIndexesBlocking(java.util.Set<Index> indexes)
Perform a blocking flush of selected indexes
|
java.util.Set<ColumnFamilyStore> |
getAllIndexColumnFamilyStores() |
Index |
getBestIndexFor(ReadCommand command) |
Index |
getBestIndexFor(ReadCommand command,
boolean includeInTrace)
Called at query time to find the most selective of the registered index implementation
(i.e.
|
java.util.List<java.lang.String> |
getBuiltIndexNames() |
Index |
getIndex(IndexMetadata metadata) |
Index |
getIndexByName(java.lang.String indexName) |
boolean |
hasIndexes() |
void |
indexPartition(UnfilteredRowIterator partition,
OpOrder.Group opGroup,
java.util.Set<Index> indexes,
int nowInSec)
When building an index against existing data in sstables, add the given partition to the index
|
void |
invalidateAllIndexesBlocking()
Remove all indexes
|
java.util.Collection<Index> |
listIndexes() |
void |
markAllIndexesRemoved()
Called when dropping a Table
|
CleanupTransaction |
newCleanupTransaction(DecoratedKey key,
PartitionColumns partitionColumns,
int nowInSec)
Transaction for use when removing partitions during cleanup
|
CompactionTransaction |
newCompactionTransaction(DecoratedKey key,
PartitionColumns partitionColumns,
int versions,
int nowInSec)
Transaction for use when merging rows during compaction
|
UpdateTransaction |
newUpdateTransaction(PartitionUpdate update,
OpOrder.Group opGroup,
int nowInSec)
Transaction for updates on the write path.
|
void |
rebuildIndexesBlocking(java.util.Collection<SSTableReader> sstables,
java.util.Set<java.lang.String> indexNames)
Does a full, blocking rebuild of the indexes specified by columns from the sstables.
|
void |
registerIndex(Index index)
IndexRegistry methods
|
void |
reload()
Drops and adds new indexes associated with the underlying CF
|
void |
removeIndex(java.lang.String indexName) |
void |
truncateAllIndexesBlocking(long truncatedAt)
Truncate all indexes
|
void |
unregisterIndex(Index index) |
void |
validate(PartitionUpdate update)
Called at write time to ensure that values present in the update
are valid according to the rules of all registered indexes which
will process it.
|
public final ColumnFamilyStore baseCfs
public SecondaryIndexManager(ColumnFamilyStore baseCfs)
public void reload()
public java.util.concurrent.Future<?> addIndex(IndexMetadata indexDef)
indexDef
- the IndexMetadata describing the indexpublic void removeIndex(java.lang.String indexName)
public void markAllIndexesRemoved()
public void rebuildIndexesBlocking(java.util.Collection<SSTableReader> sstables, java.util.Set<java.lang.String> indexNames)
sstables
- the data to build fromindexNames
- the list of indexes to be rebuiltpublic void buildAllIndexesBlocking(java.util.Collection<SSTableReader> sstables)
public void buildIndexBlocking(Index index)
public Index getIndexByName(java.lang.String indexName)
public void truncateAllIndexesBlocking(long truncatedAt)
public void invalidateAllIndexesBlocking()
public void flushAllIndexesBlocking()
public void flushIndexesBlocking(java.util.Set<Index> indexes)
public void flushAllCustomIndexesBlocking()
public java.util.List<java.lang.String> getBuiltIndexNames()
public java.util.Set<ColumnFamilyStore> getAllIndexColumnFamilyStores()
public boolean hasIndexes()
public void indexPartition(UnfilteredRowIterator partition, OpOrder.Group opGroup, java.util.Set<Index> indexes, int nowInSec)
public void deletePartition(UnfilteredRowIterator partition, int nowInSec)
public Index getBestIndexFor(ReadCommand command, boolean includeInTrace)
command
- ReadCommand to be executedpublic Index getBestIndexFor(ReadCommand command)
public void validate(PartitionUpdate update) throws InvalidRequestException
update
- PartitionUpdate containing the values to be validated by registered Index implementationsInvalidRequestException
public void registerIndex(Index index)
registerIndex
in interface IndexRegistry
public void unregisterIndex(Index index)
unregisterIndex
in interface IndexRegistry
public Index getIndex(IndexMetadata metadata)
getIndex
in interface IndexRegistry
public java.util.Collection<Index> listIndexes()
listIndexes
in interface IndexRegistry
public UpdateTransaction newUpdateTransaction(PartitionUpdate update, OpOrder.Group opGroup, int nowInSec)
public CompactionTransaction newCompactionTransaction(DecoratedKey key, PartitionColumns partitionColumns, int versions, int nowInSec)
public CleanupTransaction newCleanupTransaction(DecoratedKey key, PartitionColumns partitionColumns, int nowInSec)
Copyright © 2015 The Apache Software Foundation