From 76f33027535a192ab2d76ac1f01a5a8829c845af Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Fri, 27 Mar 2009 02:45:12 +0000 Subject: [PATCH] add error checking of CF names for people migrating old-style configurations git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@759003 13f79535-47bb-0310-9956-ffa450edef68 --- .../cassandra/config/DatabaseDescriptor.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/org/apache/cassandra/config/DatabaseDescriptor.java b/src/org/apache/cassandra/config/DatabaseDescriptor.java index 73cf3a6dee..f906b3eb85 100644 --- a/src/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/org/apache/cassandra/config/DatabaseDescriptor.java @@ -119,7 +119,7 @@ public class DatabaseDescriptor // the path qualified config file (storage-conf.xml) name private static String configFileName_; - + static { try @@ -336,6 +336,10 @@ public class DatabaseDescriptor { 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 @@ public class DatabaseDescriptor seeds_.add( seeds[i] ); } } - catch (Exception e) { + catch (Exception e) + { throw new RuntimeException(e); } - + try { storeMetadata(); @@ -420,7 +425,6 @@ public class DatabaseDescriptor throw new RuntimeException(e); } } - /* * Create the metadata tables. This table has information about @@ -463,6 +467,8 @@ public class DatabaseDescriptor } } + + public static String getHashingStrategy() { return hashingStrategy_;