Package org.apache.cassandra.index
Class SingletonIndexGroup
- java.lang.Object
-
- org.apache.cassandra.index.SingletonIndexGroup
-
- All Implemented Interfaces:
Index.Group
- Direct Known Subclasses:
SASIIndexGroup
public class SingletonIndexGroup extends java.lang.Object implements Index.Group
AnIndex.Group
containing a singleIndex
, 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 Modifier Constructor Description protected
SingletonIndexGroup(Index delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsIndex(Index index)
Returns if this group contains the specifiedIndex
.java.util.Set<Component>
getComponents()
Returns the SSTable-attachedComponent
s created by this index group.SSTableFlushObserver
getFlushObserver(Descriptor descriptor, LifecycleNewTracker tracker, TableMetadata tableMetadata)
Get flush observer to observe partition/cell events generated by flushing SSTable (memtable flush or compaction).Index
getIndex()
java.util.Set<Index>
getIndexes()
Returns the indexes that are members of this group.Index.Indexer
indexerFor(java.util.function.Predicate<Index> indexSelector, DecoratedKey key, RegularAndStaticColumns columns, long nowInSec, WriteContext ctx, IndexTransaction.Type transactionType, Memtable memtable)
Creates an newIndexer
object for updates to a given partition.Index.QueryPlan
queryPlanFor(RowFilter rowFilter)
Returns a newIndex.QueryPlan
for the specifiedRowFilter
, ornull
if 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, wait
-
Methods inherited from interface org.apache.cassandra.index.Index.Group
addIndex, handles, invalidate, isSingleton, removeIndex, validateSSTableAttachedIndexes
-
-
-
-
Constructor Detail
-
SingletonIndexGroup
protected SingletonIndexGroup(Index delegate)
-
-
Method Detail
-
getIndexes
public java.util.Set<Index> getIndexes()
Description copied from interface:Index.Group
Returns the indexes that are members of this group.- Specified by:
getIndexes
in interfaceIndex.Group
- Returns:
- the indexes that are members of this group
-
getIndex
public Index getIndex()
-
containsIndex
public boolean containsIndex(Index index)
Description copied from interface:Index.Group
Returns if this group contains the specifiedIndex
.- Specified by:
containsIndex
in interfaceIndex.Group
- Parameters:
index
- the index to be removed- Returns:
true
if this group containsindex
,false
otherwise
-
indexerFor
public Index.Indexer indexerFor(java.util.function.Predicate<Index> indexSelector, DecoratedKey key, RegularAndStaticColumns columns, long nowInSec, WriteContext ctx, IndexTransaction.Type transactionType, Memtable memtable)
Description copied from interface:Index.Group
Creates an newIndexer
object for updates to a given partition.- Specified by:
indexerFor
in 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
- theMemtable
to which the updates are being applied ornull
if the source of the updates is an existingSSTable
- Returns:
- the newly created indexer or
null
if 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
public Index.QueryPlan queryPlanFor(RowFilter rowFilter)
Description copied from interface:Index.Group
Returns a newIndex.QueryPlan
for the specifiedRowFilter
, ornull
if none of the indexes in this group supports the expression in the row filter.- Specified by:
queryPlanFor
in interfaceIndex.Group
- Parameters:
rowFilter
- a row filter- Returns:
- a new query plan for the specified
RowFilter
if it's supported,null
otherwise
-
getFlushObserver
public SSTableFlushObserver getFlushObserver(Descriptor descriptor, LifecycleNewTracker tracker, TableMetadata tableMetadata)
Description copied from interface:Index.Group
Get flush observer to observe partition/cell events generated by flushing SSTable (memtable flush or compaction).- Specified by:
getFlushObserver
in interfaceIndex.Group
- Parameters:
descriptor
- The descriptor of the sstable observer is requested for.tracker
- TheLifecycleNewTracker
associated with the SSTable being writtentableMetadata
- The immutable metadata of the table at the moment the SSTable is flushed- Returns:
- SSTable flush observer.
-
getComponents
public java.util.Set<Component> getComponents()
Description copied from interface:Index.Group
Returns the SSTable-attachedComponent
s created by this index group.- Specified by:
getComponents
in interfaceIndex.Group
- Returns:
- the SSTable components created by this group
-
-