cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1070572 - in /cassandra/trunk/src/java/org/apache/cassandra/db/migration: AddColumnFamily.java DropColumnFamily.java RenameColumnFamily.java UpdateColumnFamily.java
Date Mon, 14 Feb 2011 16:59:38 GMT
Author: eevans
Date: Mon Feb 14 16:59:38 2011
New Revision: 1070572

URL: http://svn.apache.org/viewvc?rev=1070572&view=rev
Log:
improved error messages

Patch by eevans for CASSANDRA-1709; reviewed by gdusbabek

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java?rev=1070572&r1=1070571&r2=1070572&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java Mon Feb
14 16:59:38 2011
@@ -45,9 +45,11 @@ public class AddColumnFamily extends Mig
         KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
         
         if (ksm == null)
-            throw new ConfigurationException("Keyspace does not already exist.");
+            throw new ConfigurationException("No such keyspace: " + cfm.tableName);
         else if (ksm.cfMetaData().containsKey(cfm.cfName))
-            throw new ConfigurationException("CF is already defined in that keyspace.");
+            throw new ConfigurationException(String.format("%s already exists in keyspace
%s",
+                                                           cfm.cfName,
+                                                           cfm.tableName));
         else if (!Migration.isLegalName(cfm.cfName))
             throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
         

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java?rev=1070572&r1=1070571&r2=1070572&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java Mon Feb
14 16:59:38 2011
@@ -48,7 +48,7 @@ public class DropColumnFamily extends Mi
         
         KSMetaData ksm = DatabaseDescriptor.getTableDefinition(tableName);
         if (ksm == null)
-            throw new ConfigurationException("Keyspace does not already exist.");
+            throw new ConfigurationException("No such keyspace: " + tableName);
         else if (!ksm.cfMetaData().containsKey(cfName))
             throw new ConfigurationException("CF is not defined in that keyspace.");
         

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java?rev=1070572&r1=1070571&r2=1070572&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java Mon
Feb 14 16:59:38 2011
@@ -53,7 +53,7 @@ public class RenameColumnFamily extends 
         
         KSMetaData ksm = DatabaseDescriptor.getTableDefinition(tableName);
         if (ksm == null)
-            throw new ConfigurationException("Keyspace does not already exist.");
+            throw new ConfigurationException("No such keyspace: " + tableName);
         if (!ksm.cfMetaData().containsKey(oldName))
             throw new ConfigurationException("CF is not defined in that keyspace.");
         if (ksm.cfMetaData().containsKey(newName))

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java?rev=1070572&r1=1070571&r2=1070572&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java Mon
Feb 14 16:59:38 2011
@@ -44,7 +44,7 @@ public class UpdateColumnFamily extends 
         
         KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cf_def.keyspace.toString());
         if (ksm == null)
-            throw new ConfigurationException("Keyspace does not already exist.");
+            throw new ConfigurationException("No such keyspace: " + cf_def.keyspace.toString());
         
         CFMetaData oldCfm = DatabaseDescriptor.getCFMetaData(CFMetaData.getId(cf_def.keyspace.toString(),
cf_def.name.toString()));
         



Mime
View raw message