cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [9/9] git commit: Replace supercolumns internally by composites
Date Wed, 02 Jan 2013 12:41:16 GMT
Updated Branches:
  refs/heads/trunk 565f675b1 -> 3a005df39


Replace supercolumns internally by composites

patch by slebresne; reviewed by Vijay for CASSANDRA-3237


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3a005df3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3a005df3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3a005df3

Branch: refs/heads/trunk
Commit: 3a005df39797bd7b785d76830e72f3487dc9fa4e
Parents: 565f675
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Dec 12 13:59:34 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Jan 2 13:40:13 2013 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 examples/client_only/src/ClientOnlyExample.java    |   12 +-
 .../org/apache/cassandra/config/CFMetaData.java    |  120 ++--
 .../apache/cassandra/config/ColumnDefinition.java  |   14 +-
 .../org/apache/cassandra/config/KSMetaData.java    |    7 +-
 src/java/org/apache/cassandra/config/Schema.java   |   14 -
 .../org/apache/cassandra/cql/DeleteStatement.java  |    9 +-
 .../org/apache/cassandra/cql/QueryProcessor.java   |   25 +-
 .../org/apache/cassandra/cql/UpdateStatement.java  |    6 +-
 .../org/apache/cassandra/cql3/CFDefinition.java    |    4 +-
 .../org/apache/cassandra/cql3/QueryProcessor.java  |    7 +-
 .../cassandra/cql3/operations/ColumnOperation.java |    7 +-
 .../cassandra/cql3/operations/ListOperation.java   |   22 +-
 .../cassandra/cql3/operations/MapOperation.java    |    4 +-
 .../cassandra/cql3/operations/Operation.java       |    4 +-
 .../cql3/operations/PreparedOperation.java         |    4 +-
 .../cassandra/cql3/operations/SetOperation.java    |    4 +-
 .../cql3/statements/AlterTableStatement.java       |    2 +
 .../cassandra/cql3/statements/ColumnGroupMap.java  |   18 +-
 .../cql3/statements/ModificationStatement.java     |    5 +-
 .../cassandra/cql3/statements/SelectStatement.java |   38 +-
 .../cassandra/cql3/statements/UpdateStatement.java |    4 +-
 .../cassandra/db/AbstractColumnContainer.java      |   30 +-
 .../db/AbstractThreadUnsafeSortedColumns.java      |   13 +-
 .../cassandra/db/ArrayBackedSortedColumns.java     |   84 ++--
 .../apache/cassandra/db/AtomicSortedColumns.java   |   89 ++--
 .../org/apache/cassandra/db/BatchlogManager.java   |   11 +-
 .../apache/cassandra/db/CollationController.java   |   17 +-
 src/java/org/apache/cassandra/db/Column.java       |   84 ++--
 src/java/org/apache/cassandra/db/ColumnFamily.java |  119 +----
 .../cassandra/db/ColumnFamilySerializer.java       |   63 ++-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   89 +---
 src/java/org/apache/cassandra/db/ColumnIndex.java  |    8 +-
 .../org/apache/cassandra/db/ColumnSerializer.java  |   30 +-
 .../org/apache/cassandra/db/CounterColumn.java     |   78 +--
 .../org/apache/cassandra/db/CounterMutation.java   |   13 +-
 .../apache/cassandra/db/CounterUpdateColumn.java   |    6 +-
 src/java/org/apache/cassandra/db/DefsTable.java    |   17 +-
 .../org/apache/cassandra/db/DeletedColumn.java     |   12 +-
 src/java/org/apache/cassandra/db/DeletionInfo.java |   17 +-
 src/java/org/apache/cassandra/db/DeletionTime.java |    2 +-
 .../org/apache/cassandra/db/ExpiringColumn.java    |   15 +-
 .../apache/cassandra/db/HintedHandOffManager.java  |   15 +-
 src/java/org/apache/cassandra/db/IColumn.java      |   85 ---
 .../org/apache/cassandra/db/IColumnContainer.java  |   49 --
 .../org/apache/cassandra/db/ISortedColumns.java    |   20 +-
 src/java/org/apache/cassandra/db/Memtable.java     |   14 +-
 src/java/org/apache/cassandra/db/OnDiskAtom.java   |   39 +-
 .../org/apache/cassandra/db/RangeSliceCommand.java |  128 +++--
 .../org/apache/cassandra/db/RangeTombstone.java    |   11 +-
 src/java/org/apache/cassandra/db/ReadCommand.java  |  122 ++++-
 src/java/org/apache/cassandra/db/ReadResponse.java |    3 +-
 .../cassandra/db/RetriedSliceFromReadCommand.java  |   11 +-
 src/java/org/apache/cassandra/db/Row.java          |    5 +-
 .../apache/cassandra/db/RowIteratorFactory.java    |    2 +-
 src/java/org/apache/cassandra/db/RowMutation.java  |  134 +----
 .../cassandra/db/SliceByNamesReadCommand.java      |  109 +++-
 .../apache/cassandra/db/SliceFromReadCommand.java  |   94 +++-
 .../org/apache/cassandra/db/SliceQueryPager.java   |    7 +-
 src/java/org/apache/cassandra/db/SuperColumn.java  |  432 --------------
 src/java/org/apache/cassandra/db/SuperColumns.java |  442 +++++++++++++++
 src/java/org/apache/cassandra/db/SystemTable.java  |   21 +-
 src/java/org/apache/cassandra/db/Table.java        |    2 +-
 .../cassandra/db/ThreadSafeSortedColumns.java      |   60 +--
 .../cassandra/db/TreeMapBackedSortedColumns.java   |   70 +--
 .../db/columniterator/IdentityQueryFilter.java     |    7 -
 .../db/columniterator/IndexedSliceReader.java      |   15 +-
 .../db/columniterator/SSTableNamesIterator.java    |   18 +-
 .../db/columniterator/SimpleSliceReader.java       |   11 +-
 .../db/commitlog/CommitLogDescriptor.java          |    7 +-
 .../cassandra/db/commitlog/CommitLogReplayer.java  |    3 +-
 .../cassandra/db/compaction/CompactionManager.java |    8 +-
 .../db/compaction/LazilyCompactedRow.java          |    4 +-
 .../db/compaction/ParallelCompactionIterable.java  |    4 +-
 .../cassandra/db/compaction/PrecompactedRow.java   |    2 +-
 .../apache/cassandra/db/filter/ColumnCounter.java  |   10 +-
 .../apache/cassandra/db/filter/ColumnSlice.java    |   10 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |    2 +-
 .../cassandra/db/filter/IDiskAtomFilter.java       |   10 +-
 .../cassandra/db/filter/NamesQueryFilter.java      |   20 +-
 .../apache/cassandra/db/filter/QueryFilter.java    |  114 ++---
 .../org/apache/cassandra/db/filter/QueryPath.java  |   26 +-
 .../cassandra/db/filter/SliceQueryFilter.java      |   64 +--
 .../AbstractSimplePerColumnSecondaryIndex.java     |    8 +-
 .../db/index/PerColumnSecondaryIndex.java          |   11 +-
 .../cassandra/db/index/PerRowSecondaryIndex.java   |    2 +-
 .../apache/cassandra/db/index/SecondaryIndex.java  |    2 +-
 .../cassandra/db/index/SecondaryIndexManager.java  |   35 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |    2 +-
 .../db/index/composites/CompositesIndex.java       |    2 +-
 .../db/index/composites/CompositesSearcher.java    |   15 +-
 .../apache/cassandra/db/index/keys/KeysIndex.java  |    4 +-
 .../cassandra/db/index/keys/KeysSearcher.java      |   17 +-
 .../apache/cassandra/db/marshal/AbstractType.java  |   18 +-
 .../cassandra/db/marshal/CollectionType.java       |    4 +-
 .../apache/cassandra/db/marshal/CompositeType.java |   26 +-
 .../org/apache/cassandra/db/marshal/ListType.java  |    6 +-
 .../org/apache/cassandra/db/marshal/MapType.java   |    6 +-
 .../org/apache/cassandra/db/marshal/SetType.java   |    6 +-
 .../cassandra/hadoop/ColumnFamilyInputFormat.java  |   10 +-
 .../cassandra/hadoop/ColumnFamilyRecordReader.java |  113 +++--
 .../cassandra/hadoop/pig/CassandraStorage.java     |   50 +-
 .../org/apache/cassandra/io/IColumnSerializer.java |   45 --
 .../io/sstable/AbstractSSTableSimpleWriter.java    |   21 +-
 .../apache/cassandra/io/sstable/Descriptor.java    |    8 +-
 .../io/sstable/SSTableIdentityIterator.java        |   24 +-
 .../apache/cassandra/io/sstable/SSTableWriter.java |   19 +-
 .../apache/cassandra/io/util/ColumnSortedMap.java  |  295 ----------
 .../apache/cassandra/io/util/IIterableColumns.java |    4 +-
 .../org/apache/cassandra/net/MessagingService.java |    3 +-
 .../org/apache/cassandra/service/CacheService.java |    5 +-
 .../cassandra/service/IndexScanVerbHandler.java    |    2 +-
 .../apache/cassandra/service/MigrationManager.java |    3 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |    2 +-
 .../cassandra/service/RowRepairResolver.java       |    5 +-
 .../org/apache/cassandra/service/StorageProxy.java |    4 +-
 .../cassandra/streaming/IncomingStreamReader.java  |    4 +-
 .../apache/cassandra/thrift/CassandraServer.java   |  283 +++++++---
 .../apache/cassandra/thrift/ThriftValidation.java  |   44 +-
 .../org/apache/cassandra/tools/SSTableExport.java  |   69 +--
 .../org/apache/cassandra/tools/SSTableImport.java  |   66 ++-
 .../serialization/2.0/db.RangeSliceCommand.bin     |  Bin 0 -> 753 bytes
 test/data/serialization/2.0/db.Row.bin             |  Bin 0 -> 587 bytes
 test/data/serialization/2.0/db.RowMutation.bin     |  Bin 0 -> 3770 bytes
 .../2.0/db.SliceByNamesReadCommand.bin             |  Bin 0 -> 437 bytes
 .../serialization/2.0/db.SliceFromReadCommand.bin  |  Bin 0 -> 437 bytes
 test/data/serialization/2.0/db.Truncation.bin      |  Bin 0 -> 257 bytes
 test/data/serialization/2.0/gms.EndpointState.bin  |  Bin 0 -> 73 bytes
 test/data/serialization/2.0/gms.Gossip.bin         |  Bin 0 -> 158 bytes
 .../data/serialization/2.0/service.TreeRequest.bin |  Bin 0 -> 121 bytes
 .../serialization/2.0/service.TreeResponse.bin     |  Bin 0 -> 930 bytes
 .../serialization/2.0/streaming.PendingFile.bin    |  Bin 0 -> 3478 bytes
 .../serialization/2.0/streaming.StreamHeader.bin   |  Bin 0 -> 175917 bytes
 .../serialization/2.0/streaming.StreamReply.bin    |  Bin 0 -> 89 bytes
 .../2.0/streaming.StreamRequestMessage.bin         |  Bin 0 -> 7215 bytes
 test/data/serialization/2.0/utils.BloomFilter.bin  |  Bin 0 -> 2500016 bytes
 .../serialization/2.0/utils.EstimatedHistogram.bin |  Bin 0 -> 97500 bytes
 .../serialization/2.0/utils.LegacyBloomFilter.bin  |  Bin 0 -> 5000170 bytes
 .../org/apache/cassandra/db/LongTableTest.java     |    3 +-
 .../db/compaction/LongCompactionsTest.java         |   47 +--
 .../LongLeveledCompactionStrategyTest.java         |    3 +-
 test/system/__init__.py                            |    2 +
 .../cassandra/AbstractSerializationsTester.java    |    3 +-
 test/unit/org/apache/cassandra/SchemaLoader.java   |   10 +-
 test/unit/org/apache/cassandra/Util.java           |   28 +-
 .../cassandra/config/ColumnDefinitionTest.java     |    2 +-
 .../unit/org/apache/cassandra/config/DefsTest.java |   48 +-
 .../cassandra/db/ArrayBackedSortedColumnsTest.java |   12 +-
 test/unit/org/apache/cassandra/db/CleanupTest.java |    3 +-
 .../cassandra/db/CollationControllerTest.java      |   14 +-
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |  266 ++++-----
 .../org/apache/cassandra/db/ColumnFamilyTest.java  |   46 +--
 .../org/apache/cassandra/db/CommitLogTest.java     |   11 +-
 .../org/apache/cassandra/db/CounterColumnTest.java |    9 +-
 .../apache/cassandra/db/CounterMutationTest.java   |   44 +--
 .../org/apache/cassandra/db/HintedHandOffTest.java |    7 +-
 .../unit/org/apache/cassandra/db/KeyCacheTest.java |   13 +-
 .../org/apache/cassandra/db/KeyCollisionTest.java  |    5 +-
 .../unit/org/apache/cassandra/db/NameSortTest.java |   25 +-
 .../apache/cassandra/db/RangeTombstoneTest.java    |   15 +-
 .../org/apache/cassandra/db/ReadMessageTest.java   |   27 +-
 .../apache/cassandra/db/RecoveryManagerTest.java   |    2 +-
 .../cassandra/db/RecoveryManagerTruncateTest.java  |    5 +-
 .../cassandra/db/RemoveColumnFamilyTest.java       |    7 +-
 .../db/RemoveColumnFamilyWithFlush1Test.java       |    9 +-
 .../db/RemoveColumnFamilyWithFlush2Test.java       |    7 +-
 .../org/apache/cassandra/db/RemoveColumnTest.java  |    9 +-
 .../apache/cassandra/db/RemoveSubColumnTest.java   |   20 +-
 .../apache/cassandra/db/RemoveSuperColumnTest.java |  200 -------
 .../unit/org/apache/cassandra/db/RowCacheTest.java |   19 +-
 .../org/apache/cassandra/db/RowIterationTest.java  |   14 +-
 test/unit/org/apache/cassandra/db/RowTest.java     |   15 -
 test/unit/org/apache/cassandra/db/ScrubTest.java   |   18 +-
 .../cassandra/db/SecondaryIndexColumnSizeTest.java |   12 +-
 .../apache/cassandra/db/SerializationsTest.java    |  130 +++--
 .../org/apache/cassandra/db/SuperColumnTest.java   |  103 ----
 test/unit/org/apache/cassandra/db/TableTest.java   |  132 ++---
 .../unit/org/apache/cassandra/db/TimeSortTest.java |   33 +-
 .../db/compaction/CompactionsPurgeTest.java        |  107 +---
 .../cassandra/db/compaction/CompactionsTest.java   |   26 +-
 .../compaction/LeveledCompactionStrategyTest.java  |    5 +-
 .../cassandra/db/compaction/OneCompactionTest.java |    3 +-
 .../cassandra/db/marshal/CompositeTypeTest.java    |    7 +-
 .../db/marshal/DynamicCompositeTypeTest.java       |    7 +-
 .../cassandra/io/LazilyCompactedRowTest.java       |   43 +--
 .../cassandra/io/sstable/SSTableReaderTest.java    |   15 +-
 .../io/sstable/SSTableSimpleWriterTest.java        |    2 +-
 .../apache/cassandra/io/sstable/SSTableTest.java   |    4 +-
 .../apache/cassandra/io/sstable/SSTableUtils.java  |    9 +-
 .../service/AntiEntropyServiceCounterTest.java     |    3 +-
 .../service/AntiEntropyServiceStandardTest.java    |    3 +-
 .../cassandra/service/CassandraServerTest.java     |    5 +-
 .../apache/cassandra/service/RowResolverTest.java  |   63 --
 .../apache/cassandra/streaming/BootstrapTest.java  |    2 +-
 .../cassandra/streaming/SerializationsTest.java    |    3 +-
 .../cassandra/streaming/StreamingTransferTest.java |   28 +-
 .../apache/cassandra/tools/SSTableExportTest.java  |   82 +---
 .../apache/cassandra/tools/SSTableImportTest.java  |   42 +-
 .../apache/cassandra/utils/EncodedStreamsTest.java |   22 -
 199 files changed, 2588 insertions(+), 3852 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a2e44f4..b25e0a4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,7 @@
  * make index_interval configurable per columnfamily (CASSANDRA-3961)
  * add default_tim_to_live (CASSANDRA-3974)
  * add memtable_flush_period_in_ms (CASSANDRA-4237)
