cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Provide better exceptions for invalid replication strategy parameters
Date Tue, 10 Mar 2015 03:19:26 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 b9de1d6b9 -> d6ea0ff1f


Provide better exceptions for invalid replication strategy parameters

patch by Alan Boudreault; reviewed by Sam Tunnicliffe for CASSANDRA-8909


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

Branch: refs/heads/cassandra-2.0
Commit: d6ea0ff1f1c01390a4240ddfbbfb5c5b63ee4260
Parents: b9de1d6
Author: Alan Boudreault <alan.boudreault@datastax.com>
Authored: Mon Mar 9 20:18:27 2015 -0700
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Mon Mar 9 20:18:27 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                    | 2 ++
 .../apache/cassandra/locator/AbstractReplicationStrategy.java  | 6 ++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d6ea0ff1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b8774fc..d240a10 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.14:
+ * Provide better exceptions for invalid replication strategy parameters
+   (CASSANDRA-8909)
  * Fix regression in mixed single and multi-column relation support for
    SELECT statements (CASSANDRA-8613)
  * Add ability to limit number of native connections (CASSANDRA-8086)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d6ea0ff1/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
index 754a96b..b6599f1 100644
--- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
+++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
@@ -18,6 +18,7 @@
 package org.apache.cassandra.locator;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.net.InetAddress;
 import java.util.*;
 
@@ -238,6 +239,11 @@ public abstract class AbstractReplicationStrategy
             Constructor<? extends AbstractReplicationStrategy> constructor = strategyClass.getConstructor(parameterTypes);
             strategy = constructor.newInstance(keyspaceName, tokenMetadata, snitch, strategyOptions);
         }
+        catch (InvocationTargetException e)
+        {
+            Throwable targetException = e.getTargetException();
+            throw new ConfigurationException(targetException.getMessage(), targetException);
+        }
         catch (Exception e)
         {
             throw new ConfigurationException("Error constructing replication strategy class",
e);


Mime
View raw message