Package org.apache.cassandra.db.rows
Interface UnfilteredRowIterators.MergeListener
-
- All Known Implementing Classes:
RowIteratorMergeListener
- Enclosing class:
- UnfilteredRowIterators
public static interface UnfilteredRowIterators.MergeListener
Interface for a listener interested in the result of merging multiple versions of a given row.Implementors of this interface are given enough information that they can easily reconstruct the difference between the merged result and each individual input. This is used when reconciling results on replias for instance to figure out what to send as read-repair to each source.
-
-
Field Summary
Fields Modifier and Type Field Description static UnfilteredRowIterators.MergeListener
NOOP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
void
onMergedPartitionLevelDeletion(DeletionTime mergedDeletion, DeletionTime[] versions)
Called once for the merged partition.void
onMergedRangeTombstoneMarkers(RangeTombstoneMarker merged, RangeTombstoneMarker[] versions)
Called once for every range tombstone marker participating in the merge.Row
onMergedRows(Row merged, Row[] versions)
Called once for every row participating in the merge.
-
-
-
Field Detail
-
NOOP
static final UnfilteredRowIterators.MergeListener NOOP
-
-
Method Detail
-
onMergedPartitionLevelDeletion
void onMergedPartitionLevelDeletion(DeletionTime mergedDeletion, DeletionTime[] versions)
Called once for the merged partition.- Parameters:
mergedDeletion
- the partition level deletion for the merged partition. Implementors can test if the merged partition actually has a partition level deletion or not by callingmergedDeletion.isLive()
.versions
- the partition level deletion for the sources of the merge. Elements of the array will never be null, but be "live".
-
onMergedRows
Row onMergedRows(Row merged, Row[] versions)
Called once for every row participating in the merge.Note that this is called for every clustering where at least one of the source merged has a row. In particular, this may be called in cases where there is no row in the merged output (if a source has a row that is shadowed by another source range tombstone or partition level deletion).
- Parameters:
merged
- the result of the merge. This cannot benull
(so that listener can always access the clustering from this safely)but can be empty, in which case this is a placeholder for when at least one source has a row, but that row is shadowed in the merged output.versions
- for each source, the row in that source corresponding tomerged
. This can benull
for some sources if the source has not such row.- Returns:
- the row to use as result of the merge (can be
null
). Most implementations should simply returnmerged
, but this allows some implementations to impact the merge result if necessary. If this returns eithernull
or an empty row, then the row is skipped from the merge result. If this returns a nonnull
result, then the returned row must have the same clustering thanmerged
.
-
onMergedRangeTombstoneMarkers
void onMergedRangeTombstoneMarkers(RangeTombstoneMarker merged, RangeTombstoneMarker[] versions)
Called once for every range tombstone marker participating in the merge.Note that this is called for every "clustering position" where at least one of the source merged has a range tombstone marker.
- Parameters:
merged
- the marker in the merged output. This can benull
if there is no such marker, which means that at least one source has a marker inversions
but the merged out has nothing corresponding (this basically mean the merged output has a currently open deletion that shadows whatever marker the source had).versions
- the marker for each source merged. This can benull
for some source if that source has not such marker.
-
close
void close()
-
-