You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2014/01/07 06:51:33 UTC

[1/2] git commit: Verify that the keyspace exists in describeRing and print nicer error message in BulkLoader.

Updated Branches:
  refs/heads/trunk 694988015 -> 1dc43bdad


Verify that the keyspace exists in describeRing and print nicer error message in BulkLoader.

Patch by marcuse, reviewed by thobbs for CASSANDRA-6529


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

Branch: refs/heads/trunk
Commit: ae0a1e0f5a88d66974582f383a942f6bf42b6ac5
Parents: 95f1b5f
Author: Marcus Eriksson <ma...@apache.org>
Authored: Tue Jan 7 06:48:08 2014 +0100
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Tue Jan 7 06:48:08 2014 +0100

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageService.java   |  3 +++
 .../org/apache/cassandra/tools/BulkLoader.java     | 17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae0a1e0f/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 cca7b00..102e0d8 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1178,6 +1178,9 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     private List<TokenRange> describeRing(String keyspace, boolean includeOnlyLocalDC) throws InvalidRequestException
     {
+        if (!Schema.instance.getKeyspaces().contains(keyspace))
+            throw new InvalidRequestException("No such keyspace: " + keyspace);
+
         if (keyspace == null || Keyspace.open(keyspace).getReplicationStrategy() instanceof LocalStrategy)
             throw new InvalidRequestException("There is no ring for the keyspace: " + keyspace);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae0a1e0f/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 15c8df8..4756bd3 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -76,7 +76,22 @@ public class BulkLoader
         OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
         SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options.hosts, options.rpcPort, options.user, options.passwd, options.transportFactory), handler);
         DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(options.throttle);
-        StreamResultFuture future = loader.stream(options.ignores);
+        StreamResultFuture future = null;
+        try
+        {
+            future = loader.stream(options.ignores);
+        }
+        catch (Exception e)
+        {
+            System.err.println(e.getMessage());
+            if (e.getCause() != null)
+                System.err.println(e.getCause());
+            if (options.debug)
+                e.printStackTrace(System.err);
+            else
+                System.err.println("Run with --debug to get full stack trace or --help to get help.");
+            System.exit(1);
+        }
         future.addEventListener(new ProgressIndicator());
         try
         {


[2/2] git commit: Merge branch 'cassandra-2.0' into trunk

Posted by ma...@apache.org.
Merge branch 'cassandra-2.0' into trunk


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

Branch: refs/heads/trunk
Commit: 1dc43bdad2beb52793253c4aacb737c8de74cd4a
Parents: 6949880 ae0a1e0
Author: Marcus Eriksson <ma...@apache.org>
Authored: Tue Jan 7 06:50:43 2014 +0100
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Tue Jan 7 06:50:43 2014 +0100

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageService.java   |  3 +++
 .../org/apache/cassandra/tools/BulkLoader.java     | 17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1dc43bda/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1dc43bda/src/java/org/apache/cassandra/tools/BulkLoader.java
----------------------------------------------------------------------