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 Details

    • EMPTY

      static final IndexRegistry EMPTY
      An empty IndexRegistry
    • NON_DAEMON

      static final IndexRegistry NON_DAEMON
      An IndexRegistry intended for use when Cassandra is initialized in client or tool mode. Contains a single stub Index 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 Details

    • registerIndex

      default void registerIndex(Index index)
    • registerIndex

      void registerIndex(Index index, Index.Group.Key groupKey, Supplier<Index.Group> groupSupplier)
    • unregisterIndex

      void unregisterIndex(Index index, Index.Group.Key groupKey)
    • listIndexGroups

      Collection<Index.Group> listIndexGroups()
    • getIndex

      Index getIndex(IndexMetadata indexMetadata)
    • listIndexes

      Collection<Index> listIndexes()
    • getBestIndexFor

      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 implementations
      state - state related to the client connection
    • obtain

      static IndexRegistry obtain(TableMetadata table)
      Returns the IndexRegistry associated to the specified table.
      Parameters:
      table - the table metadata
      Returns:
      the IndexRegistry associated to the specified table