cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r906998 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: config/DatabaseDescriptor.java service/StorageService.java
Date Fri, 05 Feb 2010 16:47:34 GMT
Author: jbellis
Date: Fri Feb  5 16:47:33 2010
New Revision: 906998

URL: http://svn.apache.org/viewvc?rev=906998&view=rev
Log:
add check to ensure at least one keyspace present.  patch by jbellis

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.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=906998&r1=906997&r2=906998&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
Fri Feb  5 16:47:33 2010
@@ -583,6 +583,8 @@
                     tableToCFMetaDataMap_.get(tName).put(cfName, cfMetaData);
                 }
             }
+            if (tables_.isEmpty())
+                throw new ConfigurationException("No keyspaces configured");
 
             // Hardcoded system tables
             tables_.add(Table.SYSTEM_TABLE);

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=906998&r1=906997&r2=906998&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Fri
Feb  5 16:47:33 2010
@@ -367,13 +367,7 @@
         // some people just want to get a visual representation of things. Allow null and
set it to the first
         // non-system table.
         if (keyspace == null)
-        {
-            for (String ks : DatabaseDescriptor.getNonSystemTables())
-            {
-                keyspace = ks;
-                break;
-            }
-        }
+            keyspace = DatabaseDescriptor.getNonSystemTables().get(0);
 
         /* All the ranges for the tokens */
         List<Range> ranges = getAllRanges(tokenMetadata_.sortedTokens());



Mime
View raw message