cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r934174 - in /cassandra/branches/cassandra-0.6: CHANGES.txt src/java/org/apache/cassandra/tools/NodeCmd.java src/java/org/apache/cassandra/tools/NodeProbe.java
Date Wed, 14 Apr 2010 20:18:41 GMT
Author: gdusbabek
Date: Wed Apr 14 20:18:41 2010
New Revision: 934174

URL: http://svn.apache.org/viewvc?rev=934174&view=rev
Log:
expose drain via nodetool. Patch by Roger Schildmeijer, reviewed by Gary Dusbabek. CASSANDRA-978

Modified:
    cassandra/branches/cassandra-0.6/CHANGES.txt
    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

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=934174&r1=934173&r2=934174&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Wed Apr 14 20:18:41 2010
@@ -18,6 +18,7 @@
    a supercolumn in a row that had been deleted previously (CASSANDRA-920)
  * fix index scans that cross the 2GB mmap boundaries for both mmap
    and standard i/o modes (CASSANDRA-866)
+ * expose drain via nodetool (CASSANDRA-978)
 
 
 0.6.0-RC1

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=934174&r1=934173&r2=934174&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
Apr 14 20:18:41 2010
@@ -34,6 +34,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
+import java.util.concurrent.ExecutionException;
 
 import org.apache.cassandra.cache.JMXInstrumentedCacheMBean;
 import org.apache.cassandra.concurrent.IExecutorMBean;
@@ -76,7 +77,7 @@ public class NodeCmd {
         HelpFormatter hf = new HelpFormatter();
         String header = String.format(
                 "%nAvailable commands: ring, info, cleanup, compact, cfstats, snapshot [snapshotname],
clearsnapshot, " +
-                "tpstats, flush, repair, decommission, move, loadbalance, removetoken, "
+
+                "tpstats, flush, drain, repair, decommission, move, loadbalance, removetoken,
" +
                 "setcachecapacity <keyspace> <cfname> <keycachecapacity>
<rowcachecapacity>, " +
                 "getcompactionthreshold, setcompactionthreshold [minthreshold] ([maxthreshold])"
+
                 "streams [host]");
@@ -502,6 +503,18 @@ public class NodeCmd {
             else // cmdName.equals("repair")
                 probe.forceTableRepair(cmd.getArgs()[1], columnFamilies);
         }
+        else if (cmdName.equals("drain"))
+        {
+            try 
+            {
+                probe.drain();
+            } catch (ExecutionException ee) 
+            {
+                System.err.println("Error occured during flushing");
+                ee.printStackTrace();
+                System.exit(3);
+            }    	
+        }
         else if (cmdName.equals("setcachecapacity"))
         {
             if (cmd.getArgs().length != 5)

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=934174&r1=934173&r2=934174&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
Apr 14 20:18:41 2010
@@ -33,6 +33,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
+import java.util.concurrent.ExecutionException;
 
 import javax.management.*;
 import javax.management.remote.JMXConnector;
@@ -145,6 +146,11 @@ public class NodeProbe
         ssProxy.forceTableRepair(tableName, columnFamilies);
     }
     
+    public void drain() throws IOException, InterruptedException, ExecutionException
+    {
+        ssProxy.drain();	
+    }
+    
     public Map<Range, List<String>> getRangeToEndPointMap(String tableName)
     {
         return ssProxy.getRangeToEndPointMap(tableName);



Mime
View raw message