cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r880918 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: locator/TokenMetadata.java service/StorageService.java service/StorageServiceMBean.java tools/NodeProbe.java
Date Mon, 16 Nov 2009 19:25:21 GMT
Author: jbellis
Date: Mon Nov 16 19:25:20 2009
New Revision: 880918

URL: http://svn.apache.org/viewvc?rev=880918&view=rev
Log:
add nodeprobe cancelpending

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java?rev=880918&r1=880917&r2=880918&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java Mon
Nov 16 19:25:20 2009
@@ -287,4 +287,9 @@
     {
         return getEndPoint(getSuccessor(getToken(endPoint)));
     }
+
+    public void clearPendingRanges()
+    {
+        pendingRanges.clear();
+    }
 }

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=880918&r1=880917&r2=880918&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
Nov 16 19:25:20 2009
@@ -1046,4 +1046,9 @@
     {
         return replicationStrategy_;
     }
+
+    public void cancelPendingRanges()
+    {
+        tokenMetadata_.clearPendingRanges();
+    }
 }

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=880918&r1=880917&r2=880918&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 Nov 16 19:25:20 2009
@@ -131,6 +131,13 @@
      */
     public void loadBalance() throws IOException, InterruptedException;
 
+    /**
+     * cancel writes to nodes that are set to be changing ranges.
+     * Only do this if the reason for the range changes no longer exists
+     * (e.g., a bootstrapping node was killed or crashed.)
+     */
+    public void cancelPendingRanges();
+
     /** set the logging level at runtime */
     public void setLog4jLevel(String classQualifier, String level);
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=880918&r1=880917&r2=880918&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java Mon Nov 16
19:25:20 2009
@@ -393,6 +393,11 @@
         ssProxy.move(newToken);
     }
 
+    public void cancelPendingRanges()
+    {
+        ssProxy.cancelPendingRanges();
+    }
+
     /**
      * Print out the size of the queues in the thread pools
      *
@@ -488,7 +493,7 @@
         HelpFormatter hf = new HelpFormatter();
         String header = String.format(
                 "%nAvailable commands: ring, info, cleanup, compact, cfstats, snapshot [name],
clearsnapshot, " +
-                "tpstats, flush, decommission, move, loadbalance, " +
+                "tpstats, flush, decommission, move, loadbalance, cancelpending, " +
                 " getcompactionthreshold, setcompactionthreshold [minthreshold] ([maxthreshold])");
         String usage = String.format("java %s -host <arg> <command>%n", NodeProbe.class.getName());
         hf.printHelp(usage, "", options, header);
@@ -563,6 +568,10 @@
             }
             probe.move(arguments[1]);
         }
+        else if (cmdName.equals("cancelpending"))
+        {
+            probe.cancelPendingRanges();
+        }
         else if (cmdName.equals("snapshot"))
         {
             String snapshotName = "";



Mime
View raw message