netudima commented on code in PR #3730:
URL: https://github.com/apache/cassandra/pull/3730#discussion_r1903298971


##########
src/java/org/apache/cassandra/db/ReadCommand.java:
##########
@@ -867,6 +868,130 @@ protected LongPredicate getPurgeEvaluator()
         return Transformation.apply(iterator, new 
WithoutPurgeableTombstones());
     }
 
+
+    /**
+     * Wraps the provided iterator so that metrics on count of purgeable 
tombstones are tracked and traced.
+     * It tracks only tombstones with localDeletionTime < now - 
gc_grace_period.
+     * Other (non-purgeable) tombstones will be tracked by regular Cassandra 
logic later.
+     */
+    private UnfilteredPartitionIterator 
withPurgeableTombstonesMetricRecording(UnfilteredPartitionIterator iter,
+                                                                               
ColumnFamilyStore cfs)
+    {
+        class PurgeableTombstonesMetricRecording extends 
Transformation<UnfilteredRowIterator>
+        {
+            private int purgeableTombstones = 0;
+
+            @Override
+            public UnfilteredRowIterator 
applyToPartition(UnfilteredRowIterator iter)
+            {
+                return Transformation.apply(iter, this);

Review Comment:
   Hm, interesting. I have created PurgeableTombstonesMetricRecording iterator 
based on MetricRecording iterator logic. It looks like the existing 
tombstoneScannedHistogram has the same behaviour. Should I change 
considerZeroes = true for tombstoneScannedHistogram and add the counter 
increment on a partition delete to MetricRecording as well? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to