Package org.apache.cassandra.index
Interface IndexRegistry
- All Known Implementing Classes:
SecondaryIndexManager
public interface IndexRegistry
The collection of all Index instances for a base table.
The SecondaryIndexManager for a ColumnFamilyStore contains an IndexRegistry
(actually it implements this interface at present) and Index implementations
register in order to:
i) subscribe to the stream of updates being applied to partitions in the base table
ii) provide searchers to support queries with the relevant search predicates
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IndexRegistryAn emptyIndexRegistrystatic final IndexRegistryAnIndexRegistryintended for use when Cassandra is initialized in client or tool mode. -
Method Summary
Modifier and TypeMethodDescriptiongetBestIndexFor(RowFilter.Expression expression) getIndex(IndexMetadata indexMetadata) static IndexRegistryobtain(TableMetadata table) Returns theIndexRegistryassociated to the specified table.default voidregisterIndex(Index index) voidregisterIndex(Index index, Index.Group.Key groupKey, Supplier<Index.Group> groupSupplier) voidunregisterIndex(Index index, Index.Group.Key groupKey) voidvalidate(PartitionUpdate update, ClientState state) 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.
-
Field Details
-
EMPTY
An emptyIndexRegistry -
NON_DAEMON
AnIndexRegistryintended for use when Cassandra is initialized in client or tool mode. Contains a single stubIndexwhich possesses no actual indexing or searching capabilities but enables query validation and preparation to succeed. Useful for tools which need to prepare CQL statements without instantiating the whole ColumnFamilyStore infrastructure.
-
-
Method Details
-
registerIndex
-
registerIndex
-
unregisterIndex
-
listIndexGroups
Collection<Index.Group> listIndexGroups() -
getIndex
-
listIndexes
Collection<Index> listIndexes() -
getBestIndexFor
-
validate
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. The partition key as well as the clustering and cell values for each row in the update may be checked by index implementations- Parameters:
update- PartitionUpdate containing the values to be validated by registered Index implementationsstate- state related to the client connection
-
obtain
Returns theIndexRegistryassociated to the specified table.- Parameters:
table- the table metadata- Returns:
- the
IndexRegistryassociated to the specified table
-