public class SASIIndex extends java.lang.Object implements Index, INotificationConsumer
Index.CollatedViewIndexBuildingSupport, Index.IndexBuildingSupport, Index.Indexer, Index.Searcher| Constructor and Description |
|---|
SASIIndex(ColumnFamilyStore baseCfs,
IndexMetadata config) |
| Modifier and Type | Method and Description |
|---|---|
AbstractType<?> |
customExpressionValueType()
If the index supports custom search expressions using the
SELECT * FROM table WHERE expr(index_name, expression) syntax, this
method should return the expected type of the expression argument.
|
boolean |
dependsOn(ColumnDefinition column)
Called to determine whether this index targets a specific column.
|
java.util.Optional<ColumnFamilyStore> |
getBackingTable()
If the index implementation uses a local table to store its index data this method should return a
handle to it.
|
java.util.concurrent.Callable<?> |
getBlockingFlushTask()
Return a task which performs a blocking flush of the index's data to persistent storage.
|
Index.IndexBuildingSupport |
getBuildTaskSupport()
Get an instance of a helper to provide tasks for building the index from a set of SSTable data.
|
long |
getEstimatedResultRows()
Return an estimate of the number of results this index is expected to return for any given
query that it can be used to answer.
|
SSTableFlushObserver |
getFlushObserver(Descriptor descriptor,
OperationType opType)
Get flush observer to observe partition/cell events generated by flushing SSTable (memtable flush or compaction).
|
ColumnIndex |
getIndex() |
IndexMetadata |
getIndexMetadata()
Returns the IndexMetadata which configures and defines the index instance.
|
java.util.concurrent.Callable<?> |
getInitializationTask()
Return a task to perform any initialization work when a new index instance is created.
|
java.util.concurrent.Callable<?> |
getInvalidateTask()
Return a task which invalidates the index, indicating it should no longer be considered usable.
|
java.util.concurrent.Callable<?> |
getMetadataReloadTask(IndexMetadata indexMetadata)
Return a task to reload the internal metadata of an index.
|
RowFilter |
getPostIndexQueryFilter(RowFilter filter)
Transform an initial RowFilter into the filter that will still need to applied
to a set of Rows after the index has performed it's initial scan.
|
java.util.concurrent.Callable<?> |
getTruncateTask(long truncatedAt)
Return a task to truncate the index with the specified truncation timestamp.
|
void |
handleNotification(INotification notification,
java.lang.Object sender) |
Index.Indexer |
indexerFor(DecoratedKey key,
PartitionColumns columns,
int nowInSec,
OpOrder.Group opGroup,
IndexTransaction.Type transactionType)
Creates an new
Indexer object for updates to a given partition. |
boolean |
indexes(PartitionColumns columns) |
protected static PerSSTableIndexWriter |
newWriter(AbstractType<?> keyValidator,
Descriptor descriptor,
java.util.Map<ColumnDefinition,ColumnIndex> indexes,
OperationType opType) |
java.util.function.BiFunction<PartitionIterator,ReadCommand,PartitionIterator> |
postProcessorFor(ReadCommand command)
Return a function which performs post processing on the results of a partition range read command.
|
void |
register(IndexRegistry registry)
An index must be registered in order to be able to either subscribe to update events on the base
table and/or to provide Searcher functionality for reads.
|
Index.Searcher |
searcherFor(ReadCommand command)
Factory method for query time search helper.
|
boolean |
shouldBuildBlocking()
Return true if this index can be built or rebuilt when the index manager determines it is necessary.
|
boolean |
supportsExpression(ColumnDefinition column,
Operator operator)
Called to determine whether this index can provide a searcher to execute a query on the
supplied column using the specified operator.
|
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.
|
static java.util.Map<java.lang.String,java.lang.String> |
validateOptions(java.util.Map<java.lang.String,java.lang.String> options,
CFMetaData cfm)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPreJoinTask, validatepublic SASIIndex(ColumnFamilyStore baseCfs, IndexMetadata config)
public static java.util.Map<java.lang.String,java.lang.String> validateOptions(java.util.Map<java.lang.String,java.lang.String> options,
CFMetaData cfm)
public void register(IndexRegistry registry)
Indexpublic IndexMetadata getIndexMetadata()
IndexgetIndexMetadata in interface Indexpublic java.util.concurrent.Callable<?> getInitializationTask()
IndexgetInitializationTask in interface Indexpublic java.util.concurrent.Callable<?> getMetadataReloadTask(IndexMetadata indexMetadata)
IndexgetMetadataReloadTask in interface Indexpublic java.util.concurrent.Callable<?> getBlockingFlushTask()
IndexgetBlockingFlushTask in interface Indexpublic java.util.concurrent.Callable<?> getInvalidateTask()
IndexgetInvalidateTask in interface Indexpublic java.util.concurrent.Callable<?> getTruncateTask(long truncatedAt)
IndexgetTruncateTask in interface IndextruncatedAt - timestamp of the truncation operation. This will be the same timestamp used
in the truncation of the base table.public boolean shouldBuildBlocking()
IndexshouldBuildBlocking in interface Indexpublic java.util.Optional<ColumnFamilyStore> getBackingTable()
IndexgetBackingTable in interface Indexpublic boolean indexes(PartitionColumns columns)
public boolean dependsOn(ColumnDefinition column)
Indexpublic boolean supportsExpression(ColumnDefinition column, Operator operator)
IndexsupportsExpression in interface Indexcolumn - the target column of a search query predicateoperator - the operator of a search query predicatepublic AbstractType<?> customExpressionValueType()
IndexcustomExpressionValueType in interface Indexpublic RowFilter getPostIndexQueryFilter(RowFilter filter)
IndexgetPostIndexQueryFilter in interface Indexfilter - the intial filter belonging to a ReadCommandpublic long getEstimatedResultRows()
IndexgetEstimatedResultRows in interface Indexpublic void validate(PartitionUpdate update) throws InvalidRequestException
Indexvalidate in interface Indexupdate - PartitionUpdate containing the values to be validated by registered Index implementationsInvalidRequestExceptionpublic Index.Indexer indexerFor(DecoratedKey key, PartitionColumns columns, int nowInSec, OpOrder.Group opGroup, IndexTransaction.Type transactionType)
IndexIndexer object for updates to a given partition.indexerFor in interface Indexkey - key of the partition being modifiedcolumns - the regular and static columns the created indexer will have to deal with.
This can be empty as an update might only contain partition, range and row deletions, but
the indexer is guaranteed to not get any cells for a column that is not part of columns.nowInSec - current time of the update operationopGroup - operation group spanning the update operationtransactionType - indicates what kind of update is being performed on the base data
i.e. a write time insert/update/delete or the result of compactionnull if the index is not interested by the update
(this could be because the index doesn't care about that particular partition, doesn't care about
that type of transaction, ...).public Index.Searcher searcherFor(ReadCommand command) throws InvalidRequestException
IndexsearcherFor in interface Indexcommand - the read command being executedInvalidRequestExceptionpublic SSTableFlushObserver getFlushObserver(Descriptor descriptor, OperationType opType)
IndexgetFlushObserver in interface Indexdescriptor - The descriptor of the sstable observer is requested for.opType - The type of the operation which requests observer e.g. memtable flush or compaction.public java.util.function.BiFunction<PartitionIterator,ReadCommand,PartitionIterator> postProcessorFor(ReadCommand command)
IndexpostProcessorFor in interface Indexpublic Index.IndexBuildingSupport getBuildTaskSupport()
IndexSecondaryIndexManager.buildIndexesBlocking groups
those with the same IndexBuildingSupport instance, allowing multiple indexes to be built with a
single pass through the data. The singleton instance returned from the default method implementation builds
indexes using a ReducingKeyIterator to provide a collated view of the SSTable data.getBuildTaskSupport in interface Indexpublic void handleNotification(INotification notification, java.lang.Object sender)
handleNotification in interface INotificationConsumerpublic ColumnIndex getIndex()
protected static PerSSTableIndexWriter newWriter(AbstractType<?> keyValidator, Descriptor descriptor, java.util.Map<ColumnDefinition,ColumnIndex> indexes, OperationType opType)
Copyright © 2018 The Apache Software Foundation