cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r771465 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Date Mon, 04 May 2009 22:03:52 GMT
Author: jbellis
Date: Mon May  4 22:03:52 2009
New Revision: 771465

URL: http://svn.apache.org/viewvc?rev=771465&view=rev
Log:
user-friendly error when partitioner is missing.  patch by jbellis

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

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=771465&r1=771464&r2=771465&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Mon May  4 22:03:52 2009
@@ -138,6 +138,19 @@
 
             /* Hashing strategy */
             partitionerClass_ = xmlUtils.getNodeValue("/Storage/Partitioner");
+            try
+            {
+                Class.forName(DatabaseDescriptor.getPartitionerClass());
+            }
+            catch (NullPointerException e)
+            {
+                throw new ConfigurationException("Missing partitioner directive /Storage/Partitioner");
+            }
+            catch (ClassNotFoundException e)
+            {
+                throw new ConfigurationException("Invalid partitioner class " + partitionerClass_);
+            }
+
             /* Callout location */
             calloutLocation_ = xmlUtils.getNodeValue("/Storage/CalloutLocation");
 
@@ -415,6 +428,7 @@
         catch (ConfigurationException e)
         {
             logger_.error("Fatal error: " + e.getMessage());
+            System.err.println("Bad configuration; unable to start server");
             System.exit(1);
         }
         catch (Exception e)



Mime
View raw message