cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [5/11] git commit: Reset min/max compaction threshold when creating SizeTieredCompaction strategy
Date Wed, 04 Jan 2012 03:15:29 GMT
Reset min/max compaction threshold when creating SizeTieredCompaction strategy

patch by jbellis; reviewed by slebresne for CASSANDRA-3666


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

Branch: refs/heads/trunk
Commit: a1f156ddf80b0ae374028cd1e981400970e208f0
Parents: 6eac35c
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Jan 3 16:29:28 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Jan 3 16:29:28 2012 +0100

----------------------------------------------------------------------
 .../compaction/SizeTieredCompactionStrategy.java   |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1f156dd/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index e8c5c6f..6f6adbc 100644
--- a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -40,10 +40,12 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
 
     public SizeTieredCompactionStrategy(ColumnFamilyStore cfs, Map<String, String>
options)
     {
-       super(cfs, options);
-       this.estimatedRemainingTasks = 0;
-       String optionValue = options.get(MIN_SSTABLE_SIZE_KEY);
-       minSSTableSize = (null != optionValue) ? Long.parseLong(optionValue) : DEFAULT_MIN_SSTABLE_SIZE;
+        super(cfs, options);
+        this.estimatedRemainingTasks = 0;
+        String optionValue = options.get(MIN_SSTABLE_SIZE_KEY);
+        minSSTableSize = (null != optionValue) ? Long.parseLong(optionValue) : DEFAULT_MIN_SSTABLE_SIZE;
+        cfs.setMaximumCompactionThreshold(cfs.metadata.getMaxCompactionThreshold());
+        cfs.setMinimumCompactionThreshold(cfs.metadata.getMinCompactionThreshold());
     }
 
     public List<AbstractCompactionTask> getBackgroundTasks(final int gcBefore)


Mime
View raw message