Author: jbellis
Date: Tue May 24 16:45:26 2011
New Revision: 1127137
URL: http://svn.apache.org/viewvc?rev=1127137&view=rev
Log:
add more descriptive errors for ConfigurationException when updating a CF
definition
patch by jbellis
Modified:
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
Modified:
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java?rev=1127137&r1=1127136&r2=1127137&view=diff
==============================================================================
---
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
(original)
+++
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
Tue May 24 16:45:26 2011
@@ -628,12 +628,16 @@ public final class CFMetaData
public void apply(org.apache.cassandra.avro.CfDef cf_def) throws
ConfigurationException
{
// validate
- if (!cf_def.id.equals(cfId))
- throw new ConfigurationException("ids do not match.");
if (!cf_def.keyspace.toString().equals(tableName))
- throw new ConfigurationException("keyspaces do not match.");
+ throw new ConfigurationException(String.format("Keyspace mismatch
(found %s; expected %s)",
+ cf_def.keyspace,
tableName));
if (!cf_def.name.toString().equals(cfName))
- throw new ConfigurationException("names do not match.");
+ throw new ConfigurationException(String.format("Column family
mismatch (found %s; expected %s)",
+ cf_def.name,
cfName));
+ if (!cf_def.id.equals(cfId))
+ throw new ConfigurationException(String.format("Column family ID
mismatch (found %s; expected %s)",
+ cf_def.id, cfId));
+
if (!cf_def.column_type.toString().equals(cfType.name()))
throw new ConfigurationException("types do not match.");
if (comparator !=
DatabaseDescriptor.getComparator(cf_def.comparator_type))