cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/5] cassandra git commit: Add storage ports options to sstableloader
Date Fri, 12 May 2017 07:00:33 GMT
Add storage ports options to sstableloader

patch by Zhiyan Shao; reviewed by yukim for CASSANDRA-13518


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

Branch: refs/heads/trunk
Commit: 95635f3123d4ba84465fb57df837074b2121176c
Parents: 33344fa
Author: Zhiyan Shao <zhiyan@uber.com>
Authored: Fri May 12 07:39:25 2017 +0900
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri May 12 15:26:41 2017 +0900

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/cassandra/tools/BulkLoader.java  | 26 ++++++++++++++------
 2 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/95635f31/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 31d5800..84aba99 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.14
+ * Add storage port options to sstableloader (CASSANDRA-13518)
  * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847)
  * Avoid reading static row twice from old format sstables (CASSANDRA-13236)
  * Fix NPE in StorageService.excise() (CASSANDRA-13163)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/95635f31/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 9dba1b2..c1849f8 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -53,6 +53,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 NATIVE_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 AUTH_PROVIDER_OPTION = "auth-provider";
@@ -313,7 +315,7 @@ public class BulkLoader
         public boolean debug;
         public boolean verbose;
         public boolean noProgress;
-        public int nativePort = 9042;
+        public int nativePort;
         public String user;
         public String passwd;
         public String authProviderName;
@@ -377,9 +379,6 @@ public class BulkLoader
                 opts.verbose = cmd.hasOption(VERBOSE_OPTION);
                 opts.noProgress = cmd.hasOption(NOPROGRESS_OPTION);
 
-                if (cmd.hasOption(NATIVE_PORT_OPTION))
-                    opts.nativePort = Integer.parseInt(cmd.getOptionValue(NATIVE_PORT_OPTION));
-
                 if (cmd.hasOption(USER_OPTION))
                     opts.user = cmd.getOptionValue(USER_OPTION);
 
@@ -450,8 +449,19 @@ 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;
+
+                if (cmd.hasOption(NATIVE_PORT_OPTION))
+                    opts.nativePort = Integer.parseInt(cmd.getOptionValue(NATIVE_PORT_OPTION));
+                else
+                    opts.nativePort = config.native_transport_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;
                 opts.throttle = config.stream_throughput_outbound_megabits_per_sec;
                 opts.interDcThrottle = config.inter_dc_stream_throughput_outbound_megabits_per_sec;
                 opts.clientEncOptions = config.client_encryption_options;
@@ -597,7 +607,9 @@ public class BulkLoader
             options.addOption(null, NOPROGRESS_OPTION,   "don't display progress");
             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",  NATIVE_PORT_OPTION, "rpc port", "port used for native
connection (default 9042)");
+            options.addOption("p",  NATIVE_PORT_OPTION, "native transport port", "port used
for native connection (default 9042)");
+            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-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message