cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r782774 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/service: StorageService.java StorageServiceMBean.java
Date Mon, 08 Jun 2009 20:37:38 GMT
Author: jbellis
Date: Mon Jun  8 20:37:38 2009
New Revision: 782774

URL: http://svn.apache.org/viewvc?rev=782774&view=rev
Log:
expose compaction via JMX.  patch by Eric Evans; reviewed by jbellis for CASSANDRA-211

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=782774&r1=782773&r2=782774&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon
Jun  8 20:37:38 2009
@@ -691,6 +691,19 @@
         }
     }
     
+    /**
+     * Trigger the immediate compaction of all tables.
+     */
+    public void forceTableCompaction()
+    {
+        List<String> tables = DatabaseDescriptor.getTables();
+        for ( String tName : tables )
+        {
+            Table table = Table.open(tName);
+            table.forceCompaction();
+        }        
+    }
+    
     public void forceHandoff(String directories, String host) throws IOException
     {       
         List<File> filesList = new ArrayList<File>();

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=782774&r1=782773&r2=782774&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
Mon Jun  8 20:37:38 2009
@@ -37,6 +37,7 @@
     public Map<Range, List<EndPoint>> getRangeToEndPointMap();
     public String getLoadInfo();
     public int getCurrentGenerationNumber();
+    public void forceTableCompaction();
     
     /**
      * This method will cause the local node initiate



Mime
View raw message