cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r759003 - /incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java
Date Fri, 27 Mar 2009 02:45:12 GMT
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_;



Mime
View raw message