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
ColumnFilter sub-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.

  • Field Details

    • fetchingStrategy

      public final org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy
  • Constructor Details

    • SelectionColumnFilter

      public SelectionColumnFilter(org.apache.cassandra.db.filter.ColumnFilter.FetchingStrategy fetchingStrategy, RegularAndStaticColumns queried, RegularAndStaticColumns fetched, com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections)
      Creates a ColumnFilter for 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 columns
      fetched - the columns that must be fetched
      queried - the queried columns
      subSelections - the columns sub-selections
  • Method Details

    • 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: ColumnFilter
      The columns that needs to be fetched internally for this filter.
      Specified by:
      fetchedColumns in class ColumnFilter
      Returns:
      the columns to fetch for this filter.
    • queriedColumns

      public RegularAndStaticColumns queriedColumns()
      Description copied from class: ColumnFilter
      The 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:
      queriedColumns in class ColumnFilter
    • fetchesAllColumns

      public boolean fetchesAllColumns(boolean isStatic)
      Description copied from class: ColumnFilter
      Whether 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 false but 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:
      fetchesAllColumns in class ColumnFilter
      Parameters:
      isStatic - whether to check for static columns or not. If true, the method returns if all static columns are fetched, otherwise it checks regular columns.
    • allFetchedColumnsAreQueried

      public boolean allFetchedColumnsAreQueried()
      Description copied from class: ColumnFilter
      Whether _fetched_ == _queried_ for this filter, and so if the isQueried() methods can return false for some column/cell.
      Specified by:
      allFetchedColumnsAreQueried in class ColumnFilter
    • fetches

      public boolean fetches(ColumnMetadata column)
      Description copied from class: ColumnFilter
      Whether the provided column is fetched by this filter.
      Specified by:
      fetches in class ColumnFilter
    • 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 the fetches(org.apache.cassandra.schema.ColumnMetadata) method.
      Specified by:
      fetchedColumnIsQueried in class ColumnFilter
    • fetchedCellIsQueried

      public boolean fetchedCellIsQueried(ColumnMetadata column, CellPath path)
      Description copied from class: ColumnFilter
      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 the ColumnFilter.fetches(org.apache.cassandra.schema.ColumnMetadata) method.
      Specified by:
      fetchedCellIsQueried in class ColumnFilter
    • newTester

      public ColumnFilter.Tester newTester(ColumnMetadata column)
      Description copied from class: ColumnFilter
      Creates a new Tester to efficiently test the inclusion of cells of complex column column.
      Specified by:
      newTester in class ColumnFilter
      Parameters:
      column - for complex column for which to create a tester.
      Returns:
      the created tester or null if all the cells from the provided column are queried.
    • subSelections

      protected com.google.common.collect.SortedSetMultimap<ColumnIdentifier,ColumnSubselection> subSelections()
      Description copied from class: ColumnFilter
      Returns the sub-selections or null if there are none.
      Specified by:
      subSelections in class ColumnFilter
      Returns:
      the sub-selections or null if there are none
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toCQLString

      public String toCQLString()
      Description copied from class: ColumnFilter
      Returns the CQL string corresponding to this ColumnFilter.
      Specified by:
      toCQLString in class ColumnFilter
      Returns:
      the CQL string corresponding to this ColumnFilter.