+ * replace supercolumns internally by composites (CASSANDRA-3237)
 
 
 1.2.1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/examples/client_only/src/ClientOnlyExample.java
----------------------------------------------------------------------
diff --git a/examples/client_only/src/ClientOnlyExample.java b/examples/client_only/src/ClientOnlyExample.java
index fa69965..d6f80ae 100644
--- a/examples/client_only/src/ClientOnlyExample.java
+++ b/examples/client_only/src/ClientOnlyExample.java
@@ -20,7 +20,7 @@ import java.nio.ByteBuffer;
 import java.util.*;
 
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.filter.NamesQueryFilter;
 import org.apache.cassandra.service.StorageProxy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.*;
@@ -64,8 +64,7 @@ public class ClientOnlyExample
         for (int i = 0; i < 100; i++)
         {
             RowMutation change = new RowMutation(KEYSPACE, ByteBufferUtil.bytes(("key" + i)));
-            ColumnPath cp = new ColumnPath(COLUMN_FAMILY).setColumn(("colb").getBytes());
-            change.add(new QueryPath(cp), ByteBufferUtil.bytes(("value" + i)), 0);
+            change.add(COLUMN_FAMILY, ByteBufferUtil.bytes("colb"), ByteBufferUtil.bytes(("value" + i)), 0);
 
             // don't call change.apply().  The reason is that is makes a static call into Table, which will perform
             // local storage initialization, which creates local directories.
@@ -80,15 +79,10 @@ public class ClientOnlyExample
     private static void testReading() throws Exception
     {
         // do some queries.
-        Collection<ByteBuffer> cols = new ArrayList<ByteBuffer>()
-        {{
-            add(ByteBufferUtil.bytes("colb"));
-        }};
         for (int i = 0; i < 100; i++)
         {
             List<ReadCommand> commands = new ArrayList<ReadCommand>();
-            SliceByNamesReadCommand readCommand = new SliceByNamesReadCommand(KEYSPACE, ByteBufferUtil.bytes(("key" + i)),
-                                                                              new QueryPath(COLUMN_FAMILY, null, null), cols);
+            SliceByNamesReadCommand readCommand = new SliceByNamesReadCommand(KEYSPACE, ByteBufferUtil.bytes(("key" + i)), COLUMN_FAMILY, new NamesQueryFilter(ByteBufferUtil.bytes("colb")));
             readCommand.setDigestQuery(false);
             commands.add(readCommand);
             List<Row> rows = StorageProxy.read(commands, ConsistencyLevel.ONE);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index 803cea1..359bbb3 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -17,11 +17,13 @@
  */
 package org.apache.cassandra.config;
 
+import java.io.DataInput;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.nio.ByteBuffer;
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.MapDifference;
 import com.google.common.collect.Maps;
 import org.apache.commons.lang.ArrayUtils;
@@ -47,9 +49,9 @@ import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.RequestValidationException;
 import org.apache.cassandra.exceptions.SyntaxException;
-import org.apache.cassandra.io.IColumnSerializer;
 import org.apache.cassandra.io.compress.CompressionParameters;
 import org.apache.cassandra.io.compress.SnappyCompressor;
+import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.thrift.IndexType;
 import org.apache.cassandra.tracing.Tracing;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -251,7 +253,6 @@ public final class CFMetaData
     public final String cfName;                       // name of this column family
     public final ColumnFamilyType cfType;             // standard, super
     public volatile AbstractType<?> comparator;          // bytes, long, timeuuid, utf8, etc.
-    public volatile AbstractType<?> subcolumnComparator; // like comparator, for supercolumns
 
     //OPTIONAL
     private volatile String comment = "";
@@ -308,17 +309,22 @@ public final class CFMetaData
 
     public CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp, AbstractType<?> subcc)
     {
-        this(keyspace, name, type, comp, subcc, getId(keyspace, name));
+        this(keyspace, name, type,  makeComparator(type, comp, subcc));
     }
 
-    CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp, AbstractType<?> subcc, UUID id)
+    public CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp)
+    {
+        this(keyspace, name, type, comp, getId(keyspace, name));
+    }
+
+    @VisibleForTesting
+    CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp,  UUID id)
     {
         // Final fields must be set in constructor
         ksName = keyspace;
         cfName = name;
         cfType = type;
         comparator = comp;
-        subcolumnComparator = enforceSubccDefault(type, subcc);
         cfId = id;
 
         updateCfDef(); // init cqlCfDef
@@ -344,9 +350,11 @@ public final class CFMetaData
         return compile(id, cql, Table.SYSTEM_KS);
     }
 
