cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: Add AbstractCompactionStrategy.startup() method
Date Wed, 29 Jan 2014 22:26:49 GMT
Updated Branches:
  refs/heads/trunk 82571546e -> 8a6204645


Add AbstractCompactionStrategy.startup() method

patch by Aleksey Yeschenko; reviewed by Jonathan Ellis for
CASSANDRA-6637


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

Branch: refs/heads/trunk
Commit: cc708b92a55c35166633f9486b6c6fbde489f8a9
Parents: 287745e
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed Jan 29 16:22:29 2014 -0600
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Jan 29 16:22:29 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java   |  2 ++
 .../db/compaction/AbstractCompactionStrategy.java         | 10 +++++++++-
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc708b92/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4009981..94eaa79 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@
  * Fix paging discardFirst (CASSANDRA-6555)
  * Fix ArrayIndexOutOfBoundsException in 2ndary index query (CASSANDRA-6470)
  * Release sstables upon rebuilding 2i (CASSANDRA-6635)
+ * Add AbstractCompactionStrategy.startup() method (CASSANDRA-6637)
 Merged from 1.2:
  * fsync compression metadata (CASSANDRA-6531)
  * Validate CF existence on execution for prepared statement (CASSANDRA-6535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc708b92/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 2cc325b..8d09453 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -147,6 +147,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         {
             compactionStrategy.shutdown();
             compactionStrategy = metadata.createCompactionStrategyInstance(this);
+            compactionStrategy.startup();
         }
     }
 
@@ -265,6 +266,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
         // compaction strategy should be created after the CFS has been prepared
         this.compactionStrategy = metadata.createCompactionStrategyInstance(this);
+        this.compactionStrategy.startup();
 
         if (maxCompactionThreshold.value() <= 0 || minCompactionThreshold.value() <=0)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc708b92/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
index f101998..164cfda 100644
--- a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
@@ -68,7 +68,7 @@ public abstract class AbstractCompactionStrategy
      *
      * See CASSANDRA-3430
      */
-    protected boolean isActive = true;
+    protected boolean isActive = false;
 
     protected volatile boolean enabled = true;
 
@@ -122,6 +122,14 @@ public abstract class AbstractCompactionStrategy
     }
 
     /**
+     * Performs any extra initialization required
+     */
+    public void startup()
+    {
+        isActive = true;
+    }
+
+    /**
      * Releases any resources if this strategy is shutdown (when the CFS is reloaded after
a schema change).
      */
     public void shutdown()


Mime
View raw message