You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2009/03/27 03:45:12 UTC

svn commit: r759003 - /incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java

Author: jbellis
Date: Fri Mar 27 02:45:12 2009
New Revision: 759003

URL: http://svn.apache.org/viewvc?rev=759003&view=rev
Log:
add error checking of CF names for people migrating old-style configurations

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java?rev=759003&r1=759002&r2=759003&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java Fri Mar 27 02:45:12 2009
@@ -119,7 +119,7 @@
     
     // the path qualified config file (storage-conf.xml) name
     private static String configFileName_;
-    
+
     static
     {
         try
@@ -336,6 +336,10 @@
                 {
                     Node columnFamily = columnFamilies.item(j);
                     String cName = XMLUtils.getAttributeValue(columnFamily, "Name");
+                    if (cName == null)
+                    {
+                        throw new IllegalArgumentException("ColumnFamily element missing Name attribute: " + columnFamily);
+                    }
                     String xqlCF = xqlTable + "ColumnFamily[@Name='" + cName + "']/";
 
                     /* squirrel away the application column families */
@@ -407,10 +411,11 @@
                 seeds_.add( seeds[i] );
             }
         }
-        catch (Exception e) {
+        catch (Exception e)
+        {
             throw new RuntimeException(e);
         }
-        
+
         try
         {
             storeMetadata();
@@ -420,7 +425,6 @@
             throw new RuntimeException(e);
         }
     }
-    
 
     /*
      * Create the metadata tables. This table has information about
@@ -463,6 +467,8 @@
         }
     }
 
+
+    
     public static String getHashingStrategy()
     {
         return hashingStrategy_;