Skip to content

Commit eabcce9

Browse files
committed
Accord: Slice PreLoadContext to owned keys in MapReduceCommandStores
1 parent 8ac59e0 commit eabcce9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/java/org/apache/cassandra/db/compaction/CompactionTask.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
import org.slf4j.Logger;
3636
import org.slf4j.LoggerFactory;
3737

38-
import accord.local.CommandStores;
3938
import accord.local.CommandStores.StoreFinder;
39+
import accord.local.CommandStores.StoreSelector;
4040
import accord.local.Node;
4141
import accord.primitives.Ranges;
4242
import accord.utils.Invariants;
@@ -574,8 +574,8 @@ protected final CompactionController getCompactionController(Set<SSTableReader>
574574
// TODO (expected): we shouldn't need to limit to universalBefore, but this is a safety margin esp. against bugs with repairing tombstones or incomplete information in CommandStore;
575575
// we should impose stronger guarantees on incoming streams (that they don't contain tombstones), and validate our CommandStore-derived bounds
576576
gcBeforeSeconds = node.durableBefore().foldlWithDefault(ranges, (e, v) -> e == null ? NO_GC : Math.min(e.universal.hlc(), v), null, Long.MAX_VALUE);
577-
CommandStores.StoreSelector selector = StoreFinder.selector(ranges, Long.MIN_VALUE, Long.MAX_VALUE);
578-
gcBeforeSeconds = node.commandStores().mapReduceUnsafe(selector, commandStore -> commandStore.unsafeGetRedundantBefore().foldl(ranges, (bs, v) -> bs.maxBound(LOCALLY_APPLIED).hlc(), Long.MAX_VALUE), Math::min, gcBeforeSeconds);
577+
StoreSelector selector = StoreFinder.selector(ranges, Long.MIN_VALUE, Long.MAX_VALUE);
578+
gcBeforeSeconds = node.commandStores().mapReduceUnsafe(selector, (ignore, commandStore) -> commandStore.unsafeGetRedundantBefore().foldl(ranges, (bs, v) -> bs.maxBound(LOCALLY_APPLIED).hlc(), Long.MAX_VALUE), Math::min, gcBeforeSeconds);
579579
if (gcBeforeSeconds == Long.MAX_VALUE)
580580
gcBeforeSeconds = NO_GC;
581581
else

0 commit comments

Comments
 (0)