disallow specifying ColumnSort on supercolumns. patch by jbellis; reviewed by Evan Weaver for CASSANDRA-251

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@791598 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-07-06 20:07:52 +00:00
parent b54de30a02
commit e324ef9051
3 changed files with 14 additions and 5 deletions

View File

@ -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>

View File

@ -350,9 +350,13 @@ public class DatabaseDescriptor
{
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

View File

@ -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"/>