You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "blambov (via GitHub)" <gi...@apache.org> on 2023/07/03 11:12:53 UTC

[GitHub] [cassandra] blambov commented on a diff in pull request #2423: CASSANDRA-14204 trunk

blambov commented on code in PR #2423:
URL: https://github.com/apache/cassandra/pull/2423#discussion_r1246365989


##########
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:
##########
@@ -680,12 +680,25 @@ public AllSSTableOpStatus performGarbageCollection(final ColumnFamilyStore cfSto
             @Override
             public Iterable<SSTableReader> filterSSTables(LifecycleTransaction transaction)
             {
-                Iterable<SSTableReader> originals = transaction.originals();
+                List<SSTableReader> filteredSSTables = new ArrayList<>();
                 if (cfStore.getCompactionStrategyManager().onlyPurgeRepairedTombstones())
-                    originals = Iterables.filter(originals, SSTableReader::isRepaired);
-                List<SSTableReader> sortedSSTables = Lists.newArrayList(originals);
-                Collections.sort(sortedSSTables, SSTableReader.maxTimestampAscending);
-                return sortedSSTables;
+                    for (SSTableReader sstable : transaction.originals())

Review Comment:
   Nit: Multi-line cases are usually enclosed in {}. In this case there's some potential for confusion about the else case on 697, thus at least the for cycle needs to be in a block.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org