DataRange (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.db

## Class DataRange

- java.lang.Object
- - org.apache.cassandra.db.DataRange

- Direct Known Subclasses:
    DataRange.Paging

      public class DataRange
      extends java.lang.Object

  Groups key range and column filter for range queries. The main "trick" of this class is that the column filter can only be obtained by providing the row key on which the column filter will be applied (which we always know before actually querying the columns). This allows the paging DataRange to return a filter for most rows but a potentially different ones for the starting and stopping key. Could allow more fancy stuff in the future too, like column filters that depend on the actual key value :)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DataRange.Paging`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IDiskAtomFilter` | `columnFilter`
    `protected AbstractBounds<RowPosition>` | `keyRange`
    `protected boolean` | `selectFullRow`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataRange(AbstractBounds<RowPosition> range, IDiskAtomFilter columnFilter)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DataRange` | `allData(IPartitioner partitioner)`
    `IDiskAtomFilter` | `columnFilter(java.nio.ByteBuffer rowKey)` Returns a column filter that should be used for a particular row key.
    `boolean` | `contains(RowPosition pos)`
    `static DataRange` | `forKeyRange(Range<RowPosition> keyRange)`
    `static DataRange` | `forTokenRange(Range<Token> keyRange)`
    `int` | `getLiveCount(ColumnFamily data, long now)`
    `boolean` | `ignoredTombstonedPartitions()` Returns true if tombstoned partitions should not be included in results or count towards the limit.
    `static boolean` | `isFullRowSlice(SliceQueryFilter filter)`
    `boolean` | `isWrapAround()`
    `AbstractBounds<RowPosition>` | `keyRange()`
    `boolean` | `selectsFullRowFor(java.nio.ByteBuffer rowKey)`
    `RowPosition` | `startKey()`
    `RowPosition` | `stopKey()`
    `void` | `updateColumnsLimit(int count)` Sets a new limit on the number of (grouped) cells to fetch.

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

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

- - ### Field Detail

    - #### keyRange

          protected final AbstractBounds<RowPosition> keyRange

    - #### columnFilter

          protected IDiskAtomFilter columnFilter

    - #### selectFullRow

          protected final boolean selectFullRow

  - ### Constructor Detail

    - #### DataRange

          public DataRange(AbstractBounds<RowPosition> range,
                           IDiskAtomFilter columnFilter)

  - ### Method Detail

    - #### isFullRowSlice

          public static boolean isFullRowSlice(SliceQueryFilter filter)

    - #### allData

          public static DataRange allData(IPartitioner partitioner)

    - #### forTokenRange

          public static DataRange forTokenRange(Range<Token> keyRange)

    - #### forKeyRange

          public static DataRange forKeyRange(Range<RowPosition> keyRange)

    - #### keyRange

          public AbstractBounds<RowPosition> keyRange()

    - #### startKey

          public RowPosition startKey()

    - #### stopKey

          public RowPosition stopKey()

    - #### ignoredTombstonedPartitions

          public boolean ignoredTombstonedPartitions()

      Returns true if tombstoned partitions should not be included in results or count towards the limit. See CASSANDRA-8490 for more details on why this is needed (and done this way).

    - #### isWrapAround

          public boolean isWrapAround()

    - #### contains

          public boolean contains(RowPosition pos)

    - #### getLiveCount

          public int getLiveCount(ColumnFamily data,
                                  long now)

    - #### selectsFullRowFor

          public boolean selectsFullRowFor(java.nio.ByteBuffer rowKey)

    - #### columnFilter

          public IDiskAtomFilter columnFilter(java.nio.ByteBuffer rowKey)

      Returns a column filter that should be used for a particular row key. Note that in the case of paging, slice starts and ends may change depending on the row key.

    - #### updateColumnsLimit

          public void updateColumnsLimit(int count)

      Sets a new limit on the number of (grouped) cells to fetch. This is currently only used when the query limit applies to CQL3 rows.

Copyright © 2018 The Apache Software Foundation