Package org.apache.cassandra.db.filter
Class ColumnFilter.SelectionColumnFilter
- java.lang.Object
-
- org.apache.cassandra.db.filter.ColumnFilter
-
- org.apache.cassandra.db.filter.ColumnFilter.SelectionColumnFilter
-
- Enclosing class:
- ColumnFilter
public static class ColumnFilter.SelectionColumnFilter extends ColumnFilter
ColumnFiltersub-class for queries with selected columns.The class does not rely on TableMetadata and expect a fix set of fetched columns to prevent issues with Schema race propagation. See CASSANDRA-15899.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.filter.ColumnFilter
ColumnFilter.Builder, ColumnFilter.SelectionColumnFilter, ColumnFilter.Serializer, ColumnFilter.Tester, ColumnFilter.WildCardColumnFilter
-
-
Field Summary
Fields Modifier and Type Field Description org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategyfetchingStrategy-
Fields inherited from class org.apache.cassandra.db.filter.ColumnFilter
NONE, serializer
-
-
Constructor Summary
Constructors Constructor Description SelectionColumnFilter(org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy, RegularAndStaticColumns queried, RegularAndStaticColumns fetched, com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections)Creates aColumnFilterfor queries with selected columns.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallFetchedColumnsAreQueried()Whether _fetched_ == _queried_ for this filter, and so if theisQueried()methods can returnfalsefor some column/cell.booleanequals(java.lang.Object other)booleanfetchedCellIsQueried(ColumnMetadata column, CellPath path)Whether the provided complex cell (identified by its column and path), which is assumed to be _fetched_ by this filter, is also _queried_ by the user.booleanfetchedColumnIsQueried(ColumnMetadata column)Whether the provided complex cell (identified by its column and path), which is assumed to be _fetched_ by this filter, is also _queried_ by the user.RegularAndStaticColumnsfetchedColumns()The columns that needs to be fetched internally for this filter.booleanfetches(ColumnMetadata column)Whether the provided column is fetched by this filter.booleanfetchesAllColumns(boolean isStatic)Whether all the (regular or static) columns are fetched by this filter.inthashCode()static ColumnFilter.SelectionColumnFilternewInstance(org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy, TableMetadata metadata, RegularAndStaticColumns queried, com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections)ColumnFilter.TesternewTester(ColumnMetadata column)Creates a newTesterto efficiently test the inclusion of cells of complex columncolumn.RegularAndStaticColumnsqueriedColumns()The columns actually queried by the user.protected com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection>subSelections()Returns the sub-selections ornullif there are none.java.lang.StringtoCQLString()Returns the CQL string corresponding to thisColumnFilter.java.lang.StringtoString()-
Methods inherited from class org.apache.cassandra.db.filter.ColumnFilter
all, allRegularColumnsBuilder, isWildcard, selection, selection, selectionBuilder
-
-
-
-
Constructor Detail
-
SelectionColumnFilter
public SelectionColumnFilter(org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy, RegularAndStaticColumns queried, RegularAndStaticColumns fetched, com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections)Creates aColumnFilterfor queries with selected columns.The class does not rely on TableMetadata and expect a fix set of columns to prevent issues with Schema race propagation. See CASSANDRA-15899.
- Parameters:
fetchingStrategy- the strategy used to select the fetched columnsfetched- the columns that must be fetchedqueried- the queried columnssubSelections- the columns sub-selections
-
-
Method Detail
-
newInstance
public static ColumnFilter.SelectionColumnFilter newInstance(org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy, TableMetadata metadata, RegularAndStaticColumns queried, com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections)
-
fetchedColumns
public RegularAndStaticColumns fetchedColumns()
Description copied from class:ColumnFilterThe columns that needs to be fetched internally for this filter.- Specified by:
fetchedColumnsin classColumnFilter- Returns:
- the columns to fetch for this filter.
-
queriedColumns
public RegularAndStaticColumns queriedColumns()
Description copied from class:ColumnFilterThe columns actually queried by the user.Note that this is in general not all the columns that are fetched internally (see
ColumnFilter.fetchedColumns()).- Specified by:
queriedColumnsin classColumnFilter
-
fetchesAllColumns
public boolean fetchesAllColumns(boolean isStatic)
Description copied from class:ColumnFilterWhether all the (regular or static) columns are fetched by this filter.Note that this method is meant as an optimization but a negative return shouldn't be relied upon strongly: this can return
falsebut still have all the columns fetches if those were manually selected by the user. The goal here is to cheaply avoid filtering things on wildcard queries, as those are common.- Specified by:
fetchesAllColumnsin classColumnFilter- Parameters:
isStatic- whether to check for static columns or not. Iftrue, the method returns if all static columns are fetched, otherwise it checks regular columns.
-
allFetchedColumnsAreQueried
public boolean allFetchedColumnsAreQueried()
Description copied from class:ColumnFilterWhether _fetched_ == _queried_ for this filter, and so if theisQueried()methods can returnfalsefor some column/cell.- Specified by:
allFetchedColumnsAreQueriedin classColumnFilter
-
fetches
public boolean fetches(ColumnMetadata column)
Description copied from class:ColumnFilterWhether the provided column is fetched by this filter.- Specified by:
fetchesin classColumnFilter
-
fetchedColumnIsQueried
public boolean fetchedColumnIsQueried(ColumnMetadata column)
Whether the provided complex cell (identified by its column and path), which is assumed to be _fetched_ by this filter, is also _queried_ by the user. !WARNING! please be sure to understand the difference between _fetched_ and _queried_ columns that this class made before using this method. If unsure, you probably want to use thefetches(org.apache.cassandra.schema.ColumnMetadata)method.- Specified by:
fetchedColumnIsQueriedin classColumnFilter
-
fetchedCellIsQueried
public boolean fetchedCellIsQueried(ColumnMetadata column, CellPath path)
Description copied from class:ColumnFilterWhether the provided complex cell (identified by its column and path), which is assumed to be _fetched_ by this filter, is also _queried_ by the user. !WARNING! please be sure to understand the difference between _fetched_ and _queried_ columns that this class made before using this method. If unsure, you probably want to use theColumnFilter.fetches(org.apache.cassandra.schema.ColumnMetadata)method.- Specified by:
fetchedCellIsQueriedin classColumnFilter
-
newTester
public ColumnFilter.Tester newTester(ColumnMetadata column)
Description copied from class:ColumnFilterCreates a newTesterto efficiently test the inclusion of cells of complex columncolumn.- Specified by:
newTesterin classColumnFilter- Parameters:
column- for complex column for which to create a tester.- Returns:
- the created tester or
nullif all the cells from the provided column are queried.
-
subSelections
protected com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections()
Description copied from class:ColumnFilterReturns the sub-selections ornullif there are none.- Specified by:
subSelectionsin classColumnFilter- Returns:
- the sub-selections or
nullif there are none
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toCQLString
public java.lang.String toCQLString()
Description copied from class:ColumnFilterReturns the CQL string corresponding to thisColumnFilter.- Specified by:
toCQLStringin classColumnFilter- Returns:
- the CQL string corresponding to this
ColumnFilter.
-
-