cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goffi...@apache.org
Subject svn commit: r1129094 - in /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools: NodeCmd.java NodeProbe.java
Date Mon, 30 May 2011 09:50:44 GMT
Author: goffinet
Date: Mon May 30 09:50:44 2011
New Revision: 1129094

URL: http://svn.apache.org/viewvc?rev=1129094&view=rev
Log:
Added statusthrift to nodetool to report if thrift server is running.
patch by goffinet; reviewed by slebresne for CASSANDRA-2722

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1129094&r1=1129093&r2=1129094&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java Mon
May 30 09:50:44 2011
@@ -80,7 +80,7 @@ public class NodeCmd
         DECOMMISSION, MOVE, REMOVETOKEN, REPAIR, CLEANUP, COMPACT, SCRUB,
         SETCACHECAPACITY, GETCOMPACTIONTHRESHOLD, SETCOMPACTIONTHRESHOLD, NETSTATS, CFHISTOGRAMS,
         COMPACTIONSTATS, DISABLEGOSSIP, ENABLEGOSSIP, INVALIDATEKEYCACHE, INVALIDATEROWCACHE,
-        DISABLETHRIFT, ENABLETHRIFT, JOIN, SETCOMPACTIONTHROUGHPUT
+        DISABLETHRIFT, ENABLETHRIFT, STATUSTHRIFT, JOIN, SETCOMPACTIONTHROUGHPUT
     }
 
     
@@ -106,6 +106,7 @@ public class NodeCmd
         addCmdHelp(header, "enablegossip", "Reenable gossip");
         addCmdHelp(header, "disablethrift", "Disable thrift server");
         addCmdHelp(header, "enablethrift", "Reenable thrift server");
+        addCmdHelp(header, "statusthrift", "Status of thrift server");
 
         // One arg
         addCmdHelp(header, "netstats [host]", "Print network information on provided host
(connecting node by default)");
@@ -514,6 +515,11 @@ public class NodeCmd
         }
     }
 
+    private void printIsThriftServerRunning(PrintStream outs)
+    {
+        outs.println(probe.isThriftServerRunning() ? "running" : "not running");
+    }
+
     public static void main(String[] args) throws IOException, InterruptedException, ConfigurationException,
ParseException
     {
         CommandLineParser parser = new PosixParser();
@@ -587,6 +593,7 @@ public class NodeCmd
             case ENABLEGOSSIP    : probe.startGossiping(); break;
             case DISABLETHRIFT   : probe.stopThriftServer(); break;
             case ENABLETHRIFT    : probe.startThriftServer(); break;
+            case STATUSTHRIFT    : nodeCmd.printIsThriftServerRunning(System.out); break;
 
             case DRAIN :
                 try { probe.drain(); }

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=1129094&r1=1129093&r2=1129094&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeProbe.java Mon
May 30 09:50:44 2011
@@ -579,6 +579,11 @@ public class NodeProbe
         ssProxy.startRPCServer();
     }
 
+    public boolean isThriftServerRunning()
+    {
+        return ssProxy.isRPCServerRunning();
+    }
+
     public boolean isInitialized()
     {
         return ssProxy.isInitialized();



Mime
View raw message