-    private AbstractType<?> enforceSubccDefault(ColumnFamilyType cftype, AbstractType<?> subcc)
+    private static AbstractType<?> makeComparator(ColumnFamilyType cftype, AbstractType<?> comp, AbstractType<?> subcc)
     {
-        return (subcc == null) && (cftype == ColumnFamilyType.Super) ? BytesType.instance : subcc;
+        return cftype == ColumnFamilyType.Super
+             ? CompositeType.getInstance(comp, subcc == null ? BytesType.instance : subcc)
+             : comp;
     }
 
     private static String enforceCommentNotNull (CharSequence comment)
@@ -386,7 +394,7 @@ public final class CFMetaData
                              ? Caching.KEYS_ONLY
                              : Caching.NONE;
 
-        return new CFMetaData(parent.ksName, parent.indexColumnFamilyName(info), ColumnFamilyType.Standard, columnComparator, null)
+        return new CFMetaData(parent.ksName, parent.indexColumnFamilyName(info), ColumnFamilyType.Standard, columnComparator, (AbstractType)null)
                              .keyValidator(info.getValidator())
                              .readRepairChance(0.0)
                              .dcLocalReadRepairChance(0.0)
@@ -409,13 +417,13 @@ public final class CFMetaData
 
     public CFMetaData clone()
     {
-        return copyOpts(new CFMetaData(ksName, cfName, cfType, comparator, subcolumnComparator, cfId), this);
+        return copyOpts(new CFMetaData(ksName, cfName, cfType, comparator, cfId), this);
     }
 
     // Create a new CFMD by changing just the cfName
     public static CFMetaData rename(CFMetaData cfm, String newName)
     {
-        return copyOpts(new CFMetaData(cfm.ksName, newName, cfm.cfType, cfm.comparator, cfm.subcolumnComparator, cfm.cfId), cfm);
+        return copyOpts(new CFMetaData(cfm.ksName, newName, cfm.cfType, cfm.comparator, cfm.cfId), cfm);
     }
 
     static CFMetaData copyOpts(CFMetaData newCFMD, CFMetaData oldCFMD)
@@ -468,6 +476,11 @@ public final class CFMetaData
         return comment;
     }
 
+    public boolean isSuper()
+    {
+        return cfType == ColumnFamilyType.Super;
+    }
+
     public double getReadRepairChance()
     {
         return readRepairChance;
@@ -542,11 +555,6 @@ public final class CFMetaData
         return Collections.unmodifiableMap(column_metadata);
     }
 
-    public AbstractType<?> getComparatorFor(ByteBuffer superColumnName)
-    {
-        return superColumnName == null ? comparator : subcolumnComparator;
-    }
-
     public double getBloomFilterFpChance()
     {
         return bloomFilterFpChance == null
@@ -591,7 +599,6 @@ public final class CFMetaData
             .append(cfName, rhs.cfName)
             .append(cfType, rhs.cfType)
             .append(comparator, rhs.comparator)
-            .append(subcolumnComparator, rhs.subcolumnComparator)
             .append(comment, rhs.comment)
             .append(readRepairChance, rhs.readRepairChance)
             .append(dcLocalReadRepairChance, rhs.dcLocalReadRepairChance)
@@ -624,7 +631,6 @@ public final class CFMetaData
             .append(cfName)
             .append(cfType)
             .append(comparator)
-            .append(subcolumnComparator)
             .append(comment)
             .append(readRepairChance)
             .append(dcLocalReadRepairChance)
@@ -739,7 +745,7 @@ public final class CFMetaData
                           .replicateOnWrite(cf_def.replicate_on_write)
                           .defaultValidator(TypeParser.parse(cf_def.default_validation_class))
                           .keyValidator(TypeParser.parse(cf_def.key_validation_class))
-                          .columnMetadata(ColumnDefinition.fromThrift(cf_def.column_metadata))
+                          .columnMetadata(ColumnDefinition.fromThrift(cf_def.column_metadata, newCFMD.isSuper()))
                           .compressionParameters(cp);
         }
         catch (SyntaxException e)
@@ -783,10 +789,9 @@ public final class CFMetaData
         validateCompatility(cfm);
 
         // TODO: this method should probably return a new CFMetaData so that
-        // 1) we can keep comparator and subcolumnComparator final
+        // 1) we can keep comparator final
         // 2) updates are applied atomically
         comparator = cfm.comparator;
-        subcolumnComparator = cfm.subcolumnComparator;
 
         // compaction thresholds are checked by ThriftValidation. We shouldn't be doing
         // validation on the apply path; it's too late for that.
@@ -859,14 +864,6 @@ public final class CFMetaData
 
         if (!cfm.comparator.isCompatibleWith(comparator))
             throw new ConfigurationException("comparators do not match or are not compatible.");
-        if (cfm.subcolumnComparator == null)
-        {
-            if (subcolumnComparator != null)
-                throw new ConfigurationException("subcolumncomparators do not match.");
-            // else, it's null and we're good.
-        }
-        else if (!cfm.subcolumnComparator.isCompatibleWith(subcolumnComparator))
-            throw new ConfigurationException("subcolumncomparators do not match or are note compatible.");
     }
 
     public static Class<? extends AbstractCompactionStrategy> createCompactionStrategy(String className) throws ConfigurationException
