cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject git commit: Enable compression setting adjustment via JMX. Patch by brandonwilliams, reviewed by xedin for CASSANDRA-3815.
Date Fri, 17 Feb 2012 11:34:56 GMT
Updated Branches:
  refs/heads/cassandra-1.1 8f570ea68 -> 064adba2e


Enable compression setting adjustment via JMX.
Patch by brandonwilliams, reviewed by xedin for CASSANDRA-3815.


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

Branch: refs/heads/cassandra-1.1
Commit: 064adba2e158c762a5d3bfec10f32cc0528a9f29
Parents: 8f570ea
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Feb 17 05:24:26 2012 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Feb 17 05:24:26 2012 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/config/CFMetaData.java    |    2 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   11 +++++++++++
 .../cassandra/db/ColumnFamilyStoreMBean.java       |   12 ++++++++++++
 3 files changed, 24 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/064adba2/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index 06b1adf..96ed181 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -169,7 +169,7 @@ public final class CFMetaData
     public Class<? extends AbstractCompactionStrategy> compactionStrategyClass;
     public Map<String, String> compactionStrategyOptions;
 
-    private CompressionParameters compressionParameters;
+    public CompressionParameters compressionParameters;
 
     // Processed infos used by CQL. This can be fully reconstructed from the CFMedata,
     // so it's not saved on disk. It is however costlyish to recreate for each query

http://git-wip-us.apache.org/repos/asf/cassandra/blob/064adba2/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 6d91d6e..18b73ba 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -31,6 +31,7 @@ import javax.management.*;
 import com.google.common.collect.*;
 
 import org.apache.cassandra.db.compaction.LeveledManifest;
+import org.apache.cassandra.io.compress.CompressionParameters;
 import org.apache.cassandra.service.CacheService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -181,6 +182,16 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
     {
         return metadata.compactionStrategyClass.getName();
     }
+    
+    public Map<String,String> getCompressionParameters()
+    {
+        return metadata.compressionParameters().asThriftOptions();
+    }
+
+    public void setCompressionParameters(Map<String,String> opts) throws ConfigurationException
+    {
+        metadata.compressionParameters = CompressionParameters.create(opts);
+    }
 
     private ColumnFamilyStore(Table table, String columnFamilyName, IPartitioner partitioner,
int generation, CFMetaData metadata, Directories directories)
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/064adba2/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
index e06ced6..9054edd 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.db;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
 import org.apache.cassandra.config.ConfigurationException;
@@ -202,6 +203,17 @@ public interface ColumnFamilyStoreMBean
     public String getCompactionStrategyClass();
 
     /**
+     * Get the compression parameters
+     */
+    public Map<String,String> getCompressionParameters();
+
+    /**
+     * Set the compression parameters
+     * @param opts map of string names to values
+     */
+    public void setCompressionParameters(Map<String,String> opts) throws ConfigurationException;
+
+    /**
      * Disable automatic compaction.
      */
     public void disableAutoCompaction();


Mime
View raw message