cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [4/5] cassandra git commit: Fix anti-compaction target bloom filter size
Date Sun, 29 Mar 2015 15:23:53 GMT
Fix anti-compaction target bloom filter size

patch by Gustav Munkby; reviewed by benedict for CASSANDRA-9060


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b0de3270
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b0de3270
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b0de3270

Branch: refs/heads/trunk
Commit: b0de327099c22dd4708b699dfa9e18496abd7429
Parents: 7b1331f
Author: Gustav Munkby <grddev@gmail.com>
Authored: Sun Mar 29 16:13:23 2015 +0100
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Sun Mar 29 16:19:54 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                       | 1 +
 .../org/apache/cassandra/db/compaction/CompactionManager.java     | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0de3270/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8854261..c02af99 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.4
+ * Fix anti-compaction target bloom filter size (CASSANDRA-9060)
  * Make FROZEN and TUPLE unreserved keywords in CQL (CASSANDRA-9047)
  * Prevent AssertionError from SizeEstimatesRecorder (CASSANDRA-9034)
  * Avoid overwriting index summaries for sstables with an older format that

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0de3270/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 992378f..b9c4553 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1050,8 +1050,6 @@ public class CompactionManager implements CompactionManagerMBean
         List<SSTableReader> anticompactedSSTables = new ArrayList<>();
         int repairedKeyCount = 0;
         int unrepairedKeyCount = 0;
-        // TODO(5351): we can do better here:
-        int expectedBloomFilterSize = Math.max(cfs.metadata.getMinIndexInterval(), (int)(SSTableReader.getApproximateKeyCount(repairedSSTables)));
         logger.info("Performing anticompaction on {} sstables", repairedSSTables.size());
         // iterate over sstables to check if the repaired / unrepaired ranges intersect them.
         for (SSTableReader sstable : repairedSSTables)
@@ -1075,6 +1073,7 @@ public class CompactionManager implements CompactionManagerMBean
             try (AbstractCompactionStrategy.ScannerList scanners = cfs.getCompactionStrategy().getScanners(new
HashSet<>(Collections.singleton(sstable)));
                  CompactionController controller = new CompactionController(cfs, sstableAsSet,
CFMetaData.DEFAULT_GC_GRACE_SECONDS))
             {
+                int expectedBloomFilterSize = Math.max(cfs.metadata.getMinIndexInterval(),
(int)sstable.estimatedKeys());
                 repairedSSTableWriter.switchWriter(CompactionManager.createWriter(cfs, destination,
expectedBloomFilterSize, repairedAt, sstable));
                 unRepairedSSTableWriter.switchWriter(CompactionManager.createWriter(cfs,
destination, expectedBloomFilterSize, ActiveRepairService.UNREPAIRED_SSTABLE, sstable));
 


Mime
View raw message