Package 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 Description protected boolean
assumeLiveData
protected boolean
enforceLimits
protected int
nowInSec
-
Constructor Summary
Constructors Modifier Constructor Description protected
Counter(int nowInSec, boolean assumeLiveData, boolean enforceStrictLiveness)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PartitionIterator
applyTo(PartitionIterator partitions)
UnfilteredPartitionIterator
applyTo(UnfilteredPartitionIterator partitions)
RowIterator
applyTo(RowIterator partition)
UnfilteredRowIterator
applyTo(UnfilteredRowIterator partition)
protected abstract void
applyToPartition(DecoratedKey partitionKey, Row staticRow)
protected BaseRowIterator<?>
applyToPartition(BaseRowIterator<?> partition)
Applied to any rows iterator (partition) we encounter in a partitions iteratorprotected 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 functionDataLimits.Counter
onlyCount()
abstract int
rowsCounted()
The number of rows counted.abstract int
rowsCountedInCurrentPartition()
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
-
-
-
-
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()
-
rowsCounted
public abstract int rowsCounted()
The number of rows counted.- Returns:
- the number of rows counted.
-
rowsCountedInCurrentPartition
public abstract int rowsCountedInCurrentPartition()
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 classTransformation<BaseRowIterator<?>>
-
applyToPartition
protected abstract void applyToPartition(DecoratedKey partitionKey, Row staticRow)
-
attachTo
protected void attachTo(BasePartitions partitions)
- Overrides:
attachTo
in classStoppingTransformation<BaseRowIterator<?>>
-
attachTo
protected void attachTo(BaseRows rows)
- Overrides:
attachTo
in classStoppingTransformation<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 classStoppingTransformation<BaseRowIterator<?>>
-
-