Class Transformation<I extends BaseRowIterator<?>>
- java.lang.Object
-
- org.apache.cassandra.db.transform.Transformation<I>
-
- Direct Known Subclasses:
DuplicateRowChecker,EmptyPartitionsDiscarder,EnsureOnHeap,Filter,PurgeFunction,RTBoundCloser,RTBoundValidator,ShortReadPartitionsProtection,StoppingTransformation,TopPartitionTracker.TombstoneCounter,WithOnlyQueriedData
public abstract class Transformation<I extends BaseRowIterator<?>> extends java.lang.ObjectWe have a single common superclass for all Transformations to make implementation efficient. we have a shared stack for all transformations, and can share the same transformation across partition and row iterators, reducing garbage. Internal code is also simplified by always having a basic no-op implementation to invoke. Only the necessary methods need be overridden. Early termination is provided by invoking the method's stop or stopInPartition methods, rather than having their own abstract method to invoke, as this is both more efficient and simpler to reason about.
-
-
Constructor Summary
Constructors Constructor Description Transformation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PartitionIteratorapply(PartitionIterator iterator, Transformation<? super RowIterator> transformation)static UnfilteredPartitionIteratorapply(UnfilteredPartitionIterator iterator, Transformation<? super UnfilteredRowIterator> transformation)static RowIteratorapply(RowIterator iterator, Transformation<?> transformation)static UnfilteredRowIteratorapply(UnfilteredRowIterator iterator, Transformation<?> transformation)protected DeletionTimeapplyToDeletion(DeletionTime deletionTime)Applied to the partition-level deletion of any rows iterator.protected RangeTombstoneMarkerapplyToMarker(RangeTombstoneMarker marker)Applied to any RTM we encounter in a rows/unfiltered iteratorprotected IapplyToPartition(I partition)Applied to any rows iterator (partition) we encounter in a partitions iteratorprotected RegularAndStaticColumnsapplyToPartitionColumns(RegularAndStaticColumns columns)Applied to thePartitionColumnsof any rows iterator.protected DecoratedKeyapplyToPartitionKey(DecoratedKey key)Applied to the partition key of any rows/unfiltered iterator we are applied toprotected RowapplyToRow(Row row)Applied to any row we encounter in a rows iteratorprotected RowapplyToStatic(Row row)Applied to the static row of any rows iterator.protected voidonClose()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 functionprotected voidonPartitionClose()Run on the close of any (logical) rows 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
-
-
-
Method Detail
-
onClose
protected 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
-
onPartitionClose
protected void onPartitionClose()
Run on the close of any (logical) rows 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
-
applyToPartition
protected I applyToPartition(I partition)
Applied to any rows iterator (partition) we encounter in a partitions iterator
-
applyToMarker
protected RangeTombstoneMarker applyToMarker(RangeTombstoneMarker marker)
Applied to any RTM we encounter in a rows/unfiltered iterator
-
applyToPartitionKey
protected DecoratedKey applyToPartitionKey(DecoratedKey key)
Applied to the partition key of any rows/unfiltered iterator we are applied to
-
applyToStatic
protected Row applyToStatic(Row row)
Applied to the static row of any rows iterator. NOTE that this is only applied to the first iterator in any sequence of iterators filled by a MoreContents; the static data for such iterators is all expected to be equal
-
applyToDeletion
protected DeletionTime applyToDeletion(DeletionTime deletionTime)
Applied to the partition-level deletion of any rows iterator. NOTE that this is only applied to the first iterator in any sequence of iterators filled by a MoreContents; the static data for such iterators is all expected to be equal
-
applyToPartitionColumns
protected RegularAndStaticColumns applyToPartitionColumns(RegularAndStaticColumns columns)
Applied to thePartitionColumnsof any rows iterator. NOTE: same remark than for applyToDeletion: it is only applied to the first iterator in a sequence of iterators filled by MoreContents.
-
apply
public static UnfilteredPartitionIterator apply(UnfilteredPartitionIterator iterator, Transformation<? super UnfilteredRowIterator> transformation)
-
apply
public static PartitionIterator apply(PartitionIterator iterator, Transformation<? super RowIterator> transformation)
-
apply
public static UnfilteredRowIterator apply(UnfilteredRowIterator iterator, Transformation<?> transformation)
-
apply
public static RowIterator apply(RowIterator iterator, Transformation<?> transformation)
-
-