cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject git commit: CFMetaData.fromThrift to throw ConfigurationException upon error patch by Sam Overton; reviewed by Pavel Yaskevich for CASSANDRA-4353
Date Mon, 18 Jun 2012 23:59:46 GMT
Updated Branches:
  refs/heads/cassandra-1.1 45c8f53a2 -> 170e14ab9


CFMetaData.fromThrift to throw ConfigurationException upon error
patch by Sam Overton; reviewed by Pavel Yaskevich for CASSANDRA-4353


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

Branch: refs/heads/cassandra-1.1
Commit: 170e14ab97c5bbdaa3f75d85316e290a72e38959
Parents: 45c8f53
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Jun 19 02:56:43 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Tue Jun 19 02:58:51 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../org/apache/cassandra/config/CFMetaData.java    |   19 ++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/170e14ab/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b6702cb..9e3dd67 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -13,6 +13,7 @@
    composite primary keys (CASSANDRA-4328)
  * Set JVM stack size to 160k for java 7 (CASSANDRA-4275)
  * cqlsh: add COPY command to load data from CSV flat files (CASSANDRA-4012)
+ * CFMetaData.fromThrift to throw ConfigurationException upon error (CASSANDRA-4353)
 Merged from 1.0:
  * Set gc_grace on index CF to 0 (CASSANDRA-4314)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/170e14ab/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index c38841a..c6411af 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -645,12 +645,19 @@ public final class CFMetaData
 
         CompressionParameters cp = CompressionParameters.create(cf_def.compression_options);
 
-        return newCFMD.comment(cf_def.comment)
-                      .replicateOnWrite(cf_def.replicate_on_write)
-                      .defaultValidator(TypeParser.parse(cf_def.default_validation_class))
-                      .keyValidator(TypeParser.parse(cf_def.key_validation_class))
-                      .columnMetadata(ColumnDefinition.fromThrift(cf_def.column_metadata))
-                      .compressionParameters(cp);
+        try
+        {
+            return newCFMD.comment(cf_def.comment)
+                          .replicateOnWrite(cf_def.replicate_on_write)
+                          .defaultValidator(TypeParser.parse(cf_def.default_validation_class))
+                          .keyValidator(TypeParser.parse(cf_def.key_validation_class))
+                          .columnMetadata(ColumnDefinition.fromThrift(cf_def.column_metadata))
+                          .compressionParameters(cp);
+        }
+        catch (MarshalException e)
+        {
+            throw new ConfigurationException(e.getMessage());
+        }
     }
 
     public void reload() throws IOException


Mime
View raw message