Add storage port options to sstableloader

patch by Eduard Tudenhoefner; reviewed by Alex Petrov for CASSANDRA-13844


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

Branch: refs/heads/cassandra-3.0
Commit: 428eaa3e37cab7227c81fdf124d29dfc1db4257c
Parents: 665f693
Author: Eduard Tudenhoefner <eduard.tudenhoef...@datastax.com>
Authored: Tue Sep 5 09:01:32 2017 -0700
Committer: Jason Brown <jasedbr...@gmail.com>
Committed: Wed Sep 20 06:57:35 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/cassandra/tools/BulkLoader.java  | 38 ++++++++++++++++----
 2 files changed, 33 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/428eaa3e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4f8f65f..848628b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.19
+ * Add storage port options to sstableloader (CASSANDRA-13844)
  * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775) 
  * Clone HeartBeatState when building gossip messages. Make its 
generation/version volatile (CASSANDRA-13700)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/428eaa3e/src/java/org/apache/cassandra/tools/BulkLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/BulkLoader.java 
b/src/java/org/apache/cassandra/tools/BulkLoader.java
index 0b1a1d4..52f9467 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -56,6 +56,8 @@ public class BulkLoader
     private static final String IGNORE_NODES_OPTION  = "ignore";
     private static final String INITIAL_HOST_ADDRESS_OPTION = "nodes";
     private static final String RPC_PORT_OPTION = "port";
+    private static final String STORAGE_PORT_OPTION = "storage-port";
+    private static final String SSL_STORAGE_PORT_OPTION = "ssl-storage-port";
     private static final String USER_OPTION = "username";
     private static final String PASSWD_OPTION = "password";
     private static final String THROTTLE_MBITS = "throttle";
@@ -399,7 +401,7 @@ public class BulkLoader
         public boolean debug;
         public boolean verbose;
         public boolean noProgress;
-        public int rpcPort = 9160;
+        public int rpcPort;
         public String user;
         public String passwd;
         public int throttle = 0;
@@ -462,9 +464,6 @@ public class BulkLoader
                 opts.verbose = cmd.hasOption(VERBOSE_OPTION);
                 opts.noProgress = cmd.hasOption(NOPROGRESS_OPTION);
 
-                if (cmd.hasOption(RPC_PORT_OPTION))
-                    opts.rpcPort = 
Integer.parseInt(cmd.getOptionValue(RPC_PORT_OPTION));
-
                 if (cmd.hasOption(USER_OPTION))
                     opts.user = cmd.getOptionValue(USER_OPTION);
 
@@ -532,13 +531,38 @@ public class BulkLoader
                     config.stream_throughput_outbound_megabits_per_sec = 0;
                     
config.inter_dc_stream_throughput_outbound_megabits_per_sec = 0;
                 }
-                opts.storagePort = config.storage_port;
-                opts.sslStoragePort = config.ssl_storage_port;
                 opts.throttle = 
config.stream_throughput_outbound_megabits_per_sec;
                 opts.interDcThrottle = 
config.inter_dc_stream_throughput_outbound_megabits_per_sec;
                 opts.encOptions = config.client_encryption_options;
                 opts.serverEncOptions = config.server_encryption_options;
 
+                if (cmd.hasOption(RPC_PORT_OPTION))
+                {
+                    opts.rpcPort = 
Integer.parseInt(cmd.getOptionValue(RPC_PORT_OPTION));
+                }
+                else
+                {
+                    opts.rpcPort = config.rpc_port;
+                }
+
+                if (cmd.hasOption(STORAGE_PORT_OPTION))
+                {
+                    opts.storagePort = 
Integer.parseInt(cmd.getOptionValue(STORAGE_PORT_OPTION));
+                }
+                else
+                {
+                    opts.storagePort = config.storage_port;
+                }
+
+                if (cmd.hasOption(SSL_STORAGE_PORT_OPTION))
+                {
+                    opts.sslStoragePort = 
Integer.parseInt(cmd.getOptionValue(SSL_STORAGE_PORT_OPTION));
+                }
+                else
+                {
+                    opts.sslStoragePort = config.ssl_storage_port;
+                }
+
                 if (cmd.hasOption(THROTTLE_MBITS))
                 {
                     opts.throttle = 
Integer.parseInt(cmd.getOptionValue(THROTTLE_MBITS));
@@ -667,6 +691,8 @@ public class BulkLoader
             options.addOption("i",  IGNORE_NODES_OPTION, "NODES", "don't 
stream to this (comma separated) list of nodes");
             options.addOption("d",  INITIAL_HOST_ADDRESS_OPTION, "initial 
hosts", "Required. try to connect to these hosts (comma separated) initially 
for ring information");
             options.addOption("p",  RPC_PORT_OPTION, "rpc port", "port used 
for rpc (default 9160)");
+            options.addOption("sp", STORAGE_PORT_OPTION, "storage port", "port 
used for internode communication (default 7000)");
+            options.addOption("ssp", SSL_STORAGE_PORT_OPTION, "ssl storage 
port", "port used for TLS internode communication (default 7001)");
             options.addOption("t",  THROTTLE_MBITS, "throttle", "throttle 
speed in Mbits (default unlimited)");
             options.addOption("idct",  INTER_DC_THROTTLE_MBITS, 
"inter-dc-throttle", "inter-datacenter throttle speed in Mbits (default 
unlimited)");
             options.addOption("u",  USER_OPTION, "username", "username for 
cassandra authentication");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to