cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r997175 - in /cassandra: branches/cassandra-0.6/src/java/org/apache/cassandra/service/ branches/cassandra-0.6/src/java/org/apache/cassandra/tools/ trunk/src/java/org/apache/cassandra/service/ trunk/src/java/org/apache/cassandra/tools/
Date Wed, 15 Sep 2010 03:01:19 GMT
Author: brandonwilliams
Date: Wed Sep 15 03:01:19 2010
New Revision: 997175

URL: http://svn.apache.org/viewvc?rev=997175&view=rev
Log:
Nodetool can compact or cleanup a single keyspace.  Patch by brandonwilliams, reviewed by
jbellis for CASSANDRA-1479

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageServiceMBean.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeProbe.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
Wed Sep 15 03:01:19 2010
@@ -1014,12 +1014,24 @@ public class StorageService implements I
         }
     }
 
+    public void forceTableCleanup(String tableName) throws IOException
+    {
+        Table table = getValidTable(tableName);
+        table.forceCleanup();
+    }
+    
     public void forceTableCompaction() throws IOException
     {
         for (Table table : Table.all())
             table.forceCompaction();
     }
 
+    public void forceTableCompaction(String tableName) throws IOException
+    {
+        Table table = getValidTable(tableName);
+        table.forceCompaction();
+    }
+
     /**
      * Takes the snapshot for a given table.
      *

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageServiceMBean.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageServiceMBean.java
Wed Sep 15 03:01:19 2010
@@ -96,11 +96,21 @@ public interface StorageServiceMBean
     public void forceTableCompaction() throws IOException;
 
     /**
+     * Forces major compaction of a single keyspace
+     */
+    public void forceTableCompaction(String tableName) throws IOException;
+
+    /**
      * Trigger a cleanup of keys on all tables.
      */
     public void forceTableCleanup() throws IOException;
 
     /**
+     * Trigger a cleanup of keys on a single keyspace
+     */
+    public void forceTableCleanup(String tableName) throws IOException;
+
+    /**
      * Takes the snapshot for a given table.
      * 
      * @param tableName the name of the table.

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeCmd.java Wed
Sep 15 03:01:19 2010
@@ -433,11 +433,17 @@ public class NodeCmd {
         }
         else if (cmdName.equals("cleanup"))
         {
-            probe.forceTableCleanup();
+            if (arguments.length > 1)
+                probe.forceTableCleanup(arguments[1]);
+            else
+                probe.forceTableCleanup();
         }
         else if (cmdName.equals("compact"))
         {
-            probe.forceTableCompaction();
+            if (arguments.length > 1)
+                probe.forceTableCompaction(arguments[1]);
+            else
+                probe.forceTableCompaction();
         }
         else if (cmdName.equals("cfstats"))
         {

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/tools/NodeProbe.java Wed
Sep 15 03:01:19 2010
@@ -130,12 +130,22 @@ public class NodeProbe
     {
         ssProxy.forceTableCleanup();
     }
-    
+
+    public void forceTableCleanup(String tableName) throws IOException
+    {
+        ssProxy.forceTableCleanup(tableName);
+    }
+
     public void forceTableCompaction() throws IOException
     {
         ssProxy.forceTableCompaction();
     }
 
+    public void forceTableCompaction(String tableName) throws IOException
+    {
+        ssProxy.forceTableCompaction(tableName);
+    }
+
     public void forceTableFlush(String tableName, String... columnFamilies) throws IOException
     {
         ssProxy.forceTableFlush(tableName, columnFamilies);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Wed Sep 15 03:01:19
2010
@@ -1120,12 +1120,24 @@ public class StorageService implements I
         }
     }
 
+    public void forceTableCleanup(String tableName) throws IOException
+    {
+        Table table = getValidTable(tableName);
+        table.forceCleanup();
+    }
+    
     public void forceTableCompaction() throws IOException
     {
         for (Table table : Table.all())
             table.forceCompaction();
     }
 
+    public void forceTableCompaction(String tableName) throws IOException
+    {
+        Table table = getValidTable(tableName);
+        table.forceCompaction();
+    }
+
     /**
      * Takes the snapshot for a given table.
      *

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java Wed Sep
15 03:01:19 2010
@@ -135,11 +135,21 @@ public interface StorageServiceMBean
     public void forceTableCompaction() throws IOException;
 
     /**
+     * Forces major compaction of a single keyspace
+     */
+    public void forceTableCompaction(String tableName) throws IOException;
+
+    /**
      * Trigger a cleanup of keys on all tables.
      */
     public void forceTableCleanup() throws IOException;
 
     /**
+     * Trigger a cleanup of keys on a single keyspace
+     */
+    public void forceTableCleanup(String tableName) throws IOException;
+
+    /**
      * Takes the snapshot for a given table.
      * 
      * @param tableName the name of the table.

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Wed Sep 15 03:01:19 2010
@@ -421,11 +421,17 @@ public class NodeCmd {
         }
         else if (cmdName.equals("cleanup"))
         {
-            probe.forceTableCleanup();
+            if (arguments.length > 1)
+                probe.forceTableCleanup(arguments[1]);
+            else
+                probe.forceTableCleanup();
         }
         else if (cmdName.equals("compact"))
         {
-            probe.forceTableCompaction();
+            if (arguments.length > 1)
+                probe.forceTableCompaction(arguments[1]);
+            else
+                probe.forceTableCompaction();
         }
         else if (cmdName.equals("cfstats"))
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=997175&r1=997174&r2=997175&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java Wed Sep 15 03:01:19
2010
@@ -132,12 +132,22 @@ public class NodeProbe
     {
         ssProxy.forceTableCleanup();
     }
-    
+
+    public void forceTableCleanup(String tableName) throws IOException
+    {
+        ssProxy.forceTableCleanup(tableName);
+    }
+
     public void forceTableCompaction() throws IOException
     {
         ssProxy.forceTableCompaction();
     }
 
+    public void forceTableCompaction(String tableName) throws IOException
+    {
+        ssProxy.forceTableCompaction(tableName);
+    }
+
     public void forceTableFlush(String tableName, String... columnFamilies) throws IOException
     {
         ssProxy.forceTableFlush(tableName, columnFamilies);



Mime
View raw message