ClusteringIndexSliceFilter (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.db.filter

## Class ClusteringIndexSliceFilter

- java.lang.Object
- - org.apache.cassandra.db.filter.AbstractClusteringIndexFilter
  - - org.apache.cassandra.db.filter.ClusteringIndexSliceFilter

- All Implemented Interfaces:
    ClusteringIndexFilter

      public class ClusteringIndexSliceFilter
      extends AbstractClusteringIndexFilter

  A filter over a single partition.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.cassandra.db.filter.ClusteringIndexFilter

      `ClusteringIndexFilter.InternalDeserializer, ClusteringIndexFilter.Kind, ClusteringIndexFilter.Serializer`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.db.filter.AbstractClusteringIndexFilter

      `reversed`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClusteringIndexSliceFilter(Slices slices, boolean reversed)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UnfilteredRowIterator` | `filterNotIndexed(ColumnFilter columnFilter, UnfilteredRowIterator iterator)` Returns an iterator that only returns the rows of the provided iterator that this filter selects.
    `ClusteringIndexSliceFilter` | `forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive)` Returns a filter for continuing the paging of this filter given the last returned clustering prefix.
    `Slices` | `getSlices(CFMetaData metadata)`
    `UnfilteredRowIterator` | `getUnfilteredRowIterator(ColumnFilter columnFilter, Partition partition)` Given a partition, returns a row iterator for the rows of this partition that are selected by this filter.
    `boolean` | `isFullyCoveredBy(CachedPartition partition)` Returns whether we can guarantee that a given cached partition contains all the data selected by this filter.
    `boolean` | `isHeadFilter()` Whether this filter selects the head of a partition (i.e.
    `ClusteringIndexFilter.Kind` | `kind()`
    `Slices` | `requestedSlices()`
    `boolean` | `selects(Clustering clustering)` Whether a given row is selected by this filter.
    `boolean` | `selectsAllPartition()` Whether this filter selects all the row of a partition (it's an "identity" filter).
    `protected long` | `serializedSizeInternal(int version)`
    `protected void` | `serializeInternal(DataOutputPlus out, int version)`
    `boolean` | `shouldInclude(SSTableReader sstable)` Whether the provided sstable may contain data that is selected by this filter (based on the sstable metadata).
    `java.lang.String` | `toCQLString(CFMetaData metadata)`
    `java.lang.String` | `toString(CFMetaData metadata)`

    - ### Methods inherited from class org.apache.cassandra.db.filter.AbstractClusteringIndexFilter

      `appendOrderByToCQLString, isReversed`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClusteringIndexSliceFilter

          public ClusteringIndexSliceFilter(Slices slices,
                                            boolean reversed)

  - ### Method Detail

    - #### requestedSlices

          public Slices requestedSlices()

    - #### selectsAllPartition

          public boolean selectsAllPartition()

      Description copied from interface: `ClusteringIndexFilter`
      Whether this filter selects all the row of a partition (it's an "identity" filter).
      Returns:
        whether this filter selects all the row of a partition (it's an "identity" filter).

    - #### selects

          public boolean selects(Clustering clustering)

      Description copied from interface: `ClusteringIndexFilter`
      Whether a given row is selected by this filter.
      Parameters:
        `clustering` - the clustering of the row to test the selection of.
      Returns:
        whether the row with clustering `clustering` is selected by this filter.

    - #### forPaging

          public ClusteringIndexSliceFilter forPaging(ClusteringComparator comparator,
                                                      Clustering lastReturned,
                                                      boolean inclusive)

      Description copied from interface: `ClusteringIndexFilter`
      Returns a filter for continuing the paging of this filter given the last returned clustering prefix.
      Parameters:
        `comparator` - the comparator for the table this is a filter for.
        `lastReturned` - the last clustering that was returned for the query we are paging for. The resulting filter will be such that results coming after `lastReturned` are returned (where coming after means "greater than" if the filter is not reversed, "lesser than" otherwise; futher, whether the comparison is strict or not depends on `inclusive`).
        `inclusive` - whether or not we want to include the `lastReturned` in the newly returned page of results.
      Returns:
        a new filter that selects results coming after `lastReturned`.

    - #### isFullyCoveredBy

          public boolean isFullyCoveredBy(CachedPartition partition)

      Description copied from interface: `ClusteringIndexFilter`
      Returns whether we can guarantee that a given cached partition contains all the data selected by this filter.
      Parameters:
        `partition` - the cached partition. This method assumed that the rows of this partition contains all the table columns.
      Returns:
        whether we can guarantee that all data selected by this filter are in `partition`.

    - #### isHeadFilter

          public boolean isHeadFilter()

      Description copied from interface: `ClusteringIndexFilter`
      Whether this filter selects the head of a partition (i.e. it isn't reversed and selects all rows up to a certain point).
      Returns:
        whether this filter selects the head of a partition.

    - #### filterNotIndexed

          public UnfilteredRowIterator filterNotIndexed(ColumnFilter columnFilter,
                                                        UnfilteredRowIterator iterator)

      Description copied from interface: `ClusteringIndexFilter`
      Returns an iterator that only returns the rows of the provided iterator that this filter selects.

      This method is the "dumb" counterpart to `ClusteringIndexFilter.getSlices(CFMetaData)` in that it has no way to quickly get to what is actually selected, so it simply iterate over it all and filters out what shouldn't be returned. This should be avoided in general. Another difference with `ClusteringIndexFilter.getSlices(CFMetaData)` is that this method also filter the queried columns in the returned result, while the former assumes that the provided iterator has already done it.

      Parameters:
        `columnFilter` - the columns to include in the rows of the result iterator.
        `iterator` - the iterator for which we should filter rows.
      Returns:
        an iterator that only returns the rows (or rather Unfilted) from `iterator` that are selected by this filter.

    - #### getSlices

          public Slices getSlices(CFMetaData metadata)

    - #### getUnfilteredRowIterator

          public UnfilteredRowIterator getUnfilteredRowIterator(ColumnFilter columnFilter,
                                                                Partition partition)

      Description copied from interface: `ClusteringIndexFilter`
      Given a partition, returns a row iterator for the rows of this partition that are selected by this filter.
      Parameters:
        `columnFilter` - the columns to include in the rows of the result iterator.
        `partition` - the partition containing the rows to filter.
      Returns:
        a unfiltered row iterator returning those rows (or rather Unfiltered) from `partition` that are selected by this filter.

    - #### shouldInclude

          public boolean shouldInclude(SSTableReader sstable)

      Description copied from interface: `ClusteringIndexFilter`
      Whether the provided sstable may contain data that is selected by this filter (based on the sstable metadata).
      Parameters:
        `sstable` - the sstable for which we want to test the need for inclusion.
      Returns:
        whether `sstable` should be included to answer this filter.

    - #### toString

          public java.lang.String toString(CFMetaData metadata)

    - #### toCQLString

          public java.lang.String toCQLString(CFMetaData metadata)

    - #### kind

          public ClusteringIndexFilter.Kind kind()

    - #### serializeInternal

          protected void serializeInternal(DataOutputPlus out,
                                           int version)
                                    throws java.io.IOException

      Specified by:
        `serializeInternal` in class `AbstractClusteringIndexFilter`
      Throws:
        `java.io.IOException`

    - #### serializedSizeInternal

          protected long serializedSizeInternal(int version)

      Specified by:
        `serializedSizeInternal` in class `AbstractClusteringIndexFilter`

Copyright © 2018 The Apache Software Foundation