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, wait
getPreJoinTask, validate
public 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)
Index
public IndexMetadata getIndexMetadata()
Index
getIndexMetadata
in interface Index
public java.util.concurrent.Callable<?> getInitializationTask()
Index
getInitializationTask
in interface Index
public java.util.concurrent.Callable<?> getMetadataReloadTask(IndexMetadata indexMetadata)
Index
getMetadataReloadTask
in interface Index
public java.util.concurrent.Callable<?> getBlockingFlushTask()
Index
getBlockingFlushTask
in interface Index
public java.util.concurrent.Callable<?> getInvalidateTask()
Index
getInvalidateTask
in interface Index
public java.util.concurrent.Callable<?> getTruncateTask(long truncatedAt)
Index
getTruncateTask
in interface Index
truncatedAt
- timestamp of the truncation operation. This will be the same timestamp used
in the truncation of the base table.public boolean shouldBuildBlocking()
Index
shouldBuildBlocking
in interface Index
public java.util.Optional<ColumnFamilyStore> getBackingTable()
Index
getBackingTable
in interface Index
public boolean indexes(PartitionColumns columns)
public boolean dependsOn(ColumnDefinition column)
Index
public boolean supportsExpression(ColumnDefinition column, Operator operator)
Index
supportsExpression
in interface Index
column
- the target column of a search query predicateoperator
- the operator of a search query predicatepublic AbstractType<?> customExpressionValueType()
Index
customExpressionValueType
in interface Index
public RowFilter getPostIndexQueryFilter(RowFilter filter)
Index
getPostIndexQueryFilter
in interface Index
filter
- the intial filter belonging to a ReadCommandpublic long getEstimatedResultRows()
Index
getEstimatedResultRows
in interface Index
public void validate(PartitionUpdate update) throws InvalidRequestException
Index
validate
in interface Index
update
- PartitionUpdate containing the values to be validated by registered Index implementationsInvalidRequestException
public Index.Indexer indexerFor(DecoratedKey key, PartitionColumns columns, int nowInSec, OpOrder.Group opGroup, IndexTransaction.Type transactionType)
Index
Indexer
object for updates to a given partition.indexerFor
in interface Index
key
- 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
Index
searcherFor
in interface Index
command
- the read command being executedInvalidRequestException
public SSTableFlushObserver getFlushObserver(Descriptor descriptor, OperationType opType)
Index
getFlushObserver
in interface Index
descriptor
- 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)
Index
postProcessorFor
in interface Index
public Index.IndexBuildingSupport getBuildTaskSupport()
Index
SecondaryIndexManager.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 Index
public void handleNotification(INotification notification, java.lang.Object sender)
handleNotification
in interface INotificationConsumer
public ColumnIndex getIndex()
protected static PerSSTableIndexWriter newWriter(AbstractType<?> keyValidator, Descriptor descriptor, java.util.Map<ColumnDefinition,ColumnIndex> indexes, OperationType opType)
Copyright © 2017 The Apache Software Foundation