cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/3] git commit: Add nodetool methods to disable/enable native transport. Patch by Michal Michalski, reviewed by brandonwilliams for CASSANDRA-5425
Date Fri, 05 Apr 2013 14:54:27 GMT
Updated Branches:
  refs/heads/cassandra-1.2 8a422179c -> 1533f124c
  refs/heads/trunk b27c61ba5 -> 0f479eb0f


Add nodetool methods to disable/enable native transport.
Patch by Michal Michalski, reviewed by brandonwilliams for
CASSANDRA-5425


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1533f124
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1533f124
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1533f124

Branch: refs/heads/cassandra-1.2
Commit: 1533f124c12257bcb17bfdf0d9096c239ac78fe8
Parents: 8a42217
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Apr 5 09:52:29 2013 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Apr 5 09:52:29 2013 -0500

----------------------------------------------------------------------
 .../apache/cassandra/service/CassandraDaemon.java  |    4 ++--
 .../apache/cassandra/service/StorageService.java   |    2 +-
 src/java/org/apache/cassandra/tools/NodeCmd.java   |    4 ++++
 src/java/org/apache/cassandra/tools/NodeProbe.java |   10 ++++++++++
 .../org/apache/cassandra/transport/Server.java     |    3 ++-
 .../org/apache/cassandra/tools/NodeToolHelp.yaml   |    6 ++++++
 6 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/java/org/apache/cassandra/service/CassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 4e3bdfc..1eae488 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -368,13 +368,13 @@ public class CassandraDaemon
         if ((nativeFlag != null && Boolean.parseBoolean(nativeFlag)) || (nativeFlag
== null && DatabaseDescriptor.startNativeTransport()))
             nativeServer.start();
         else
-            logger.info("Not starting native transport as requested. Use JMX (StorageService->startNativeTransport())
to start it");
+            logger.info("Not starting native transport as requested. Use JMX (StorageService->startNativeTransport())
or nodetool (enablebinary) to start it");
 
         String rpcFlag = System.getProperty("cassandra.start_rpc");
         if ((rpcFlag != null && Boolean.parseBoolean(rpcFlag)) || (rpcFlag == null
&& DatabaseDescriptor.startRpc()))
             thriftServer.start();
         else
-            logger.info("Not starting RPC server as requested. Use JMX (StorageService->startRPCServer())
to start it");
+            logger.info("Not starting RPC server as requested. Use JMX (StorageService->startRPCServer())
or nodetool (enablethrift) to start it");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 2069484..658f583 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -343,7 +343,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
     {
         if (daemon == null)
         {
-            throw new IllegalStateException("No configured  daemon");
+            throw new IllegalStateException("No configured daemon");
         }
         daemon.nativeServer.stop();
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/java/org/apache/cassandra/tools/NodeCmd.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeCmd.java b/src/java/org/apache/cassandra/tools/NodeCmd.java
index b7ff504..4f3e1e1 100644
--- a/src/java/org/apache/cassandra/tools/NodeCmd.java
+++ b/src/java/org/apache/cassandra/tools/NodeCmd.java
@@ -107,10 +107,12 @@ public class NodeCmd
         COMPACT,
         COMPACTIONSTATS,
         DECOMMISSION,
+        DISABLEBINARY,
         DISABLEGOSSIP,
         DISABLEHANDOFF,
         DISABLETHRIFT,
         DRAIN,
+        ENABLEBINARY,
         ENABLEGOSSIP,
         ENABLEHANDOFF,
         ENABLETHRIFT,
@@ -1048,6 +1050,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 DISABLEBINARY   : probe.stopNativeTransport(); break;
+                case ENABLEBINARY    : probe.startNativeTransport(); break;
                 case DISABLEGOSSIP   : probe.stopGossiping(); break;
                 case ENABLEGOSSIP    : probe.startGossiping(); break;
                 case DISABLEHANDOFF  : probe.disableHintedHandoff(); break;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/java/org/apache/cassandra/tools/NodeProbe.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 2c4555d..43d99d2 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -700,6 +700,16 @@ public class NodeProbe
         hhProxy.pauseHintsDelivery(false);
     }
 
+    public void stopNativeTransport()
+    {
+        ssProxy.stopNativeTransport();
+    }
+
+    public void startNativeTransport()
+    {
+        ssProxy.startNativeTransport();
+    }
+
     public void stopGossiping()
     {
         ssProxy.stopGossiping();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/java/org/apache/cassandra/transport/Server.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/Server.java b/src/java/org/apache/cassandra/transport/Server.java
index 0b01c0d..74394d2 100644
--- a/src/java/org/apache/cassandra/transport/Server.java
+++ b/src/java/org/apache/cassandra/transport/Server.java
@@ -123,7 +123,7 @@ public class Server implements CassandraDaemon.Server
         final EncryptionOptions.ClientEncryptionOptions clientEnc = DatabaseDescriptor.getClientEncryptionOptions();
         if (clientEnc.enabled)
         {
-            logger.info("enabling encrypted CQL connections between client and server");
+            logger.info("Enabling encrypted CQL connections between client and server");
             bootstrap.setPipelineFactory(new SecurePipelineFactory(this, clientEnc));
         }
         else
@@ -145,6 +145,7 @@ public class Server implements CassandraDaemon.Server
         factory = null;
         executionHandler.releaseExternalResources();
         executionHandler = null;
+        logger.info("Stop listening for CQL clients");
     }
 
     public static class ConnectionTracker implements Connection.Tracker

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1533f124/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml
----------------------------------------------------------------------
diff --git a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml
index 1ac687d..6551b07 100644
--- a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml
+++ b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml
@@ -49,6 +49,12 @@ commands:
   - name: compactionstats
     help: |
       Print statistics on compactions
+  - name: disablebinary
+    help: |
+      Disable native transport (binary protocol)
+  - name: enablebinary
+    help: |
+      Reenable native transport (binary protocol)
   - name: disablehandoff
     help: |
       Disable the future hints storing on the current node


Mime
View raw message