cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: Turn MarshalException into ConfigurationException for Thrift
Date Mon, 11 Aug 2014 01:09:03 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1.0 926882095 -> 228f0ade8


Turn MarshalException into ConfigurationException for Thrift

CFMetaData#fromThrift() and CFMetaData#fromThriftForUpdate() should
rethrow MarshalException-s as ConfigurationException-s for Thrift -
for system_update_column_family() and system_add_column_family() sake.


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

Branch: refs/heads/cassandra-2.1.0
Commit: 6976d82ed64f7b48a6d2d465de176abf3c040f81
Parents: a771f60
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Mon Aug 11 03:33:09 2014 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Mon Aug 11 03:33:09 2014 +0300

----------------------------------------------------------------------
 .../org/apache/cassandra/config/CFMetaData.java   | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6976d82e/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 650d6c4..9db1c75 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -900,7 +900,14 @@ public final class CFMetaData
         if (cf_def.isSetKey_alias() && !(cfm.keyValidator instanceof CompositeType))
             cfm.column_metadata.put(cf_def.key_alias, ColumnDefinition.partitionKeyDef(cf_def.key_alias,
cfm.keyValidator, null));
 
-        return cfm.rebuild();
+        try
+        {
+            return cfm.rebuild();
+        }
+        catch (MarshalException e)
+        {
+            throw new ConfigurationException(e.getMessage());
+        }
     }
 
     public static CFMetaData fromThriftForUpdate(org.apache.cassandra.thrift.CfDef cf_def,
CFMetaData toUpdate) throws InvalidRequestException, ConfigurationException
@@ -927,7 +934,14 @@ public final class CFMetaData
             cfm.addOrReplaceColumnDefinition(def);
         }
 
-        return cfm.rebuild();
+        try
+        {
+            return cfm.rebuild();
+        }
+        catch (MarshalException e)
+        {
+            throw new ConfigurationException(e.getMessage());
+        }
     }
 
     // Do most of the work, but don't handle CQL metadata (i.e. skip key_alias and don't
rebuild())


Mime
View raw message