org.apache.cassandra.db.filter

## Class SliceQueryFilter

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

All Implemented Interfaces:
  IDiskAtomFilter

Direct Known Subclasses:
  IdentityQueryFilter

    public class SliceQueryFilter
    extends java.lang.Object
    implements IDiskAtomFilter

### Nested Class Summary

Nested Classes
`static class` `SliceQueryFilter.Serializer`

### Field Summary

Fields
`int` `compositesToGroup`
`int` `count`
`boolean` `reversed`
`static SliceQueryFilter.Serializer` `serializer`
`ColumnSlice[]` `slices`

### Constructor Summary

Constructors
Constructor and Description
`SliceQueryFilter(java.nio.ByteBuffer start, java.nio.ByteBuffer finish, boolean reversed, int count)`
`SliceQueryFilter(java.nio.ByteBuffer start, java.nio.ByteBuffer finish, boolean reversed, int count, int compositesToGroup)`
`SliceQueryFilter(ColumnSlice[] slices, boolean reversed, int count)` Constructor that accepts multiple slices.
`SliceQueryFilter(ColumnSlice[] slices, boolean reversed, int count, int compositesToGroup)`

### Method Summary

Methods
`SliceQueryFilter` `cloneShallow()`
`void` `collectReducedColumns(ColumnFamily container, java.util.Iterator<Column> reducedColumns, int gcBefore, long now)` collects columns from reducedColumns into returnCF.
`ColumnCounter` `columnCounter(AbstractType<?> comparator, long now)`
`java.nio.ByteBuffer` `finish()`
`java.util.Comparator<Column>` `getColumnComparator(AbstractType<?> comparator)`
`OnDiskAtomIterator` `getColumnFamilyIterator(DecoratedKey key, ColumnFamily cf)` returns an iterator that returns columns from the given columnFamily matching the Filter criteria in sorted order.
`int` `getLiveCount(ColumnFamily cf, long now)`
`OnDiskAtomIterator` `getSSTableColumnIterator(SSTableReader sstable, DecoratedKey key)` returns an iterator that returns columns from the given SSTable matching the Filter criteria in sorted order.
`OnDiskAtomIterator` `getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry)` Get an iterator that returns columns from the given SSTable using the opened file matching the Filter criteria in sorted order.
`boolean` `isReversed()`
`int` `lastCounted()`
`int` `lastIgnored()`
`int` `lastLive()`
`boolean` `maySelectPrefix(java.util.Comparator<java.nio.ByteBuffer> cmp, java.nio.ByteBuffer prefix)`
`protected boolean` `respectTombstoneThresholds()`
`void` `setStart(java.nio.ByteBuffer start)`
`boolean` `shouldInclude(SSTableReader sstable)`
`java.nio.ByteBuffer` `start()`
`java.lang.String` `toString()`
`void` `trim(ColumnFamily cf, int trimTo, long now)`
`void` `updateColumnsLimit(int newLimit)`
`SliceQueryFilter` `withUpdatedCount(int newCount)`
`SliceQueryFilter` `withUpdatedSlice(java.nio.ByteBuffer start, java.nio.ByteBuffer finish)`
`SliceQueryFilter` `withUpdatedSlices(ColumnSlice[] newSlices)`
`SliceQueryFilter` `withUpdatedStart(java.nio.ByteBuffer newStart, AbstractType<?> comparator)`

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

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

### Field Detail

#### serializer

    public static final SliceQueryFilter.Serializer serializer

#### slices

    public final ColumnSlice[] slices

#### reversed

    public final boolean reversed

#### count

    public volatile int count

#### compositesToGroup

    public final int compositesToGroup

### Constructor Detail

#### SliceQueryFilter

    public SliceQueryFilter(java.nio.ByteBuffer start,
                    java.nio.ByteBuffer finish,
                    boolean reversed,
                    int count)

#### SliceQueryFilter

    public SliceQueryFilter(java.nio.ByteBuffer start,
                    java.nio.ByteBuffer finish,
                    boolean reversed,
                    int count,
                    int compositesToGroup)

#### SliceQueryFilter

    public SliceQueryFilter(ColumnSlice[] slices,
                    boolean reversed,
                    int count)

Constructor that accepts multiple slices. All slices are assumed to be in the same direction (forward or reversed).

