cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r791598 - in /incubator/cassandra/trunk: conf/storage-conf.xml src/java/org/apache/cassandra/config/DatabaseDescriptor.java test/conf/storage-conf.xml
Date Mon, 06 Jul 2009 20:07:52 GMT
Author: jbellis
Date: Mon Jul  6 20:07:52 2009
New Revision: 791598

URL: http://svn.apache.org/viewvc?rev=791598&view=rev
Log:
disallow specifying ColumnSort on supercolumns.  patch by jbellis; reviewed by Evan Weaver
for CASSANDRA-251

Modified:
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/test/conf/storage-conf.xml

Modified: incubator/cassandra/trunk/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=791598&r1=791597&r2=791598&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Mon Jul  6 20:07:52 2009
@@ -30,6 +30,11 @@
          (ColumnFamilies are closer in meaning to those.)
 
          There is an implicit table named 'system' for Cassandra internals.
+
+         The default ColumnSort is Time for standard column families.
+         For super column families, specifying ColumnSort is not supported;
+         the supercolumns themselves are always name-sorted and their subcolumns
+         are always time-sorted.
     -->
     <Tables>
         <Table Name="Table1">
@@ -51,7 +56,7 @@
             <ColumnFamily ColumnSort="Name" Name="Standard1" FlushPeriodInMinutes="60"/>
             <ColumnFamily ColumnSort="Name" Name="Standard2"/>
             <ColumnFamily ColumnSort="Time" Name="StandardByTime1"/>
-            <ColumnFamily ColumnType="Super" ColumnSort="Name" Name="Super1"/>
+            <ColumnFamily ColumnType="Super" Name="Super1"/>
         </Table>
     </Tables>
 

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=791598&r1=791597&r2=791598&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 Jul  6 20:07:52 2009
@@ -350,9 +350,13 @@
                     {
                         throw new ConfigurationException("invalid column sort value " + rawColumnIndexType);
                     }
-                    if ("Super".equals(columnType) && !"Name".equals(columnIndexType))
+                    if ("Super".equals(columnType))
                     {
-                        throw new ConfigurationException("Super columnfamilies may only be
name-sorted");
+                        if (rawColumnIndexType != null)
+                        {
+                            throw new ConfigurationException("Super columnfamilies are always
name-sorted, and their subcolumns are always time-sorted.  You may not specify the ColumnSort
attribute on a SuperColumn.");
+                        }
+                        columnIndexType = "Name";
                     }
 
                     // see if flush period is set

Modified: incubator/cassandra/trunk/test/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/conf/storage-conf.xml?rev=791598&r1=791597&r2=791598&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/test/conf/storage-conf.xml Mon Jul  6 20:07:52 2009
@@ -45,8 +45,8 @@
        <ColumnFamily ColumnSort="Name" Name="Standard2"/>
        <ColumnFamily ColumnSort="Time" Name="StandardByTime1"/>
        <ColumnFamily ColumnSort="Time" Name="StandardByTime2"/>
-       <ColumnFamily ColumnType="Super" ColumnSort="Name" Name="Super1"/>
-       <ColumnFamily ColumnType="Super" ColumnSort="Name" Name="Super2"/>
+       <ColumnFamily ColumnType="Super" Name="Super1"/>
+       <ColumnFamily ColumnType="Super" Name="Super2"/>
      </Table>
      <Table Name = "Table2">
        <ColumnFamily ColumnSort="Name" Name="Standard1"/>



Mime
View raw message