org.apache.cassandra.db.filter

## Class QueryFilter

- java.lang.Object
- - org.apache.cassandra.db.filter.QueryFilter

-     public class QueryFilter
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IDiskAtomFilter` | `filter`
    `DecoratedKey` | `key`
    `QueryPath` | `path`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryFilter(DecoratedKey key, QueryPath path, IDiskAtomFilter filter)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collateColumns(ColumnFamily returnCF, java.util.List<? extends CloseableIterator<IColumn>> toCollate, int gcBefore)`
    `void` | `collateOnDiskAtom(ColumnFamily returnCF, java.util.List<? extends CloseableIterator<OnDiskAtom>> toCollate, int gcBefore)`
    `static CloseableIterator<IColumn>` | `gatherTombstones(ColumnFamily returnCF, CloseableIterator<OnDiskAtom> iter)` Given an iterator of on disk atom, returns an iterator that filters the tombstone range markers adding them to `returnCF` and returns the normal column.
    `java.lang.String` | `getColumnFamilyName()`
    `static QueryFilter` | `getIdentityFilter(DecoratedKey key, QueryPath path)` return a QueryFilter object that includes every column in the row.
    `OnDiskAtomIterator` | `getMemtableColumnIterator(ColumnFamily cf, DecoratedKey key)`
    `OnDiskAtomIterator` | `getMemtableColumnIterator(Memtable memtable)`
    `static QueryFilter` | `getNamesFilter(DecoratedKey key, QueryPath path, java.nio.ByteBuffer column)` convenience method for creating a name filter matching a single column
    `static QueryFilter` | `getNamesFilter(DecoratedKey key, QueryPath path, java.util.SortedSet<java.nio.ByteBuffer> columns)`
    `static QueryFilter` | `getSliceFilter(DecoratedKey key, QueryPath path, java.nio.ByteBuffer start, java.nio.ByteBuffer finish, boolean reversed, int limit)`
    `ISSTableColumnIterator` | `getSSTableColumnIterator(SSTableReader sstable)`
    `ISSTableColumnIterator` | `getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry)`
    `static boolean` | `isRelevant(IColumn column, IColumnContainer container, int gcBefore)`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### key

          public final DecoratedKey key

    - #### path

          public final QueryPath path

    - #### filter

          public final IDiskAtomFilter filter

  - ### Constructor Detail

    - #### QueryFilter

          public QueryFilter(DecoratedKey key,
                     QueryPath path,
                     IDiskAtomFilter filter)

  - ### Method Detail

    - #### getMemtableColumnIterator

          public OnDiskAtomIterator getMemtableColumnIterator(Memtable memtable)

    - #### getMemtableColumnIterator

          public OnDiskAtomIterator getMemtableColumnIterator(ColumnFamily cf,
                                                     DecoratedKey key)

    - #### getSSTableColumnIterator

          public ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable)

    - #### getSSTableColumnIterator

          public ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable,
                                                        FileDataInput file,
                                                        DecoratedKey key,
                                                        RowIndexEntry indexEntry)

    - #### collateOnDiskAtom

          public void collateOnDiskAtom(ColumnFamily returnCF,
                               java.util.List<? extends CloseableIterator<OnDiskAtom>> toCollate,
                               int gcBefore)

    - #### collateColumns

          public void collateColumns(ColumnFamily returnCF,
                            java.util.List<? extends CloseableIterator<IColumn>> toCollate,
                            int gcBefore)

    - #### gatherTombstones

          public static CloseableIterator<IColumn> gatherTombstones(ColumnFamily returnCF,
                                                    CloseableIterator<OnDiskAtom> iter)

      Given an iterator of on disk atom, returns an iterator that filters the tombstone range markers adding them to `returnCF` and returns the normal column.

    - #### getColumnFamilyName

          public java.lang.String getColumnFamilyName()

    - #### isRelevant

          public static boolean isRelevant(IColumn column,
                           IColumnContainer container,
                           int gcBefore)

    - #### getSliceFilter

          public static QueryFilter getSliceFilter(DecoratedKey key,
                                   QueryPath path,
                                   java.nio.ByteBuffer start,
                                   java.nio.ByteBuffer finish,
                                   boolean reversed,
                                   int limit)

      Parameters:
        `key` - the row to slice
        `path` - path to the level to slice at (CF or SuperColumn)
        `start` - column to start slice at, inclusive; empty for "the first column"
        `finish` - column to stop slice at, inclusive; empty for "the last column"
        `reversed` - true to start with the largest column (as determined by configured sort order) instead of smallest
        `limit` - maximum number of non-deleted columns to return
      Returns:
        a QueryFilter object to satisfy the given slice criteria:

    - #### getIdentityFilter

          public static QueryFilter getIdentityFilter(DecoratedKey key,
                                      QueryPath path)

      return a QueryFilter object that includes every column in the row. This is dangerous on large rows; avoid except for test code.

    - #### getNamesFilter

          public static QueryFilter getNamesFilter(DecoratedKey key,
                                   QueryPath path,
                                   java.util.SortedSet<java.nio.ByteBuffer> columns)

      Parameters:
        `key` - the row to slice
        `path` - path to the level to slice at (CF or SuperColumn)
        `columns` - the column names to restrict the results to, sorted in comparator order
      Returns:
        a QueryFilter object that will return columns matching the given names

    - #### getNamesFilter

          public static QueryFilter getNamesFilter(DecoratedKey key,
                                   QueryPath path,
                                   java.nio.ByteBuffer column)

      convenience method for creating a name filter matching a single column

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2014 The Apache Software Foundation