Package org.apache.cassandra.index
Class SingletonIndexGroup
java.lang.Object
org.apache.cassandra.index.SingletonIndexGroup
- All Implemented Interfaces:
Index.Group
- Direct Known Subclasses:
SASIIndexGroup
An
Index.Group containing a single Index, to which it just delegates the calls.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.index.Index.Group
Index.Group.Key -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsIndex(Index index) Returns if this group contains the specifiedIndex.Returns the SSTable-attachedComponents created by this index group.getFlushObserver(Descriptor descriptor, LifecycleNewTracker tracker, TableMetadata tableMetadata) Get flush observer to observe partition/cell events generated by flushing SSTable (memtable flush or compaction).getIndex()Returns the indexes that are members of this group.indexerFor(Predicate<Index> indexSelector, DecoratedKey key, RegularAndStaticColumns columns, long nowInSec, WriteContext ctx, IndexTransaction.Type transactionType, Memtable memtable) Creates an newIndexerobject for updates to a given partition.queryPlanFor(RowFilter rowFilter) Returns a newIndex.QueryPlanfor the specifiedRowFilter, ornullif none of the indexes in this group supports the expression in the row filter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.index.Index.Group
addIndex, handles, invalidate, isSingleton, removeIndex, supportsL0Shards, validateSSTableAttachedIndexes
-
Constructor Details
-
SingletonIndexGroup
-
-
Method Details
-
getIndexes
Description copied from interface:Index.GroupReturns the indexes that are members of this group.- Specified by:
getIndexesin interfaceIndex.Group- Returns:
- the indexes that are members of this group
-
getIndex
-
containsIndex
Description copied from interface:Index.GroupReturns if this group contains the specifiedIndex.- Specified by:
containsIndexin interfaceIndex.Group- Parameters:
index- the index to be removed- Returns:
trueif this group containsindex,falseotherwise
-
indexerFor
public Index.Indexer indexerFor(Predicate<Index> indexSelector, DecoratedKey key, RegularAndStaticColumns columns, long nowInSec, WriteContext ctx, IndexTransaction.Type transactionType, Memtable memtable) Description copied from interface:Index.GroupCreates an newIndexerobject for updates to a given partition.- Specified by:
indexerForin interfaceIndex.Group- Parameters:
indexSelector- a predicate selecting the targeted memberskey- 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 ofcolumns.nowInSec- current time of the update operationctx- WriteContext 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 compactionmemtable- theMemtableto which the updates are being applied ornullif the source of the updates is an existingSSTable- Returns:
- the newly created indexer or
nullif 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, ...).
-
queryPlanFor
Description copied from interface:Index.GroupReturns a newIndex.QueryPlanfor the specifiedRowFilter, ornullif none of the indexes in this group supports the expression in the row filter.- Specified by:
queryPlanForin interfaceIndex.Group- Parameters:
rowFilter- a row filter- Returns:
- a new query plan for the specified
RowFilterif it's supported,nullotherwise
-
getFlushObserver
public SSTableFlushObserver getFlushObserver(Descriptor descriptor, LifecycleNewTracker tracker, TableMetadata tableMetadata) Description copied from interface:Index.GroupGet flush observer to observe partition/cell events generated by flushing SSTable (memtable flush or compaction).- Specified by:
getFlushObserverin interfaceIndex.Group- Parameters:
descriptor- The descriptor of the sstable observer is requested for.tracker- TheLifecycleNewTrackerassociated with the SSTable being writtentableMetadata- The immutable metadata of the table at the moment the SSTable is flushed- Returns:
- SSTable flush observer.
-
getComponents
Description copied from interface:Index.GroupReturns the SSTable-attachedComponents created by this index group.- Specified by:
getComponentsin interfaceIndex.Group- Returns:
- the SSTable components created by this group
-