org.apache.cassandra.db.filter

## Class DataLimits.Counter

- java.lang.Object
- - org.apache.cassandra.db.transform.Transformation<I>
  - - org.apache.cassandra.db.transform.StoppingTransformation<BaseRowIterator<?>>
    - - org.apache.cassandra.db.filter.DataLimits.Counter

- Enclosing class:
    DataLimits

      public abstract static class DataLimits.Counter
      extends StoppingTransformation<BaseRowIterator<?>>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `assumeLiveData`
    `protected int` | `nowInSec`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Counter(int nowInSec, boolean assumeLiveData, boolean enforceStrictLiveness)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PartitionIterator` | `applyTo(PartitionIterator partitions)`
    `RowIterator` | `applyTo(RowIterator partition)`
    `UnfilteredPartitionIterator` | `applyTo(UnfilteredPartitionIterator partitions)`
    `UnfilteredRowIterator` | `applyTo(UnfilteredRowIterator partition)`
    `protected BaseRowIterator<?>` | `applyToPartition(BaseRowIterator<?> partition)` Applied to any rows iterator (partition) we encounter in a partitions iterator
    `protected abstract void` | `applyToPartition(DecoratedKey partitionKey, Row staticRow)`
    `protected void` | `attachTo(BasePartitions partitions)`
    `protected void` | `attachTo(BaseRows rows)`
    `abstract int` | `counted()` The number of results counted.
    `abstract int` | `countedInCurrentPartition()`
    `abstract boolean` | `isDone()`
    `abstract boolean` | `isDoneForPartition()`
    `protected boolean` | `isLive(Row row)`
    `void` | `onClose()` Run on the close of any (logical) partitions iterator this function was applied to We stipulate logical, because if applied to a transformed iterator the lifetime of the iterator object may be longer than the lifetime of the "logical" iterator it was applied to; if the iterator is refilled with MoreContents, for instance, the iterator may outlive this function
    `DataLimits.Counter` | `onlyCount()`
    `abstract int` | `rowCounted()` The number of rows counted.
    `abstract int` | `rowCountedInCurrentPartition()` The number of rows counted in the current partition.

    - ### Methods inherited from class org.apache.cassandra.db.transform.StoppingTransformation

      `onPartitionClose, stop, stopInPartition`

    - ### Methods inherited from class org.apache.cassandra.db.transform.Transformation

      `apply, apply, apply, apply, applyToDeletion, applyToMarker, applyToPartitionColumns, applyToPartitionKey, applyToRow, applyToStatic`

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

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

- - ### Field Detail

    - #### nowInSec

          protected final int nowInSec

    - #### assumeLiveData

          protected final boolean assumeLiveData

  - ### Constructor Detail

    - #### Counter

          protected Counter(int nowInSec,
                            boolean assumeLiveData,
                            boolean enforceStrictLiveness)

  - ### Method Detail

    - #### onlyCount

          public DataLimits.Counter onlyCount()

    - #### applyTo

          public PartitionIterator applyTo(PartitionIterator partitions)

    - #### applyTo

          public UnfilteredPartitionIterator applyTo(UnfilteredPartitionIterator partitions)

    - #### applyTo

          public UnfilteredRowIterator applyTo(UnfilteredRowIterator partition)

    - #### applyTo

          public RowIterator applyTo(RowIterator partition)

    - #### counted

          public abstract int counted()

      The number of results counted.

      Note that the definition of "results" should be the same that for `DataLimits.count()`.

      Returns:
        the number of results counted.

    - #### countedInCurrentPartition

          public abstract int countedInCurrentPartition()

    - #### rowCounted

          public abstract int rowCounted()

      The number of rows counted.
      Returns:
        the number of rows counted.

    - #### rowCountedInCurrentPartition

          public abstract int rowCountedInCurrentPartition()

      The number of rows counted in the current partition.
      Returns:
        the number of rows counted in the current partition.

    - #### isDone

          public abstract boolean isDone()

    - #### isDoneForPartition

          public abstract boolean isDoneForPartition()

    - #### isLive

          protected boolean isLive(Row row)

    - #### applyToPartition

          protected BaseRowIterator<?> applyToPartition(BaseRowIterator<?> partition)

      Description copied from class: `Transformation`
      Applied to any rows iterator (partition) we encounter in a partitions iterator
      Overrides:
        `applyToPartition` in class `Transformation<BaseRowIterator<?>>`

    - #### applyToPartition

          protected abstract void applyToPartition(DecoratedKey partitionKey,
                                                   Row staticRow)

    - #### attachTo

          protected void attachTo(BasePartitions partitions)

      Overrides:
        `attachTo` in class `StoppingTransformation<BaseRowIterator<?>>`

    - #### attachTo

          protected void attachTo(BaseRows rows)

      Overrides:
        `attachTo` in class `StoppingTransformation<BaseRowIterator<?>>`

    - #### onClose

          public void onClose()

      Description copied from class: `Transformation`
      Run on the close of any (logical) partitions iterator this function was applied to We stipulate logical, because if applied to a transformed iterator the lifetime of the iterator object may be longer than the lifetime of the "logical" iterator it was applied to; if the iterator is refilled with MoreContents, for instance, the iterator may outlive this function
      Overrides:
        `onClose` in class `StoppingTransformation<BaseRowIterator<?>>`

Copyright © 2018 The Apache Software Foundation