org.apache.cassandra.db.rows

## Class UnfilteredRowIteratorWithLowerBound

- java.lang.Object
- - org.apache.cassandra.utils.AbstractIterator<Unfiltered>
  - - org.apache.cassandra.db.rows.LazilyInitializedUnfilteredRowIterator
    - - org.apache.cassandra.db.rows.UnfilteredRowIteratorWithLowerBound

All Implemented Interfaces:
  com.google.common.collect.PeekingIterator<Unfiltered>, java.lang.AutoCloseable, java.util.Iterator<Unfiltered>, BaseRowIterator<Unfiltered>, UnfilteredRowIterator, CloseableIterator<Unfiltered>, IteratorWithLowerBound<Unfiltered>

    public class UnfilteredRowIteratorWithLowerBound
    extends LazilyInitializedUnfilteredRowIterator
    implements IteratorWithLowerBound<Unfiltered>

An unfiltered row iterator with a lower bound retrieved from either the global sstable statistics or the row index lower bounds (if available in the cache). Before initializing the sstable unfiltered row iterator, we return an empty row with the clustering set to the lower bound. The empty row will be filtered out and the result is that if we don't need to access this sstable, i.e. due to the LIMIT conditon, then we will not. See CASSANDRA-8180 for examples of why this is useful.

### Constructor Summary

Constructors
Constructor and Description
`UnfilteredRowIteratorWithLowerBound(DecoratedKey partitionKey, SSTableReader sstable, ClusteringIndexFilter filter, ColumnFilter selectedColumns, boolean isForThrift, int nowInSec, boolean applyThriftTransformation, SSTableReadsListener listener)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PartitionColumns` `columns()` A subset of the columns for the (static and regular) rows returned by this iterator.
`protected Unfiltered` `computeNext()`
`protected UnfilteredRowIterator` `initializeIterator()`
`boolean` `isReverseOrder()` Whether or not the rows returned by this iterator are in reversed clustering order.
`Unfiltered` `lowerBound()`
`CFMetaData` `metadata()` The metadata for the table this iterator on.
`DeletionTime` `partitionLevelDeletion()` The partition level deletion for the partition this iterate over.
`Row` `staticRow()` The static part corresponding to this partition (this can be an empty row but cannot be `null`).
`EncodingStats` `stats()` Return "statistics" about what is returned by this iterator.

### Methods inherited from class org.apache.cassandra.db.rows.LazilyInitializedUnfilteredRowIterator

`close, initialized, maybeInit, partitionKey`

### Methods inherited from class org.apache.cassandra.utils.AbstractIterator

`endOfData, hasNext, next, peek, remove`

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

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

### Methods inherited from interface org.apache.cassandra.db.rows.UnfilteredRowIterator

`isEmpty`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, hasNext, next, remove`

### Constructor Detail

#### UnfilteredRowIteratorWithLowerBound

    public UnfilteredRowIteratorWithLowerBound(DecoratedKey partitionKey,
                                               SSTableReader sstable,
                                               ClusteringIndexFilter filter,
                                               ColumnFilter selectedColumns,
                                               boolean isForThrift,
                                               int nowInSec,
                                               boolean applyThriftTransformation,
                                               SSTableReadsListener listener)

### Method Detail

#### lowerBound

    public Unfiltered lowerBound()

Specified by:
  `lowerBound` in interface `IteratorWithLowerBound<Unfiltered>`

#### initializeIterator

    protected UnfilteredRowIterator initializeIterator()

Specified by:
  `initializeIterator` in class `LazilyInitializedUnfilteredRowIterator`

#### computeNext

    protected Unfiltered computeNext()

Overrides:
  `computeNext` in class `LazilyInitializedUnfilteredRowIterator`

#### metadata

    public CFMetaData metadata()

Description copied from interface: `BaseRowIterator`
The metadata for the table this iterator on.

Specified by:
  `metadata` in interface `BaseRowIterator<Unfiltered>`
Overrides:
  `metadata` in class `LazilyInitializedUnfilteredRowIterator`

#### isReverseOrder

    public boolean isReverseOrder()

Description copied from interface: `BaseRowIterator`
Whether or not the rows returned by this iterator are in reversed clustering order.

Specified by:
  `isReverseOrder` in interface `BaseRowIterator<Unfiltered>`
Overrides:
  `isReverseOrder` in class `LazilyInitializedUnfilteredRowIterator`

#### columns

    public PartitionColumns columns()

Description copied from interface: `BaseRowIterator`
A subset of the columns for the (static and regular) rows returned by this iterator. Every row returned by this iterator must guarantee that it has only those columns.

Specified by:
  `columns` in interface `BaseRowIterator<Unfiltered>`
Overrides:
  `columns` in class `LazilyInitializedUnfilteredRowIterator`

#### stats

    public EncodingStats stats()

Description copied from interface: `UnfilteredRowIterator`
Return "statistics" about what is returned by this iterator. Those are used for performance reasons (for delta-encoding for instance) and code should not expect those to be exact.

Specified by:
  `stats` in interface `UnfilteredRowIterator`
Overrides:
  `stats` in class `LazilyInitializedUnfilteredRowIterator`

#### partitionLevelDeletion

    public DeletionTime partitionLevelDeletion()

Description copied from interface: `UnfilteredRowIterator`
The partition level deletion for the partition this iterate over.

Specified by:
  `partitionLevelDeletion` in interface `UnfilteredRowIterator`
Overrides:
  `partitionLevelDeletion` in class `LazilyInitializedUnfilteredRowIterator`

#### staticRow

    public Row staticRow()

Description copied from interface: `BaseRowIterator`
The static part corresponding to this partition (this can be an empty row but cannot be `null`).

Specified by:
  `staticRow` in interface `BaseRowIterator<Unfiltered>`
Overrides:
  `staticRow` in class `LazilyInitializedUnfilteredRowIterator`