cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1222423 - in /cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db: ColumnFamilyStore.java ColumnFamilyStoreMBean.java
Date Thu, 22 Dec 2011 20:23:48 GMT
Author: brandonwilliams
Date: Thu Dec 22 20:23:48 2011
New Revision: 1222423

URL: http://svn.apache.org/viewvc?rev=1222423&view=rev
Log:
Allow setting compaction strategy via JMX.
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-3452

Modified:
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1222423&r1=1222422&r2=1222423&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Thu Dec 22 20:23:48 2011
@@ -204,6 +204,17 @@ public class ColumnFamilyStore implement
         }
     }
 
+    public void setCompactionStrategyClass(String compactionStrategyClass) throws ConfigurationException
+    {
+        metadata.compactionStrategyClass = CFMetaData.createCompactionStrategy(compactionStrategyClass);
+        maybeReloadCompactionStrategy();
+    }
+    
+    public String getCompactionStrategyClass()
+    {
+        return metadata.compactionStrategyClass.getName();
+    }
+
     private ColumnFamilyStore(Table table, String columnFamilyName, IPartitioner partitioner,
int generation, CFMetaData metadata)
     {
         assert metadata != null : "null metadata for " + table + ":" + columnFamilyName;

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java?rev=1222423&r1=1222422&r2=1222423&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
Thu Dec 22 20:23:48 2011
@@ -207,6 +207,17 @@ public interface ColumnFamilyStoreMBean
     public void setMaximumCompactionThreshold(int threshold);
 
     /**
+     * Sets the compaction strategy by class name
+     * @param className the name of the compaction strategy class
+     */
+    public void setCompactionStrategyClass(String className) throws ConfigurationException;
+
+    /**
+     * Gets the compaction strategy class name
+     */
+    public String getCompactionStrategyClass();
+
+    /**
      * Disable automatic compaction.
      */
     public void disableAutoCompaction();



Mime
View raw message