add nodeprobe cancelpending

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@880918 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-11-16 19:25:20 +00:00
parent 6691b2c295
commit 43bf9e237c
4 changed files with 27 additions and 1 deletions

View File

@ -287,4 +287,9 @@ public class TokenMetadata
{
return getEndPoint(getSuccessor(getToken(endPoint)));
}
public void clearPendingRanges()
{
pendingRanges.clear();
}
}

View File

@ -1046,4 +1046,9 @@ public final class StorageService implements IEndPointStateChangeSubscriber, Sto
{
return replicationStrategy_;
}
public void cancelPendingRanges()
{
tokenMetadata_.clearPendingRanges();
}
}

View File

@ -131,6 +131,13 @@ public interface StorageServiceMBean
*/
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);
}

View File

@ -393,6 +393,11 @@ public class NodeProbe
ssProxy.move(newToken);
}
public void cancelPendingRanges()
{
ssProxy.cancelPendingRanges();
}
/**
* Print out the size of the queues in the thread pools
*
@ -488,7 +493,7 @@ public class NodeProbe
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 @@ public class NodeProbe
}
probe.move(arguments[1]);
}
else if (cmdName.equals("cancelpending"))
{
probe.cancelPendingRanges();
}
else if (cmdName.equals("snapshot"))
{
String snapshotName = "";