Permalink
Browse files

fix based on review

  • Loading branch information...
yukim committed Oct 10, 2012
1 parent a21fc62 commit af8df59aedda3c99bd1249dbb86572b89c333117
Showing with 3 additions and 14 deletions.
  1. +3 −14 src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -504,21 +504,10 @@ public boolean apply(SSTableReader candidate)
{
// add sstables from L1 that overlap candidates
// if the overlapping ones are already busy in a compaction, leave it out.
candidates = Sets.union(candidates, overlapping(candidates, Iterables.filter(generations[1], new Predicate<SSTableReader>()
{
public boolean apply(SSTableReader sstable)
{
return !compacting.contains(sstable);
}
})));
// TODO try to find a set of L0 sstables that only overlaps with non-busy L1 sstables
candidates = Sets.union(candidates, overlapping(candidates, generations[1]));
// check overlap with L0 compacting sstables to make sure we are not generating overlap in L1.
Iterable<SSTableReader> compactingL0 = Iterables.filter(generations[0], new Predicate<SSTableReader>()
{
public boolean apply(SSTableReader sstable)
{
return compacting.contains(sstable);
}
});
Iterable<SSTableReader> compactingL0 = Iterables.filter(generations[0], Predicates.in(compacting));
if (!overlapping(candidates, compactingL0).isEmpty())
return Collections.emptyList();
}

0 comments on commit af8df59

Please sign in to comment.