@@ -908,13 +905,18 @@ public final class CFMetaData
     {
         org.apache.cassandra.thrift.CfDef def = new org.apache.cassandra.thrift.CfDef(ksName, cfName);
         def.setColumn_type(cfType.name());
-        def.setComparator_type(comparator.toString());
-        if (subcolumnComparator != null)
+
+        if (isSuper())
+        {
+            CompositeType ct = (CompositeType)comparator;
+            def.setComparator_type(ct.types.get(0).toString());
+            def.setSubcomparator_type(ct.types.get(1).toString());
+        }
+        else
         {
-            assert cfType == ColumnFamilyType.Super
-                   : String.format("%s CF %s should not have subcomparator %s defined", cfType, cfName, subcolumnComparator);
-            def.setSubcomparator_type(subcolumnComparator.toString());
+            def.setComparator_type(comparator.toString());
         }
+
         def.setComment(enforceCommentNotNull(comment));
         def.setRead_repair_chance(readRepairChance);
         def.setDclocal_read_repair_chance(dcLocalReadRepairChance);
@@ -961,7 +963,7 @@ public final class CFMetaData
      */
     public ColumnDefinition getColumnDefinitionFromColumnName(ByteBuffer columnName)
     {
-        if (comparator instanceof CompositeType)
+        if (!isSuper() && (comparator instanceof CompositeType))
         {
             CompositeType composite = (CompositeType)comparator;
             ByteBuffer[] components = composite.split(columnName);
@@ -1039,18 +1041,16 @@ public final class CFMetaData
         return (cfName + "_" + comparator.getString(columnName) + "_idx").replaceAll("\\W", "");
     }
 
-    public IColumnSerializer getColumnSerializer()
+    public Iterator<OnDiskAtom> getOnDiskIterator(DataInput dis, int count, Descriptor.Version version)
     {
-        if (cfType == ColumnFamilyType.Standard)
-            return Column.serializer();
-        return SuperColumn.serializer(subcolumnComparator);
+        return getOnDiskIterator(dis, count, ColumnSerializer.Flag.LOCAL, (int) (System.currentTimeMillis() / 1000), version);
     }
 
-    public OnDiskAtom.Serializer getOnDiskSerializer()
+    public Iterator<OnDiskAtom> getOnDiskIterator(DataInput dis, int count, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version)
     {
-        if (cfType == ColumnFamilyType.Standard)
-            return Column.onDiskSerializer();
-        return SuperColumn.onDiskSerializer(subcolumnComparator);
+        if (version.hasSuperColumns && cfType == ColumnFamilyType.Super)
+            return SuperColumns.onDiskIterator(dis, count, flag, expireBefore);
+        return Column.onDiskIterator(dis, count, flag, expireBefore, version);
     }
 
     public static boolean isNameValid(String name)
@@ -1073,22 +1073,9 @@ public final class CFMetaData
         if (cfType == null)
             throw new ConfigurationException(String.format("Invalid column family type for %s", cfName));
 
-        if (cfType == ColumnFamilyType.Super)
-        {
-            if (subcolumnComparator == null)
-                throw new ConfigurationException(String.format("Missing subcolumn comparator for super column family %s", cfName));
-        }
-        else
-        {
-            if (subcolumnComparator != null)
-                throw new ConfigurationException(String.format("Subcolumn comparator (%s) is invalid for standard column family %s", subcolumnComparator, cfName));
-        }
-
 
         if (comparator instanceof CounterColumnType)
             throw new ConfigurationException("CounterColumnType is not a valid comparator");
-        if (subcolumnComparator instanceof CounterColumnType)
-            throw new ConfigurationException("CounterColumnType is not a valid sub-column comparator");
         if (keyValidator instanceof CounterColumnType)
             throw new ConfigurationException("CounterColumnType is not a valid key validator");
 
@@ -1315,9 +1302,21 @@ public final class CFMetaData
             cf.addColumn(Column.create(oldId, timestamp, cfName, "id"));
 
         cf.addColumn(Column.create(cfType.toString(), timestamp, cfName, "type"));
-        cf.addColumn(Column.create(comparator.toString(), timestamp, cfName, "comparator"));
-        if (subcolumnComparator != null)
-            cf.addColumn(Column.create(subcolumnComparator.toString(), timestamp, cfName, "subcomparator"));
+
+        if (isSuper())
+        {
+            // We need to continue saving the comparator and subcomparator separatly, otherwise
+            // we won't know at deserialization if the subcomparator should be taken into account
+            // TODO: we should implement an on-start migration if we want to get rid of that.
+            CompositeType ct = (CompositeType)comparator;
+            cf.addColumn(Column.create(ct.types.get(0).toString(), timestamp, cfName, "comparator"));
+            cf.addColumn(Column.create(ct.types.get(1).toString(), timestamp, cfName, "subcomparator"));
+        }
+        else
+        {
+            cf.addColumn(Column.create(comparator.toString(), timestamp, cfName, "comparator"));
+        }
+
         cf.addColumn(comment == null ? DeletedColumn.create(ldt, timestamp, cfName, "comment")
                                      : Column.create(comment, timestamp, cfName, "comment"));
         cf.addColumn(Column.create(readRepairChance, timestamp, cfName, "read_repair_chance"));
@@ -1462,7 +1461,7 @@ public final class CFMetaData
 
     public AbstractType<?> getColumnDefinitionComparator(Integer componentIndex)
     {
-        AbstractType<?> cfComparator = cfType == ColumnFamilyType.Super ? subcolumnComparator : comparator;
+        AbstractType<?> cfComparator = cfType == ColumnFamilyType.Super ? ((CompositeType)comparator).types.get(1) : comparator;
         if (cfComparator instanceof CompositeType)
         {
             if (componentIndex == null)
@@ -1515,7 +1514,7 @@ public final class CFMetaData
      */
     public boolean isThriftIncompatible()
     {
-        if (!cqlCfDef.isComposite)
+        if (isSuper() || !cqlCfDef.isComposite)
             return false;
 
         for (ColumnDefinition columnDef : column_metadata.values())
@@ -1535,7 +1534,6 @@ public final class CFMetaData
             .append("cfName", cfName)
             .append("cfType", cfType)
             .append("comparator", comparator)
-            .append("subcolumncomparator", subcolumnComparator)
             .append("comment", comment)
             .append("readRepairChance", readRepairChance)
             .append("dclocalReadRepairChance", dcLocalReadRepairChance)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/config/ColumnDefinition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ColumnDefinition.java b/src/java/org/apache/cassandra/config/ColumnDefinition.java
index 328d0ff..81fce0b 100644
--- a/src/java/org/apache/cassandra/config/ColumnDefinition.java
+++ b/src/java/org/apache/cassandra/config/ColumnDefinition.java
@@ -25,7 +25,6 @@ import com.google.common.collect.Maps;
 import org.apache.cassandra.cql3.QueryProcessor;
 import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.*;
 import org.apache.cassandra.exceptions.*;
 import org.apache.cassandra.service.StorageService;
@@ -116,24 +115,25 @@ public class ColumnDefinition
         return cd;
     }
 
-    public static ColumnDefinition fromThrift(ColumnDef thriftColumnDef) throws SyntaxException, ConfigurationException
+    public static ColumnDefinition fromThrift(ColumnDef thriftColumnDef, boolean isSuper) throws SyntaxException, ConfigurationException
     {
+        // For super columns, the componentIndex is 1 because the ColumnDefinition applies to the column component.
         return new ColumnDefinition(ByteBufferUtil.clone(thriftColumnDef.name),
                                     TypeParser.parse(thriftColumnDef.validation_class),
                                     thriftColumnDef.index_type,
                                     thriftColumnDef.index_options,
                                     thriftColumnDef.index_name,
-                                    null);
+                                    isSuper ? 1 : null);
     }
 
-    public static Map<ByteBuffer, ColumnDefinition> fromThrift(List<ColumnDef> thriftDefs) throws SyntaxException, ConfigurationException
+    public static Map<ByteBuffer, ColumnDefinition> fromThrift(List<ColumnDef> thriftDefs, boolean isSuper) throws SyntaxException, ConfigurationException
     {
         if (thriftDefs == null)
             return new HashMap<ByteBuffer,ColumnDefinition>();
 
         Map<ByteBuffer, ColumnDefinition> cds = new TreeMap<ByteBuffer, ColumnDefinition>();
         for (ColumnDef thriftColumnDef : thriftDefs)
-            cds.put(ByteBufferUtil.clone(thriftColumnDef.name), fromThrift(thriftColumnDef));
+            cds.put(ByteBufferUtil.clone(thriftColumnDef.name), fromThrift(thriftColumnDef, isSuper));
 
         return cds;
     }
@@ -224,6 +224,9 @@ public class ColumnDefinition
                     index_name = result.getString("index_name");
                 if (result.has("component_index"))
                     componentIndex = result.getInt("component_index");
+                // A ColumnDefinition for super columns applies to the column component
+                else if (cfm.isSuper())
+                    componentIndex = 1;
 
                 cds.add(new ColumnDefinition(cfm.getColumnDefinitionComparator(componentIndex).fromString(result.getString("column_name")),
                                              TypeParser.parse(result.getString("validator")),
@@ -246,7 +249,6 @@ public class ColumnDefinition
         DecoratedKey key = StorageService.getPartitioner().decorateKey(SystemTable.getSchemaKSKey(ksName));
         ColumnFamilyStore columnsStore = SystemTable.schemaCFS(SystemTable.SCHEMA_COLUMNS_CF);
         ColumnFamily cf = columnsStore.getColumnFamily(key,
-                                                       new QueryPath(SystemTable.SCHEMA_COLUMNS_CF),
                                                        DefsTable.searchComposite(cfName, true),
                                                        DefsTable.searchComposite(cfName, false),
                                                        false,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/config/KSMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/KSMetaData.java b/src/java/org/apache/cassandra/config/KSMetaData.java
index e5b349a..03ef6f5 100644
--- a/src/java/org/apache/cassandra/config/KSMetaData.java
+++ b/src/java/org/apache/cassandra/config/KSMetaData.java
@@ -27,7 +27,6 @@ import org.apache.cassandra.auth.Auth;
 import org.apache.cassandra.cql3.QueryProcessor;
 import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.locator.*;
 import org.apache.cassandra.service.StorageService;
@@ -234,9 +233,9 @@ public final class KSMetaData
     public RowMutation dropFromSchema(long timestamp)
     {
         RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(name));
-        rm.delete(new QueryPath(SystemTable.SCHEMA_KEYSPACES_CF), timestamp);
-        rm.delete(new QueryPath(SystemTable.SCHEMA_COLUMNFAMILIES_CF), timestamp);
-        rm.delete(new QueryPath(SystemTable.SCHEMA_COLUMNS_CF), timestamp);
+        rm.delete(SystemTable.SCHEMA_KEYSPACES_CF, timestamp);
+        rm.delete(SystemTable.SCHEMA_COLUMNFAMILIES_CF, timestamp);
+        rm.delete(SystemTable.SCHEMA_COLUMNS_CF, timestamp);
 
         return rm;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/config/Schema.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Schema.java b/src/java/org/apache/cassandra/config/Schema.java
index fa3ff24..23b0f11 100644
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@ -236,20 +236,6 @@ public class Schema
     }
 
     /**
-     * Get subComparator of the ColumnFamily
-     *
-     * @param ksName The keyspace name
-     * @param cfName The ColumnFamily name
-     *
-     * @return The subComparator of the ColumnFamily
-     */
-    public AbstractType<?> getSubComparator(String ksName, String cfName)
-    {
-        assert ksName != null;
-        return getCFMetaData(ksName, cfName).subcolumnComparator;
-    }
-
-    /**
      * Get value validator for specific column
      *
      * @param ksName The keyspace name

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql/DeleteStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/DeleteStatement.java b/src/java/org/apache/cassandra/cql/DeleteStatement.java
index 87f48aa..0a1f90c 100644
--- a/src/java/org/apache/cassandra/cql/DeleteStatement.java
+++ b/src/java/org/apache/cassandra/cql/DeleteStatement.java
@@ -26,7 +26,6 @@ import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.IMutation;
 import org.apache.cassandra.db.RowMutation;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.UnauthorizedException;
@@ -93,21 +92,19 @@ public class DeleteStatement extends AbstractModification
 
         QueryProcessor.validateKeyAlias(metadata, keyName);
 
-        AbstractType<?> comparator = metadata.getComparatorFor(null);
-
         if (columns.size() < 1)
         {
             // No columns, delete the row
-            rm.delete(new QueryPath(columnFamily), (timestamp == null) ? getTimestamp(clientState) : timestamp);
+            rm.delete(columnFamily, (timestamp == null) ? getTimestamp(clientState) : timestamp);
         }
         else
         {
             // Delete specific columns
             for (Term column : columns)
             {
-                ByteBuffer columnName = column.getByteBuffer(comparator, variables);
+                ByteBuffer columnName = column.getByteBuffer(metadata.comparator, variables);
                 validateColumnName(columnName);
-                rm.delete(new QueryPath(columnFamily, null, columnName), (timestamp == null) ? getTimestamp(clientState) : timestamp);
+                rm.delete(columnFamily, columnName, (timestamp == null) ? getTimestamp(clientState) : timestamp);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java
index ec07761..c54a4eb 100644
--- a/src/java/org/apache/cassandra/cql/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java
@@ -76,13 +76,12 @@ public class QueryProcessor
     private static List<org.apache.cassandra.db.Row> getSlice(CFMetaData metadata, SelectStatement select, List<ByteBuffer> variables)
     throws InvalidRequestException, ReadTimeoutException, UnavailableException, IsBootstrappingException
     {
-        QueryPath queryPath = new QueryPath(select.getColumnFamily());
         List<ReadCommand> commands = new ArrayList<ReadCommand>();
 
         // ...of a list of column names
         if (!select.isColumnRange())
         {
-            Collection<ByteBuffer> columnNames = getColumnNames(select, metadata, variables);
+            SortedSet<ByteBuffer> columnNames = getColumnNames(select, metadata, variables);
             validateColumnNames(columnNames);
 
             for (Term rawKey: select.getKeys())
@@ -90,7 +89,7 @@ public class QueryProcessor
                 ByteBuffer key = rawKey.getByteBuffer(metadata.getKeyValidator(),variables);
 
                 validateKey(key);
-                commands.add(new SliceByNamesReadCommand(metadata.ksName, key, queryPath, columnNames));
+                commands.add(new SliceByNamesReadCommand(metadata.ksName, key, select.getColumnFamily(), new NamesQueryFilter(columnNames)));
             }
         }
         // ...a range (slice) of column names
@@ -108,11 +107,8 @@ public class QueryProcessor
                 validateSliceFilter(metadata, start, finish, select.isColumnsReversed());
                 commands.add(new SliceFromReadCommand(metadata.ksName,
                                                       key,
-                                                      queryPath,
-                                                      start,
-                                                      finish,
-                                                      select.isColumnsReversed(),
-                                                      select.getColumnsLimit()));
+                                                      select.getColumnFamily(),
+                                                      new SliceQueryFilter(start, finish, select.isColumnsReversed(), select.getColumnsLimit())));
             }
         }
 
@@ -191,7 +187,6 @@ public class QueryProcessor
         {
             rows = StorageProxy.getRangeSlice(new RangeSliceCommand(metadata.ksName,
                                                                     select.getColumnFamily(),
-                                                                    null,
                                                                     columnFilter,
                                                                     bounds,
                                                                     expressions,
@@ -300,10 +295,10 @@ public class QueryProcessor
     {
         for (ByteBuffer name : columns)
         {
-            if (name.remaining() > IColumn.MAX_NAME_LENGTH)
+            if (name.remaining() > org.apache.cassandra.db.Column.MAX_NAME_LENGTH)
                 throw new InvalidRequestException(String.format("column name is too long (%s > %s)",
                                                                 name.remaining(),
-                                                                IColumn.MAX_NAME_LENGTH));
+                                                                org.apache.cassandra.db.Column.MAX_NAME_LENGTH));
             if (name.remaining() == 0)
                 throw new InvalidRequestException("zero-length column name");
         }
@@ -352,7 +347,7 @@ public class QueryProcessor
     private static void validateSliceFilter(CFMetaData metadata, ByteBuffer start, ByteBuffer finish, boolean reversed)
     throws InvalidRequestException
     {
-        AbstractType<?> comparator = metadata.getComparatorFor(null);
+        AbstractType<?> comparator = metadata.comparator;
         Comparator<ByteBuffer> orderedComparator = reversed ? comparator.reverseComparator: comparator;
         if (start.remaining() > 0 && finish.remaining() > 0 && orderedComparator.compare(start, finish) > 0)
             throw new InvalidRequestException("range finish must come after start in traversal order");
@@ -456,7 +451,7 @@ public class QueryProcessor
                         // preserve comparator order
                         if (row.cf != null)
                         {
-                            for (IColumn c : row.cf.getSortedColumns())
+                            for (org.apache.cassandra.db.Column c : row.cf.getSortedColumns())
                             {
                                 if (c.isMarkedForDelete())
                                     continue;
@@ -502,7 +497,7 @@ public class QueryProcessor
                             ColumnDefinition cd = metadata.getColumnDefinitionFromColumnName(name);
                             if (cd != null)
                                 result.schema.value_types.put(name, TypeParser.getShortName(cd.getValidator()));
-                            IColumn c = row.cf.getColumn(name);
+                            org.apache.cassandra.db.Column c = row.cf.getColumn(name);
                             if (c == null || c.isMarkedForDelete())
                                 thriftColumns.add(new Column().setName(name));
                             else
@@ -833,7 +828,7 @@ public class QueryProcessor
         return cql.hashCode();
     }
 
-    private static Column thriftify(IColumn c)
+    private static Column thriftify(org.apache.cassandra.db.Column c)
     {
         ByteBuffer value = (c instanceof CounterColumn)
                            ? ByteBufferUtil.bytes(CounterContext.instance().total(c.value()))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/UpdateStatement.java b/src/java/org/apache/cassandra/cql/UpdateStatement.java
index 3470bca..0e1250f 100644
--- a/src/java/org/apache/cassandra/cql/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql/UpdateStatement.java
@@ -27,7 +27,6 @@ import org.apache.cassandra.db.CounterMutation;
 import org.apache.cassandra.db.ConsistencyLevel;
 import org.apache.cassandra.db.IMutation;
 import org.apache.cassandra.db.RowMutation;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.UnauthorizedException;
@@ -197,7 +196,8 @@ public class UpdateStatement extends AbstractModification
                 ByteBuffer colValue = op.a.getByteBuffer(getValueValidator(keyspace, colName),variables);
 
                 validateColumn(metadata, colName, colValue);
-                rm.add(new QueryPath(columnFamily, null, colName),
+                rm.add(columnFamily,
+                       colName,
                        colValue,
                        (timestamp == null) ? getTimestamp(clientState) : timestamp,
                        getTimeToLive());
@@ -221,7 +221,7 @@ public class UpdateStatement extends AbstractModification
                                                       op.b.getText()));
                 }
 
-                rm.addCounter(new QueryPath(columnFamily, null, colName), value);
+                rm.addCounter(columnFamily, colName, value);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/CFDefinition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/CFDefinition.java b/src/java/org/apache/cassandra/cql3/CFDefinition.java
index 670fdb4..14576ba 100644
--- a/src/java/org/apache/cassandra/cql3/CFDefinition.java
+++ b/src/java/org/apache/cassandra/cql3/CFDefinition.java
@@ -90,6 +90,7 @@ public class CFDefinition implements Iterable<CFDefinition.Name>
              * We are a "sparse" composite, i.e. a non-compact one, if either:
              *   - the last type of the composite is a ColumnToCollectionType
              *   - or we have one less alias than of composite types and the last type is UTF8Type.
+             *   - some metadata are defined
              *
              * Note that this is not perfect: if someone upgrading from thrift "renames" all but
              * the last column alias, the cf will be considered "sparse" and he will be stuck with
@@ -98,7 +99,8 @@ public class CFDefinition implements Iterable<CFDefinition.Name>
              */
             int last = composite.types.size() - 1;
             AbstractType<?> lastType = composite.types.get(last);
-            if (lastType instanceof ColumnToCollectionType
+            if (!cfm.getColumn_metadata().isEmpty()
+                || lastType instanceof ColumnToCollectionType
                 || (cfm.getColumnAliases().size() == last && lastType instanceof UTF8Type))
             {
                 // "sparse" composite

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index fec45e6..b675cda 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -85,10 +85,10 @@ public class QueryProcessor
     {
         for (ByteBuffer name : columns)
         {
-            if (name.remaining() > IColumn.MAX_NAME_LENGTH)
+            if (name.remaining() > Column.MAX_NAME_LENGTH)
                 throw new InvalidRequestException(String.format("column name is too long (%s > %s)",
                                                                 name.remaining(),
-                                                                IColumn.MAX_NAME_LENGTH));
+                                                                Column.MAX_NAME_LENGTH));
             if (name.remaining() == 0)
                 throw new InvalidRequestException("zero-length column name");
         }
@@ -114,8 +114,7 @@ public class QueryProcessor
     {
         try
         {
-            AbstractType<?> comparator = metadata.getComparatorFor(null);
-            ColumnSlice.validate(range.slices, comparator, range.reversed);
+            ColumnSlice.validate(range.slices, metadata.comparator, range.reversed);
         }
         catch (IllegalArgumentException e)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/ColumnOperation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/ColumnOperation.java b/src/java/org/apache/cassandra/cql3/operations/ColumnOperation.java
index 224829f..c5f5b44 100644
--- a/src/java/org/apache/cassandra/cql3/operations/ColumnOperation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/ColumnOperation.java
@@ -23,8 +23,7 @@ import java.util.List;
 
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
-import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.db.marshal.ListType;
@@ -63,7 +62,7 @@ public class ColumnOperation implements Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         switch (kind)
         {
@@ -109,7 +108,7 @@ public class ColumnOperation implements Operation
                 val = -val;
         }
 
-        cf.addCounter(new QueryPath(cf.metadata().cfName, null, builder.build()), val);
+        cf.addCounter(builder.build(), val);
     }
 
     public void addBoundNames(ColumnSpecification column, ColumnSpecification[] boundNames) throws InvalidRequestException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/ListOperation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/ListOperation.java b/src/java/org/apache/cassandra/cql3/operations/ListOperation.java
index 1e09195..5416c85 100644
--- a/src/java/org/apache/cassandra/cql3/operations/ListOperation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/ListOperation.java
@@ -30,7 +30,7 @@ import org.apache.cassandra.cql3.ColumnSpecification;
 import org.apache.cassandra.cql3.Term;
 import org.apache.cassandra.cql3.UpdateParameters;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.db.marshal.Int32Type;
@@ -99,7 +99,7 @@ public class ListOperation implements Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (!(validator instanceof ListType || (kind == Kind.SET_IDX && validator instanceof MapType)))
             throw new InvalidRequestException("List operations are only supported on List typed columns, but " + validator + " given.");
@@ -198,7 +198,7 @@ public class ListOperation implements Operation
         }
     }
 
-    public static void doDiscardFromPrepared(ColumnFamily cf, ColumnNameBuilder builder, ListType validator, Term values, UpdateParameters params, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+    public static void doDiscardFromPrepared(ColumnFamily cf, ColumnNameBuilder builder, ListType validator, Term values, UpdateParameters params, List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (!values.isBindMarker())
             throw new InvalidRequestException("Can't apply operation on column with " + validator + " type.");
@@ -214,9 +214,9 @@ public class ListOperation implements Operation
             for (Object elt : l)
                 toDiscard.add(validator.valueComparator().decompose(elt));
 
-            for (Pair<ByteBuffer, IColumn> p : list)
+            for (Pair<ByteBuffer, Column> p : list)
             {
-                IColumn c = p.right;
+                Column c = p.right;
                 if (toDiscard.contains(c.value()))
                     cf.addColumn(params.makeTombstone(c.name()));
             }
@@ -227,7 +227,7 @@ public class ListOperation implements Operation
         }
     }
 
-    private void doSet(ColumnFamily cf, ColumnNameBuilder builder, UpdateParameters params, CollectionType validator, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+    private void doSet(ColumnFamily cf, ColumnNameBuilder builder, UpdateParameters params, CollectionType validator, List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         int idx = validateListIdx(values.get(0), list);
         Term value = values.get(1);
@@ -261,7 +261,7 @@ public class ListOperation implements Operation
         }
     }
 
-    private void doDiscard(ColumnFamily cf, CollectionType validator, UpdateParameters params, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+    private void doDiscard(ColumnFamily cf, CollectionType validator, UpdateParameters params, List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (list == null)
             return;
@@ -271,15 +271,15 @@ public class ListOperation implements Operation
         for (Term value : values)
             toDiscard.add(value.getByteBuffer(validator.valueComparator(), params.variables));
 
-        for (Pair<ByteBuffer, IColumn> p : list)
+        for (Pair<ByteBuffer, Column> p : list)
         {
-            IColumn c = p.right;
+            Column c = p.right;
             if (toDiscard.contains(c.value()))
                 cf.addColumn(params.makeTombstone(c.name()));
         }
     }
 
-    private void doDiscardIdx(ColumnFamily cf, UpdateParameters params, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+    private void doDiscardIdx(ColumnFamily cf, UpdateParameters params, List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         int idx = validateListIdx(values.get(0), list);
         cf.addColumn(params.makeTombstone(list.get(idx).right.name()));
@@ -381,7 +381,7 @@ public class ListOperation implements Operation
         return "ListOperation(" + kind + ", " + values + ")";
     }
 
-    private int validateListIdx(Term value, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+    private int validateListIdx(Term value, List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         try
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/MapOperation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/MapOperation.java b/src/java/org/apache/cassandra/cql3/operations/MapOperation.java
index ddded47..7710154 100644
--- a/src/java/org/apache/cassandra/cql3/operations/MapOperation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/MapOperation.java
@@ -29,7 +29,7 @@ import org.apache.cassandra.cql3.ColumnSpecification;
 import org.apache.cassandra.cql3.Term;
 import org.apache.cassandra.cql3.UpdateParameters;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.db.marshal.MapType;
@@ -63,7 +63,7 @@ public class MapOperation implements Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (!(validator instanceof MapType))
             throw new InvalidRequestException("Map operations are only supported on Map typed columns, but " + validator + " given.");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/Operation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/Operation.java b/src/java/org/apache/cassandra/cql3/operations/Operation.java
index 6c30f7c..052c3be 100644
--- a/src/java/org/apache/cassandra/cql3/operations/Operation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/Operation.java
@@ -25,7 +25,7 @@ import org.apache.cassandra.cql3.ColumnSpecification;
 import org.apache.cassandra.cql3.Term;
 import org.apache.cassandra.cql3.UpdateParameters;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.exceptions.InvalidRequestException;
@@ -39,7 +39,7 @@ public interface Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException;
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException;
 
     public void addBoundNames(ColumnSpecification column, ColumnSpecification[] boundNames) throws InvalidRequestException;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/PreparedOperation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/PreparedOperation.java b/src/java/org/apache/cassandra/cql3/operations/PreparedOperation.java
index 969e63c..0e7cb1b 100644
--- a/src/java/org/apache/cassandra/cql3/operations/PreparedOperation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/PreparedOperation.java
@@ -23,7 +23,7 @@ import java.util.List;
 
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.db.marshal.ListType;
@@ -50,7 +50,7 @@ public class PreparedOperation implements Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (validator instanceof CollectionType)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/operations/SetOperation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/operations/SetOperation.java b/src/java/org/apache/cassandra/cql3/operations/SetOperation.java
index e7f01c6..657a2ca 100644
--- a/src/java/org/apache/cassandra/cql3/operations/SetOperation.java
+++ b/src/java/org/apache/cassandra/cql3/operations/SetOperation.java
@@ -27,7 +27,7 @@ import org.apache.cassandra.cql3.ColumnSpecification;
 import org.apache.cassandra.cql3.Term;
 import org.apache.cassandra.cql3.UpdateParameters;
 import org.apache.cassandra.db.ColumnFamily;
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CollectionType;
 import org.apache.cassandra.db.marshal.MarshalException;
@@ -53,7 +53,7 @@ public class SetOperation implements Operation
                         ColumnNameBuilder builder,
                         AbstractType<?> validator,
                         UpdateParameters params,
-                        List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
+                        List<Pair<ByteBuffer, Column>> list) throws InvalidRequestException
     {
         if (!(validator instanceof SetType))
             throw new InvalidRequestException("Set operations are only supported on Set typed columns, but " + validator + " given.");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index ee8c987..e9f5425 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@ -93,6 +93,8 @@ public class AlterTableStatement extends SchemaAlteringStatement
                 {
                     if (!cfDef.isComposite)
                         throw new InvalidRequestException("Cannot use collection types with non-composite PRIMARY KEY");
+                    if (cfDef.cfm.isSuper())
+                        throw new InvalidRequestException("Cannot use collection types with Super column family");
 
                     componentIndex--;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/statements/ColumnGroupMap.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/ColumnGroupMap.java b/src/java/org/apache/cassandra/cql3/statements/ColumnGroupMap.java
index 2625fef..20fa3bd 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ColumnGroupMap.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ColumnGroupMap.java
@@ -24,7 +24,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cassandra.db.IColumn;
+import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.marshal.CompositeType;
 import org.apache.cassandra.utils.Pair;
 
@@ -38,7 +38,7 @@ public class ColumnGroupMap
         this.fullPath = fullPath;
     }
 
-    private void add(ByteBuffer[] fullName, int idx, IColumn column)
+    private void add(ByteBuffer[] fullName, int idx, Column column)
     {
         ByteBuffer columnName = fullName[idx];
         if (fullName.length == idx + 2)
@@ -66,7 +66,7 @@ public class ColumnGroupMap
         return fullPath[pos];
     }
 
-    public IColumn getSimple(ByteBuffer key)
+    public Column getSimple(ByteBuffer key)
     {
         Value v = map.get(key);
         if (v == null)
@@ -76,29 +76,29 @@ public class ColumnGroupMap
         return ((Simple)v).column;
     }
 
-    public List<Pair<ByteBuffer, IColumn>> getCollection(ByteBuffer key)
+    public List<Pair<ByteBuffer, Column>> getCollection(ByteBuffer key)
     {
         Value v = map.get(key);
         if (v == null)
             return null;
 
         assert v instanceof Collection;
-        return (List<Pair<ByteBuffer, IColumn>>)v;
+        return (List<Pair<ByteBuffer, Column>>)v;
     }
 
     private interface Value {};
 
     private static class Simple implements Value
     {
-        public final IColumn column;
+        public final Column column;
 
-        Simple(IColumn column)
+        Simple(Column column)
         {
             this.column = column;
         }
     }
 
-    private static class Collection extends ArrayList<Pair<ByteBuffer, IColumn>> implements Value {}
+    private static class Collection extends ArrayList<Pair<ByteBuffer, Column>> implements Value {}
 
     public static class Builder
     {
@@ -115,7 +115,7 @@ public class ColumnGroupMap
             this.idx = composite.types.size() - (hasCollections ? 2 : 1);
         }
 
-        public void add(IColumn c)
+        public void add(Column c)
         {
             if (c.isMarkedForDelete())
                 return;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 4af27ba..ad4f11a 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -26,7 +26,6 @@ import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.filter.ColumnSlice;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.db.marshal.CompositeType;
 import org.apache.cassandra.exceptions.*;
@@ -165,7 +164,7 @@ public abstract class ModificationStatement extends CFStatement implements CQLSt
         for (ByteBuffer key : keys)
             commands.add(new SliceFromReadCommand(keyspace(),
                                                   key,
-                                                  new QueryPath(columnFamily()),
+                                                  columnFamily(),
                                                   new SliceQueryFilter(slices, false, Integer.MAX_VALUE)));
 
         try
@@ -181,7 +180,7 @@ public abstract class ModificationStatement extends CFStatement implements CQLSt
                     continue;
 
                 ColumnGroupMap.Builder groupBuilder = new ColumnGroupMap.Builder(composite, true);
-                for (IColumn column : row.cf)
+                for (Column column : row.cf)
                     groupBuilder.add(column);
 
                 List<ColumnGroupMap> groups = groupBuilder.groups();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index b41659c..73b54ad 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -198,7 +198,6 @@ public class SelectStatement implements CQLStatement
 
     private List<ReadCommand> getSliceCommands(List<ByteBuffer> variables) throws RequestValidationException
     {
-        QueryPath queryPath = new QueryPath(columnFamily());
         Collection<ByteBuffer> keys = getKeys(variables);
         List<ReadCommand> commands = new ArrayList<ReadCommand>(keys.size());
 
@@ -214,7 +213,7 @@ public class SelectStatement implements CQLStatement
                 // Note that we should not share the slice filter amongst the command, due to SliceQueryFilter not
                 // being immutable due to its columnCounter used by the lastCounted() method
                 // (this is fairly ugly and we should change that but that's probably not a tiny refactor to do that cleanly)
-                commands.add(new SliceFromReadCommand(keyspace(), key, queryPath, (SliceQueryFilter)makeFilter(variables)));
+                commands.add(new SliceFromReadCommand(keyspace(), key, columnFamily(), (SliceQueryFilter)makeFilter(variables)));
             }
         }
         // ...of a list of column names
@@ -225,7 +224,7 @@ public class SelectStatement implements CQLStatement
             for (ByteBuffer key: keys)
             {
                 QueryProcessor.validateKey(key);
-                commands.add(new SliceByNamesReadCommand(keyspace(), key, queryPath, (NamesQueryFilter)filter));
+                commands.add(new SliceByNamesReadCommand(keyspace(), key, columnFamily(), (NamesQueryFilter)filter));
             }
         }
         return commands;
@@ -239,7 +238,6 @@ public class SelectStatement implements CQLStatement
         // We want to have getRangeSlice to count the number of columns, not the number of keys.
         return new RangeSliceCommand(keyspace(),
                                      columnFamily(),
-                                     null,
                                      filter,
                                      getKeyBounds(variables),
                                      expressions,
@@ -476,9 +474,9 @@ public class SelectStatement implements CQLStatement
 
             // We need to query the selected column as well as the marker
             // column (for the case where the row exists but has no columns outside the PK)
-            // One exception is "static CF" (non-composite non-compact CF) that
-            // don't have marker and for which we must query all columns instead
-            if (cfDef.isComposite)
+            // Two exceptions are "static CF" (non-composite non-compact CF) and "super CF"
+            // that don't have marker and for which we must query all columns instead
+            if (cfDef.isComposite && !cfDef.cfm.isSuper())
             {
                 // marker
                 columns.add(builder.copy().add(ByteBufferUtil.EMPTY_BYTE_BUFFER).build());
@@ -606,14 +604,14 @@ public class SelectStatement implements CQLStatement
         }
     }
 
-    private ByteBuffer value(IColumn c)
+    private ByteBuffer value(Column c)
     {
         return (c instanceof CounterColumn)
              ? ByteBufferUtil.bytes(CounterContext.instance().total(c.value()))
              : c.value();
     }
 
-    private void addReturnValue(ResultSet cqlRows, Selector s, IColumn c)
+    private void addReturnValue(ResultSet cqlRows, Selector s, Column c)
     {
         if (c == null || c.isMarkedForDelete())
         {
@@ -672,7 +670,7 @@ public class SelectStatement implements CQLStatement
         return new ResultSet(names);
     }
 
-    private Iterable<IColumn> columnsInOrder(final ColumnFamily cf, final List<ByteBuffer> variables) throws InvalidRequestException
+    private Iterable<Column> columnsInOrder(final ColumnFamily cf, final List<ByteBuffer> variables) throws InvalidRequestException
     {
         // If the restriction for the last column alias is an IN, respect
         // requested order
@@ -693,18 +691,18 @@ public class SelectStatement implements CQLStatement
             requested.add(b.add(t, Relation.Type.EQ, variables).build());
         }
 
-        return new Iterable<IColumn>()
+        return new Iterable<Column>()
         {
-            public Iterator<IColumn> iterator()
+            public Iterator<Column> iterator()
             {
-                return new AbstractIterator<IColumn>()
+                return new AbstractIterator<Column>()
                 {
                     Iterator<ByteBuffer> iter = requested.iterator();
-                    public IColumn computeNext()
+                    public Column computeNext()
                     {
                         if (!iter.hasNext())
                             return endOfData();
-                        IColumn column = cf.getColumn(iter.next());
+                        Column column = cf.getColumn(iter.next());
                         return column == null ? computeNext() : column;
                     }
                 };
@@ -736,7 +734,7 @@ public class SelectStatement implements CQLStatement
             if (cfDef.isCompact)
             {
                 // One cqlRow per column
-                for (IColumn c : columnsInOrder(row.cf, variables))
+                for (Column c : columnsInOrder(row.cf, variables))
                 {
                     if (c.isMarkedForDelete())
                         continue;
@@ -797,7 +795,7 @@ public class SelectStatement implements CQLStatement
 
                 ColumnGroupMap.Builder builder = new ColumnGroupMap.Builder(composite, cfDef.hasCollections);
 
-                for (IColumn c : row.cf)
+                for (Column c : row.cf)
                 {
                     if (c.isMarkedForDelete())
                         continue;
@@ -825,7 +823,7 @@ public class SelectStatement implements CQLStatement
                         continue;
                     }
 
-                    IColumn c = row.cf.getColumn(name.name.key);
+                    Column c = row.cf.getColumn(name.name.key);
                     addReturnValue(cqlRows, selector, c);
                 }
             }
@@ -936,14 +934,14 @@ public class SelectStatement implements CQLStatement
                 case COLUMN_METADATA:
                     if (name.type.isCollection())
                     {
-                        List<Pair<ByteBuffer, IColumn>> collection = columns.getCollection(name.name.key);
+                        List<Pair<ByteBuffer, Column>> collection = columns.getCollection(name.name.key);
                         if (collection == null)
                             cqlRows.addColumnValue(null);
                         else
                             cqlRows.addColumnValue(((CollectionType)name.type).serialize(collection));
                         break;
                     }
-                    IColumn c = columns.getSimple(name.name.key);
+                    Column c = columns.getSimple(name.name.key);
                     addReturnValue(cqlRows, selector, c);
                     break;
                 default:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 014555d..b159b7d 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -220,7 +220,9 @@ public class UpdateStatement extends ModificationStatement
         // The last query should return one row (but with c == null). Adding
         // the marker with the insert make sure the semantic is correct (while making sure a
         // 'DELETE FROM t WHERE k = 1' does remove the row entirely)
-        if (cfDef.isComposite && !cfDef.isCompact)
+        //
+        // We never insert markers for Super CF as this would confuse the thrift side.
+        if (cfDef.isComposite && !cfDef.isCompact && !cfDef.cfm.isSuper())
         {
             ByteBuffer name = builder.copy().add(ByteBufferUtil.EMPTY_BYTE_BUFFER).build();
             cf.addColumn(params.makeColumn(name, ByteBufferUtil.EMPTY_BYTE_BUFFER));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/AbstractColumnContainer.java b/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
index 09d0a38..1a38e4b 100644
--- a/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
+++ b/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
@@ -32,7 +32,7 @@ import org.apache.cassandra.io.util.IIterableColumns;
 import org.apache.cassandra.utils.Allocator;
 import org.apache.cassandra.utils.HeapAllocator;
 
-public abstract class AbstractColumnContainer implements IColumnContainer, IIterableColumns
+public abstract class AbstractColumnContainer implements IIterableColumns
 {
     protected final ISortedColumns columns;
 
@@ -84,37 +84,37 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
         columns.maybeResetDeletionTimes(gcBefore);
     }
 
-    public long addAllWithSizeDelta(AbstractColumnContainer cc, Allocator allocator, Function<IColumn, IColumn> transformation, SecondaryIndexManager.Updater indexer)
+    public long addAllWithSizeDelta(AbstractColumnContainer cc, Allocator allocator, Function<Column, Column> transformation, SecondaryIndexManager.Updater indexer)
     {
         return columns.addAllWithSizeDelta(cc.columns, allocator, transformation, indexer);
     }
 
-    public void addAll(AbstractColumnContainer cc, Allocator allocator, Function<IColumn, IColumn> transformation)
+    public void addAll(AbstractColumnContainer cc, Allocator allocator, Function<Column, Column> transformation)
     {
         columns.addAll(cc.columns, allocator, transformation);
     }
 
     public void addAll(AbstractColumnContainer cc, Allocator allocator)
     {
-        addAll(cc, allocator, Functions.<IColumn>identity());
+        addAll(cc, allocator, Functions.<Column>identity());
     }
 
-    public void addColumn(IColumn column)
+    public void addColumn(Column column)
     {
         addColumn(column, HeapAllocator.instance);
     }
 
-    public void addColumn(IColumn column, Allocator allocator)
+    public void addColumn(Column column, Allocator allocator)
     {
         columns.addColumn(column, allocator);
     }
 
-    public IColumn getColumn(ByteBuffer name)
+    public Column getColumn(ByteBuffer name)
     {
         return columns.getColumn(name);
     }
 
-    public boolean replace(IColumn oldColumn, IColumn newColumn)
+    public boolean replace(Column oldColumn, Column newColumn)
     {
         return columns.replace(oldColumn, newColumn);
     }
@@ -129,12 +129,12 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
         return columns.getColumnNames();
     }
 
-    public Collection<IColumn> getSortedColumns()
+    public Collection<Column> getSortedColumns()
     {
         return columns.getSortedColumns();
     }
 
-    public Collection<IColumn> getReverseSortedColumns()
+    public Collection<Column> getReverseSortedColumns()
     {
         return columns.getReverseSortedColumns();
     }
@@ -166,7 +166,7 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
 
     public boolean hasOnlyTombstones()
     {
-        for (IColumn column : columns)
+        for (Column column : columns)
         {
             if (column.isLive())
                 return false;
@@ -174,17 +174,17 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
         return true;
     }
 
-    public Iterator<IColumn> iterator()
+    public Iterator<Column> iterator()
     {
         return columns.iterator();
     }
 
-    public Iterator<IColumn> iterator(ColumnSlice[] slices)
+    public Iterator<Column> iterator(ColumnSlice[] slices)
     {
         return columns.iterator(slices);
     }
 
-    public Iterator<IColumn> reverseIterator(ColumnSlice[] slices)
+    public Iterator<Column> reverseIterator(ColumnSlice[] slices)
     {
         return columns.reverseIterator(slices);
     }
@@ -196,7 +196,7 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
             return true;
 
         // Do we have colums that are either deleted by the container or gcable tombstone?
-        for (IColumn column : columns)
+        for (Column column : columns)
             if (deletionInfo().isDeleted(column) || column.hasIrrelevantData(gcBefore))
                 return true;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a005df3/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java b/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java
index a4e5eb7..aa153e1 100644
--- a/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java
+++ b/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java
@@ -52,21 +52,16 @@ public abstract class AbstractThreadUnsafeSortedColumns implements ISortedColumn
 
     public void retainAll(ISortedColumns columns)
     {
-        Iterator<IColumn> iter = iterator();
-        Iterator<IColumn> toRetain = columns.iterator();
-        IColumn current = iter.hasNext() ? iter.next() : null;
-        IColumn retain = toRetain.hasNext() ? toRetain.next() : null;
+        Iterator<Column> iter = iterator();
+        Iterator<Column> toRetain = columns.iterator();
+        Column current = iter.hasNext() ? iter.next() : null;
+        Column retain = toRetain.hasNext() ? toRetain.next() : null;
         AbstractType<?> comparator = getComparator();
         while (current != null && retain != null)
         {
             int c = comparator.compare(current.name(), retain.name());
             if (c == 0)
             {
-                if (current instanceof SuperColumn)
-                {
-                    assert retain instanceof SuperColumn;
-                    ((SuperColumn)current).retainAll((SuperColumn)retain);
-                }
                 current = iter.hasNext() ? iter.next() : null;
                 retain = toRetain.hasNext() ? toRetain.next() : null;
             }


Mime
View raw message