cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [1/3] cassandra git commit: Don't set clientMode when bulk-loading
Date Tue, 31 Mar 2015 16:56:25 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk acf427e4b -> 4a4ea06a6


Don't set clientMode when bulk-loading

Backport of CASSANDRA-8238 to 2.0 by Tyler Hobbs


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

Branch: refs/heads/trunk
Commit: ec958f05e493d6b59ada4e71572466baeb7b1467
Parents: 88b2f38
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Tue Mar 31 11:54:54 2015 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Tue Mar 31 11:54:54 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                     | 2 ++
 .../org/apache/cassandra/config/YamlConfigurationLoader.java    | 3 ++-
 src/java/org/apache/cassandra/io/sstable/SSTableLoader.java     | 5 -----
 src/java/org/apache/cassandra/tools/BulkLoader.java             | 1 +
 4 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec958f05/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cdd2c77..a956eb6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.14:
+ * Don't set clientMode to true when bulk-loading sstables to avoid
+   a NullPointerException (CASSANDRA-8238)
  * Fix ignored index_interval change in ALTER TABLE statements (CASSANDRA-7976)
  * Do more aggressive compaction in old time windows in DTCS (CASSANDRA-8360)
  * java.lang.AssertionError when reading saved cache (CASSANDRA-8740)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec958f05/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index b520d07..fb82639 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -61,7 +61,8 @@ public class YamlConfigurationLoader implements ConfigurationLoader
             ClassLoader loader = DatabaseDescriptor.class.getClassLoader();
             url = loader.getResource(configUrl);
             if (url == null)
-                throw new ConfigurationException("Cannot locate " + configUrl);
+                throw new ConfigurationException("Cannot locate " + configUrl + ". If you
are executing this from an " +
+                        "external tool, it needs to set Config.setClientMode(true) to avoid
loading configuration.\"");
         }
 
         return url;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec958f05/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java b/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
index 85dc0e4..e32b3cf 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
@@ -53,11 +53,6 @@ public class SSTableLoader implements StreamEventHandler
     private final List<SSTableReader> sstables = new ArrayList<>();
     private final Multimap<InetAddress, StreamSession.SSTableStreamingSections> streamingDetails
= HashMultimap.create();
 
-    static
-    {
-        Config.setClientMode(true);
-    }
-
     public SSTableLoader(File directory, Client client, OutputHandler outputHandler)
     {
         this.directory = directory;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec958f05/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 8e9cfb3..685ebf7 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -74,6 +74,7 @@ public class BulkLoader
 
     public static void main(String args[])
     {
+        Config.setClientMode(true);
         LoaderOptions options = LoaderOptions.parseArgs(args);
         OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
         SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options.hosts,


Mime
View raw message