Package org.apache.cassandra.index
Interface IndexRegistry
-
- All Known Implementing Classes:
SecondaryIndexManager
public interface IndexRegistryThe 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 IndexRegistryEMPTYAn emptyIndexRegistrystatic IndexRegistryNON_DAEMONAnIndexRegistryintended for use when Cassandra is initialized in client or tool mode.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<Index>getBestIndexFor(RowFilter.Expression expression)IndexgetIndex(IndexMetadata indexMetadata)java.util.Collection<Index>listIndexes()static IndexRegistryobtain(TableMetadata table)Returns theIndexRegistryassociated to the specified table.voidregisterIndex(Index index)voidunregisterIndex(Index index)voidvalidate(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.
-
-
-
Field Detail
-
EMPTY
static final IndexRegistry EMPTY
An emptyIndexRegistry
-
NON_DAEMON
static final IndexRegistry 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 Detail
-
registerIndex
void registerIndex(Index index)
-
unregisterIndex
void unregisterIndex(Index index)
-
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)
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 implementations
-
obtain
static IndexRegistry obtain(TableMetadata table)
Returns theIndexRegistryassociated to the specified table.- Parameters:
table- the table metadata- Returns:
- the
IndexRegistryassociated to the specified table
-
-