#### SliceQueryFilter

    public SliceQueryFilter(ColumnSlice[] slices,
                    boolean reversed,
                    int count,
                    int compositesToGroup)

### Method Detail

#### cloneShallow

    public SliceQueryFilter cloneShallow()

Specified by:
  `cloneShallow` in interface `IDiskAtomFilter`

#### withUpdatedCount

    public SliceQueryFilter withUpdatedCount(int newCount)

#### withUpdatedSlices

    public SliceQueryFilter withUpdatedSlices(ColumnSlice[] newSlices)

#### withUpdatedStart

    public SliceQueryFilter withUpdatedStart(java.nio.ByteBuffer newStart,
                                    AbstractType<?> comparator)

#### withUpdatedSlice

    public SliceQueryFilter withUpdatedSlice(java.nio.ByteBuffer start,
                                    java.nio.ByteBuffer finish)

#### getColumnFamilyIterator

    public OnDiskAtomIterator getColumnFamilyIterator(DecoratedKey key,
                                             ColumnFamily cf)

Description copied from interface: `IDiskAtomFilter`
returns an iterator that returns columns from the given columnFamily matching the Filter criteria in sorted order.

Specified by:
  `getColumnFamilyIterator` in interface `IDiskAtomFilter`

#### getSSTableColumnIterator

    public OnDiskAtomIterator getSSTableColumnIterator(SSTableReader sstable,
                                              DecoratedKey key)

Description copied from interface: `IDiskAtomFilter`
returns an iterator that returns columns from the given SSTable matching the Filter criteria in sorted order.

Specified by:
  `getSSTableColumnIterator` in interface `IDiskAtomFilter`

#### getSSTableColumnIterator

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

Description copied from interface: `IDiskAtomFilter`
Get an iterator that returns columns from the given SSTable using the opened file matching the Filter criteria in sorted order.

Specified by:
  `getSSTableColumnIterator` in interface `IDiskAtomFilter`
  `file` - Already opened file data input, saves us opening another one
  `key` - The key of the row we are about to iterate over

#### getColumnComparator

    public java.util.Comparator<Column> getColumnComparator(AbstractType<?> comparator)

Specified by:
  `getColumnComparator` in interface `IDiskAtomFilter`

#### collectReducedColumns

    public void collectReducedColumns(ColumnFamily container,
                             java.util.Iterator<Column> reducedColumns,
                             int gcBefore,
                             long now)

Description copied from interface: `IDiskAtomFilter`
collects columns from reducedColumns into returnCF. Termination is determined by the filter code, which should have some limit on the number of columns to avoid running out of memory on large rows.

Specified by:
  `collectReducedColumns` in interface `IDiskAtomFilter`

#### respectTombstoneThresholds

    protected boolean respectTombstoneThresholds()

#### getLiveCount

    public int getLiveCount(ColumnFamily cf,
                   long now)

Specified by:
  `getLiveCount` in interface `IDiskAtomFilter`

#### columnCounter

    public ColumnCounter columnCounter(AbstractType<?> comparator,
                              long now)

Specified by:
  `columnCounter` in interface `IDiskAtomFilter`

#### trim

    public void trim(ColumnFamily cf,
            int trimTo,
            long now)

#### start

    public java.nio.ByteBuffer start()

#### finish

    public java.nio.ByteBuffer finish()

#### setStart

    public void setStart(java.nio.ByteBuffer start)

#### lastCounted

    public int lastCounted()

#### lastIgnored

    public int lastIgnored()

#### lastLive

    public int lastLive()

#### toString

    public java.lang.String toString()

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

#### isReversed

    public boolean isReversed()

Specified by:
  `isReversed` in interface `IDiskAtomFilter`

#### updateColumnsLimit

    public void updateColumnsLimit(int newLimit)

Specified by:
  `updateColumnsLimit` in interface `IDiskAtomFilter`

#### maySelectPrefix

    public boolean maySelectPrefix(java.util.Comparator<java.nio.ByteBuffer> cmp,
                          java.nio.ByteBuffer prefix)

Specified by:
  `maySelectPrefix` in interface `IDiskAtomFilter`

#### shouldInclude

    public boolean shouldInclude(SSTableReader sstable)

Specified by:
  `shouldInclude` in interface `IDiskAtomFilter`