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
Fields Modifier and Type Field Description static IndexRegistry
EMPTY
An emptyIndexRegistry
static IndexRegistry
NON_DAEMON
AnIndexRegistry
intended for use when Cassandra is initialized in client or tool mode.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Index>
getBestIndexFor(RowFilter.Expression expression)
Index
getIndex(IndexMetadata indexMetadata)
java.util.Collection<Index>
listIndexes()
java.util.Collection<Index.Group>
listIndexGroups()
static IndexRegistry
obtain(TableMetadata table)
Returns theIndexRegistry
associated to the specified table.default void
registerIndex(Index index)
void
registerIndex(Index index, Index.Group.Key groupKey, java.util.function.Supplier<Index.Group> groupSupplier)
void
unregisterIndex(Index index, Index.Group.Key groupKey)
void
validate(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 Detail
-
EMPTY
static final IndexRegistry EMPTY
An emptyIndexRegistry
-
NON_DAEMON
static final IndexRegistry NON_DAEMON
AnIndexRegistry
intended for use when Cassandra is initialized in client or tool mode. Contains a single stubIndex
which 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 Detail
-
registerIndex
default void registerIndex(Index index)
-
registerIndex
void registerIndex(Index index, Index.Group.Key groupKey, java.util.function.Supplier<Index.Group> groupSupplier)
-
unregisterIndex
void unregisterIndex(Index index, Index.Group.Key groupKey)
-
listIndexGroups
java.util.Collection<Index.Group> listIndexGroups()
-
getIndex
Index getIndex(IndexMetadata indexMetadata)
-
listIndexes
java.util.Collection<Index> listIndexes()
-
getBestIndexFor
java.util.Optional<Index> getBestIndexFor(RowFilter.Expression expression)
-
validate
void validate(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. 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
static IndexRegistry obtain(TableMetadata table)
Returns theIndexRegistry
associated to the specified table.- Parameters:
table
- the table metadata- Returns:
- the
IndexRegistry
associated to the specified table
-
-