merge w/ 7 branch

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1054809 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eric Evans 2011-01-03 22:23:07 +00:00
commit bb1f6cbe18
6 changed files with 54 additions and 1 deletions

View File

@ -35,6 +35,8 @@
* include secondary indexes in cleanup (CASSANDRA-1916)
* CFS.scrubDataDirectories should also cleanup invalid secondary indexes
(CASSANDRA-1904)
* ability to disable/enable gossip on nodes to force them down
(CASSANDRA-1108)
0.7.0-rc3

Binary file not shown.

View File

@ -249,6 +249,28 @@ public class StorageService implements IEndpointStateChangeSubscriber, StorageSe
throw new RuntimeException("Streaming service is unavailable.");
}
// should only be called via JMX
public void stopGossiping()
{
if (initialized)
{
logger_.warn("Stopping gossip by operator request");
Gossiper.instance.stop();
initialized = false;
}
}
// should only be called via JMX
public void startGossiping()
{
if (!initialized)
{
logger_.warn("Starting gossip by operator request");
Gossiper.instance.start(FBUtilities.getLocalAddress(), (int)(System.currentTimeMillis() / 1000));
initialized = true;
}
}
public void stopClient()
{
Gossiper.instance.unregister(migrationManager);

View File

@ -271,4 +271,13 @@ public interface StorageServiceMBean
* @throws ConfigurationException classname not found on classpath
*/
public void updateSnitch(String epSnitchClassName, Boolean dynamic, Integer dynamicUpdateInterval, Integer dynamicResetInterval, Double dynamicBadnessThreshold) throws ConfigurationException;
// allows a user to forcibly 'kill' a sick node
public void stopGossiping();
// allows a user to recover a forcibly 'killed' node
public void startGossiping();
// to determine if gossip is disabled
public boolean isInitialized();
}

View File

@ -74,7 +74,7 @@ public class NodeCmd {
RING, INFO, CFSTATS, SNAPSHOT, CLEARSNAPSHOT, VERSION, TPSTATS, FLUSH, DRAIN,
DECOMMISSION, MOVE, LOADBALANCE, REMOVETOKEN, REPAIR, CLEANUP, COMPACT,
SETCACHECAPACITY, GETCOMPACTIONTHRESHOLD, SETCOMPACTIONTHRESHOLD, NETSTATS, CFHISTOGRAMS,
COMPACTIONSTATS
COMPACTIONSTATS, DISABLEGOSSIP, ENABLEGOSSIP
}
@ -96,6 +96,8 @@ public class NodeCmd {
+ "decommission\n"
+ "loadbalance\n"
+ "compactionstats\n"
+ "disablegossip\n"
+ "enablegossip\n"
// One arg
+ "snapshot [snapshotname]\n"
@ -189,6 +191,7 @@ public class NodeCmd {
public void printInfo(PrintStream outs)
{
outs.println(probe.getToken());
outs.printf("%-17s: %s%n", "Gossip active", probe.isInitialized());
outs.printf("%-17s: %s%n", "Load", probe.getLoadString());
outs.printf("%-17s: %s%n", "Generation No", probe.getCurrentGenerationNumber());
@ -519,6 +522,8 @@ public class NodeCmd {
case TPSTATS : nodeCmd.printThreadPoolStats(System.out); break;
case VERSION : nodeCmd.printReleaseVersion(System.out); break;
case COMPACTIONSTATS : nodeCmd.printCompactionStats(System.out); break;
case DISABLEGOSSIP : probe.stopGossiping(); break;
case ENABLEGOSSIP : probe.startGossiping(); break;
case DRAIN :
try { probe.drain(); }

View File

@ -506,6 +506,21 @@ public class NodeProbe
{
return ssProxy.getKeyspaces();
}
public void stopGossiping()
{
ssProxy.stopGossiping();
}
public void startGossiping()
{
ssProxy.startGossiping();
}
public boolean isInitialized()
{
return ssProxy.isInitialized();
}
}
class ColumnFamilyStoreMBeanIterator implements Iterator<Map.Entry<String, ColumnFamilyStoreMBean>>