maedhroz commented on code in PR #4428:
URL: https://github.com/apache/cassandra/pull/4428#discussion_r2535894839
##########
src/java/org/apache/cassandra/db/ReadExecutionController.java:
##########
@@ -243,4 +261,27 @@ private void addSample()
if (cfs != null)
cfs.metric.topLocalReadQueryTime.addSample(cql, timeMicros);
}
+
+ public void addActivationIds(ColumnFamilyStore.ViewFragment view)
+ {
+ Preconditions.checkState(metadata().replicationType().isTracked());
+ if (activationIds == null)
+ activationIds = new HashSet<>();
+ for (SSTableReader sstable : view.sstables)
+ {
+ ActivatedTransfers transfers =
sstable.getCoordinatorLogOffsets().transfers();
+ if (transfers.isEmpty())
+ continue;
+ logger.trace("Adding overlapping IDs to read keyRange {}",
command.dataRange.keyRange);
+ transfers.forEachIntersecting(command.dataRange.keyRange, id -> {
+ logger.debug("Adding overlapping activation ID {}", id);
+ activationIds.add(id);
+ });
+ }
+ }
+
+ public Iterator<ShortMutationId> getActivationIds()
+ {
+ return activationIds == null ? null : activationIds.iterator();
Review Comment:
Should we ever call `getActivationIds()` without having first set
`activationIds`? If not, I would explode if we try to. I might also have
`addActivationIds()` set `activationIds` to `Collections.empty()` when there
are actually no IDs to let that newly created `HashSet` get collected.
--
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]