cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/4] git commit: Removed compatibility with pre-1.2.5 sstables and network messages patch by jbellis; reviewed by marcuse for CASSANDRA-5511
Date Fri, 26 Apr 2013 19:07:05 GMT
Removed compatibility with pre-1.2.5 sstables and network messages
patch by jbellis; reviewed by marcuse for CASSANDRA-5511


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

Branch: refs/heads/trunk
Commit: 7f2c3a8e40f97c626def5c510d77c1da3d9ae926
Parents: a45918b
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Apr 26 13:17:32 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Apr 26 13:17:39 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 +
 NEWS.txt                                           |    4 +
 src/java/org/apache/cassandra/config/Avro.java     |    3 -
 .../org/apache/cassandra/config/CFMetaData.java    |   27 +--
 .../cassandra/config/DatabaseDescriptor.java       |   33 +---
 .../org/apache/cassandra/config/KSMetaData.java    |    6 +-
 src/java/org/apache/cassandra/config/Schema.java   |   25 --
 .../cassandra/cql3/statements/SelectStatement.java |    3 +-
 .../cassandra/db/ColumnFamilySerializer.java       |   30 +---
 .../cassandra/db/DefinitionsUpdateVerbHandler.java |    5 -
 src/java/org/apache/cassandra/db/DefsTable.java    |   74 ------
 src/java/org/apache/cassandra/db/DeletionInfo.java |   20 +--
 src/java/org/apache/cassandra/db/Directories.java  |  190 ---------------
 .../org/apache/cassandra/db/IndexScanCommand.java  |   95 -------
 .../cassandra/db/MigrationRequestVerbHandler.java  |    7 +-
 .../org/apache/cassandra/db/RangeSliceCommand.java |  182 +++-----------
 .../org/apache/cassandra/db/RowIndexEntry.java     |   16 +-
 src/java/org/apache/cassandra/db/RowMutation.java  |   11 -
 .../cassandra/db/RowMutationVerbHandler.java       |    2 +-
 src/java/org/apache/cassandra/db/SuperColumns.java |    9 +-
 src/java/org/apache/cassandra/db/SystemTable.java  |   59 -----
 .../org/apache/cassandra/db/WriteResponse.java     |   15 --
 .../db/columniterator/IndexedSliceReader.java      |   37 +--
 .../db/columniterator/SSTableNamesIterator.java    |   30 +--
 .../db/columniterator/SimpleSliceReader.java       |    7 +-
 .../db/commitlog/CommitLogDescriptor.java          |   18 +-
 .../apache/cassandra/db/compaction/Scrubber.java   |    8 +-
 .../cassandra/db/filter/NamesQueryFilter.java      |   12 +-
 .../cassandra/db/filter/SliceQueryFilter.java      |   70 ++----
 .../org/apache/cassandra/dht/AbstractBounds.java   |    5 -
 .../dht/AbstractByteOrderedPartitioner.java        |    5 -
 .../org/apache/cassandra/dht/IPartitioner.java     |    9 -
 .../org/apache/cassandra/dht/LocalPartitioner.java |    5 -
 .../apache/cassandra/dht/Murmur3Partitioner.java   |    5 -
 .../cassandra/dht/OrderPreservingPartitioner.java  |    5 -
 .../apache/cassandra/dht/RandomPartitioner.java    |   30 ---
 .../org/apache/cassandra/gms/GossipDigestAck.java  |    6 -
 .../org/apache/cassandra/gms/GossipDigestSyn.java  |    9 +-
 src/java/org/apache/cassandra/gms/Gossiper.java    |    4 +-
 .../org/apache/cassandra/gms/VersionedValue.java   |   30 +---
 .../apache/cassandra/io/sstable/Descriptor.java    |   87 +------
 .../apache/cassandra/io/sstable/KeyIterator.java   |    4 +-
 .../org/apache/cassandra/io/sstable/SSTable.java   |    2 +-
 .../io/sstable/SSTableIdentityIterator.java        |   30 ---
 .../cassandra/io/sstable/SSTableMetadata.java      |   54 ++---
 .../apache/cassandra/io/sstable/SSTableReader.java |   45 +---
 .../cassandra/io/sstable/SSTableScanner.java       |   12 +-
 .../apache/cassandra/io/sstable/SSTableWriter.java |    2 +-
 .../cassandra/net/IncomingTcpConnection.java       |   43 +---
 .../org/apache/cassandra/net/MessagingService.java |    4 -
 .../cassandra/net/OutboundTcpConnection.java       |   70 +++---
 .../cassandra/service/ActiveRepairService.java     |   10 +-
 .../org/apache/cassandra/service/CacheService.java |   10 +-
 .../apache/cassandra/service/CassandraDaemon.java  |    4 -
 .../cassandra/service/IndexScanVerbHandler.java    |   56 -----
 .../apache/cassandra/service/MigrationManager.java |   39 +---
 .../org/apache/cassandra/service/StorageProxy.java |    5 -
 .../apache/cassandra/service/StorageService.java   |   72 ++----
 .../cassandra/service/StorageServiceMBean.java     |    1 +
 .../cassandra/streaming/IncomingStreamReader.java  |    4 +-
 .../apache/cassandra/streaming/PendingFile.java    |    9 +-
 .../apache/cassandra/tools/StandaloneScrubber.java |    4 -
 .../org/apache/cassandra/utils/FilterFactory.java  |   76 +-----
 .../apache/cassandra/utils/LegacyBloomFilter.java  |  170 -------------
 .../utils/LegacyBloomFilterSerializer.java         |   60 -----
 .../apache/cassandra/utils/Murmur2BloomFilter.java |   47 ----
 .../Keyspace1-Standard3-ia-1-Data.db               |  Bin 354 -> 0 bytes
 .../Keyspace1-Standard3-ia-1-Filter.db             |  Bin 256 -> 0 bytes
 .../Keyspace1-Standard3-ia-1-Index.db              |  Bin 90 -> 0 bytes
 .../Keyspace1-Standard3-ia-1-Statistics.db         |  Bin 4353 -> 0 bytes
 .../Keyspace1-Standard3-ja-1-CRC.db                |  Bin 0 -> 8 bytes
 .../Keyspace1-Standard3-ja-1-Data.db               |  Bin 0 -> 354 bytes
 .../Keyspace1-Standard3-ja-1-Digest.sha1           |    1 +
 .../Keyspace1-Standard3-ja-1-Filter.db             |  Bin 0 -> 176 bytes
 .../Keyspace1-Standard3-ja-1-Index.db              |  Bin 0 -> 90 bytes
 .../Keyspace1-Standard3-ja-1-Statistics.db         |  Bin 0 -> 4377 bytes
 .../Keyspace1-Standard3-ja-1-Summary.db            |  Bin 0 -> 83 bytes
 .../Keyspace1-Standard3-ja-1-TOC.txt               |    8 +
 .../b/Keyspace1/Keyspace1-Standard1-b-0-Data.db    |  Bin 168300 -> 0 bytes
 .../b/Keyspace1/Keyspace1-Standard1-b-0-Filter.db  |  Bin 1773 -> 0 bytes
 .../b/Keyspace1/Keyspace1-Standard1-b-0-Index.db   |  Bin 11700 -> 0 bytes
 .../e/Keyspace1/Keyspace1-Standard1-e-0-Data.db    |  Bin 128700 -> 0 bytes
 .../e/Keyspace1/Keyspace1-Standard1-e-0-Filter.db  |  Bin 1773 -> 0 bytes
 .../e/Keyspace1/Keyspace1-Standard1-e-0-Index.db   |  Bin 11700 -> 0 bytes
 .../Keyspace1-Standard1-e-0-Statistics.db          |  Bin 4840 -> 0 bytes
 .../hb/Keyspace1/Keyspace1-Indexed1-hb-1-Data.db   |  Bin 84 -> 0 bytes
 .../Keyspace1/Keyspace1-Indexed1-hb-1-Digest.sha1  |    1 -
 .../hb/Keyspace1/Keyspace1-Indexed1-hb-1-Filter.db |  Bin 16 -> 0 bytes
 .../hb/Keyspace1/Keyspace1-Indexed1-hb-1-Index.db  |  Bin 12 -> 0 bytes
 .../Keyspace1-Indexed1-hb-1-Statistics.db          |  Bin 4292 -> 0 bytes
 ...space1-Indexed1.626972746864617465-hb-1-Data.db |  Bin 75 -> 0 bytes
 ...e1-Indexed1.626972746864617465-hb-1-Digest.sha1 |    1 -
 ...ace1-Indexed1.626972746864617465-hb-1-Filter.db |  Bin 16 -> 0 bytes
 ...pace1-Indexed1.626972746864617465-hb-1-Index.db |  Bin 18 -> 0 bytes
 ...-Indexed1.626972746864617465-hb-1-Statistics.db |  Bin 4292 -> 0 bytes
 .../hb/Keyspace1/Keyspace1-Standard1-hb-0-Data.db  |  Bin 66600 -> 0 bytes
 .../Keyspace1/Keyspace1-Standard1-hb-0-Digest.sha1 |    1 -
 .../Keyspace1/Keyspace1-Standard1-hb-0-Filter.db   |  Bin 1704 -> 0 bytes
 .../hb/Keyspace1/Keyspace1-Standard1-hb-0-Index.db |  Bin 11700 -> 0 bytes
 .../Keyspace1-Standard1-hb-0-Statistics.db         |  Bin 4292 -> 0 bytes
 .../ic/Keyspace1/Keyspace1-Standard1-ic-0-Data.db  |  Bin 0 -> 45000 bytes
 .../Keyspace1/Keyspace1-Standard1-ic-0-Digest.sha1 |    1 +
 .../Keyspace1/Keyspace1-Standard1-ic-0-Filter.db   |  Bin 0 -> 1136 bytes
 .../ic/Keyspace1/Keyspace1-Standard1-ic-0-Index.db |  Bin 0 -> 15300 bytes
 .../Keyspace1-Standard1-ic-0-Statistics.db         |  Bin 0 -> 4361 bytes
 .../Keyspace1/Keyspace1-Standard1-ic-0-Summary.db  |  Bin 0 -> 194 bytes
 .../ic/Keyspace1/Keyspace1-Standard1-ic-0-TOC.txt  |    7 +
 test/data/serialization/2.0/db.RowMutation.bin     |  Bin 3599 -> 3599 bytes
 .../cassandra/utils/LongBloomFilterTest.java       |   68 ++----
 .../cassandra/utils/LongLegacyBloomFilterTest.java |   65 -----
 test/unit/org/apache/cassandra/SchemaLoader.java   |  122 ++++------
 .../unit/org/apache/cassandra/config/DefsTest.java |    8 -
 .../org/apache/cassandra/db/CommitLogTest.java     |    2 -
 .../org/apache/cassandra/db/DirectoriesTest.java   |   27 --
 .../org/apache/cassandra/db/KeyCollisionTest.java  |    5 -
 test/unit/org/apache/cassandra/db/ScrubTest.java   |   45 +++--
 .../cassandra/io/LazilyCompactedRowTest.java       |    9 +-
 .../cassandra/io/sstable/DescriptorTest.java       |   67 -----
 .../cassandra/io/sstable/LegacySSTableTest.java    |    5 +-
 .../cassandra/io/sstable/SSTableReaderTest.java    |   32 +---
 .../apache/cassandra/io/sstable/SSTableTest.java   |    4 +-
 .../service/StorageServiceServerTest.java          |    3 +-
 .../org/apache/cassandra/utils/BitSetTest.java     |   28 +--
 .../apache/cassandra/utils/BloomFilterTest.java    |    4 +-
 .../cassandra/utils/LegacyBloomFilterTest.java     |  132 ----------
 .../apache/cassandra/utils/SerializationsTest.java |   52 +----
 126 files changed, 371 insertions(+), 2360 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 16fab51..10e2e6e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0
+ * Removed compatibility with pre-1.2.5 sstables and network messages
+   (CASSANDRA-5511)
  * removed PBSPredictor (CASSANDRA-5455)
  * CAS support (CASSANDRA-5062, )
  * Leveled compaction performs size-tiered compactions in L0 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index ea4ae1e..31f30ab 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -13,6 +13,10 @@ by version X, but the inverse is not necessarily the case.)
 
 Upgrading
 ---------
+    - Upgrading is ONLY supported from Cassandra 1.2.5 or later.  This
+      goes for sstable compatibility as well as network.  When
+      upgrading from an earlier release, upgrade to 1.2.5 first and
+      run upgradesstables before proceeding to 2.0.
     - Replication and strategy options do not accept unknown options anymore.
       This was already the case for CQL3 in 1.2 but this is now the case for
       thrift too.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/config/Avro.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Avro.java b/src/java/org/apache/cassandra/config/Avro.java
index bbdca81..c712e07 100644
--- a/src/java/org/apache/cassandra/config/Avro.java
+++ b/src/java/org/apache/cassandra/config/Avro.java
@@ -206,9 +206,6 @@ public class Avro
             throw new RuntimeException(e);
         }
 
-        // adding old -> new style ID mapping to support backward compatibility
-        Schema.instance.addOldCfIdMapping(cf.id, newCFMD.cfId);
-
         return newCFMD.comment(cf.comment.toString())
                       .readRepairChance(cf.read_repair_chance)
                       .dcLocalReadRepairChance(cf.dclocal_read_repair_chance)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/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 049668a..a686bf6 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -88,15 +88,6 @@ public final class CFMetaData
     // Note that this is the default only for user created tables
     public final static String DEFAULT_COMPRESSOR = LZ4Compressor.class.getCanonicalName();
 
-    @Deprecated
-    public static final CFMetaData OldStatusCf = newSystemMetadata(Table.SYSTEM_KS, SystemTable.OLD_STATUS_CF, 0, "unused", BytesType.instance, null);
-    @Deprecated
-    public static final CFMetaData OldHintsCf = newSystemMetadata(Table.SYSTEM_KS, SystemTable.OLD_HINTS_CF, 1, "unused", BytesType.instance, BytesType.instance);
-    @Deprecated
-    public static final CFMetaData OldMigrationsCf = newSystemMetadata(Table.SYSTEM_KS, DefsTable.OLD_MIGRATIONS_CF, 2, "unused", TimeUUIDType.instance, null);
-    @Deprecated
-    public static final CFMetaData OldSchemaCf = newSystemMetadata(Table.SYSTEM_KS, DefsTable.OLD_SCHEMA_CF, 3, "unused", UTF8Type.instance, null);
-
     public static final CFMetaData IndexCf = compile(5, "CREATE TABLE \"" + SystemTable.INDEX_CF + "\" ("
                                                         + "table_name text,"
                                                         + "index_name text,"
@@ -120,7 +111,6 @@ public final class CFMetaData
     public static final CFMetaData SchemaColumnFamiliesCf = compile(9, "CREATE TABLE " + SystemTable.SCHEMA_COLUMNFAMILIES_CF + "("
                                                                        + "keyspace_name text,"
                                                                        + "columnfamily_name text,"
-                                                                       + "id int,"
                                                                        + "type text,"
                                                                        + "comparator text,"
                                                                        + "subcomparator text,"
@@ -418,7 +408,7 @@ public final class CFMetaData
 
     public CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp, AbstractType<?> subcc)
     {
-        this(keyspace, name, type,  makeComparator(type, comp, subcc));
+        this(keyspace, name, type, makeComparator(type, comp, subcc));
     }
 
     public CFMetaData(String keyspace, String name, ColumnFamilyType type, AbstractType<?> comp)
@@ -449,7 +439,7 @@ public final class CFMetaData
         try
         {
             CreateColumnFamilyStatement statement = (CreateColumnFamilyStatement) QueryProcessor.parseStatement(cql).prepare().statement;
-            CFMetaData cfmd = newSystemMetadata(keyspace, statement.columnFamily(), id, "", statement.comparator, null);
+            CFMetaData cfmd = newSystemMetadata(keyspace, statement.columnFamily(), "", statement.comparator, null);
             statement.applyPropertiesTo(cfmd);
             return cfmd;
         }
@@ -486,14 +476,11 @@ public final class CFMetaData
         return UUID.nameUUIDFromBytes(ArrayUtils.addAll(ksName.getBytes(), cfName.getBytes()));
     }
 
-    private static CFMetaData newSystemMetadata(String keyspace, String cfName, Integer oldCfId, String comment, AbstractType<?> comparator, AbstractType<?> subcc)
+    private static CFMetaData newSystemMetadata(String keyspace, String cfName, String comment, AbstractType<?> comparator, AbstractType<?> subcc)
     {
         ColumnFamilyType type = subcc == null ? ColumnFamilyType.Standard : ColumnFamilyType.Super;
         CFMetaData newCFMD = new CFMetaData(keyspace, cfName, type, comparator,  subcc);
 
-        // adding old -> new style ID mapping to support backward compatibility
-        Schema.instance.addOldCfIdMapping(oldCfId, newCFMD.cfId);
-
         return newCFMD.comment(comment)
                 .readRepairChance(0)
                 .dcLocalReadRepairChance(0)
@@ -1490,11 +1477,6 @@ public final class CFMetaData
         ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
 
-        Integer oldId = Schema.instance.convertNewCfId(cfId);
-
-        if (oldId != null) // keep old ids (see CASSANDRA-3794 for details)
-            cf.addColumn(Column.create(oldId, timestamp, cfName, "id"));
-
         cf.addColumn(Column.create(cfType.toString(), timestamp, cfName, "type"));
 
         if (isSuper())
@@ -1554,9 +1536,6 @@ public final class CFMetaData
                                             TypeParser.parse(result.getString("comparator")),
                                             result.has("subcomparator") ? TypeParser.parse(result.getString("subcomparator")) : null);
 
-            if (result.has("id"))// try to identify if ColumnFamily Id is old style (before C* 1.2) and add old -> new mapping if so
-                Schema.instance.addOldCfIdMapping(result.getInt("id"), cfm.cfId);
-
             cfm.readRepairChance(result.getDouble("read_repair_chance"));
             cfm.dcLocalReadRepairChance(result.getDouble("local_read_repair_chance"));
             cfm.replicateOnWrite(result.getBoolean("replicate_on_write"));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 7048975..aad4dd3 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -492,35 +492,12 @@ public class DatabaseDescriptor
         // if table with definitions is empty try loading the old way
         if (schemaCFS.estimateKeys() == 0)
         {
-            // we can load tables from local storage if a version is set in the system table and that actually maps to
-            // real data in the definitions table.  If we do end up loading from xml, store the definitions so that we
-            // don't load from xml anymore.
-            UUID uuid = MigrationManager.getLastMigrationId();
-
-            if (uuid == null)
-            {
-                logger.info("Couldn't detect any schema definitions in local storage.");
-                // peek around the data directories to see if anything is there.
-                if (hasExistingNoSystemTables())
-                    logger.info("Found table data in data directories. Consider using the CLI to define your schema.");
-                else
-                    logger.info("To create keyspaces and column families, see 'help create keyspace' in the CLI, or set up a schema using the thrift system_* calls.");
-            }
+            logger.info("Couldn't detect any schema definitions in local storage.");
+            // peek around the data directories to see if anything is there.
+            if (hasExistingNoSystemTables())
+                logger.info("Found table data in data directories. Consider using cqlsh to define your schema.");
             else
-            {
-                logger.info("Loading schema version " + uuid.toString());
-                Collection<KSMetaData> tableDefs = DefsTable.loadFromStorage(uuid);
-
-                // happens when someone manually deletes all tables and restarts.
-                if (tableDefs.size() == 0)
-                {
-                    logger.warn("No schema definitions were found in local storage.");
-                }
-                else // if non-system tables where found, trying to load them
-                {
-                    Schema.instance.load(tableDefs);
-                }
-            }
+                logger.info("To create keyspaces and column families, see 'help create table' in cqlsh.");
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/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 b954b32..db08da8 100644
--- a/src/java/org/apache/cassandra/config/KSMetaData.java
+++ b/src/java/org/apache/cassandra/config/KSMetaData.java
@@ -89,11 +89,7 @@ public final class KSMetaData
                                                 CFMetaData.SchemaColumnFamiliesCf,
                                                 CFMetaData.SchemaColumnsCf,
                                                 CFMetaData.CompactionLogCf,
-                                                CFMetaData.PaxosCf,
-                                                CFMetaData.OldStatusCf,
-                                                CFMetaData.OldHintsCf,
-                                                CFMetaData.OldMigrationsCf,
-                                                CFMetaData.OldSchemaCf);
+                                                CFMetaData.PaxosCf);
         return new KSMetaData(Table.SYSTEM_KS, LocalStrategy.class, Collections.<String, String>emptyMap(), true, cfDefs);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/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 9d670c0..ae31269 100644
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@ -59,8 +59,6 @@ public class Schema
 
     /* metadata map for faster ColumnFamily lookup */
     private final BiMap<Pair<String, String>, UUID> cfIdMap = HashBiMap.create();
-    // mapping from old ColumnFamily Id (Integer) to a new version which is UUID
-    private final BiMap<Integer, UUID> oldCfIdMap = HashBiMap.create();
 
     private volatile UUID version;
 
@@ -313,29 +311,6 @@ public class Schema
 
     /* ColumnFamily query/control methods */
 
-    public void addOldCfIdMapping(Integer oldId, UUID newId)
-    {
-        if (oldId == null)
-            return;
-
-        oldCfIdMap.put(oldId, newId);
-    }
-
-    public UUID convertOldCfId(Integer oldCfId) throws UnknownColumnFamilyException
-    {
-        UUID cfId = oldCfIdMap.get(oldCfId);
-
-        if (cfId == null)
-            throw new UnknownColumnFamilyException("ColumnFamily identified by old " + oldCfId + " was not found.", null);
-
-        return cfId;
-    }
-
-    public Integer convertNewCfId(UUID newCfId)
-    {
-        return oldCfIdMap.containsValue(newCfId) ? oldCfIdMap.inverse().get(newCfId) : null;
-    }
-
     /**
      * @param cfId The identifier of the ColumnFamily to lookup
      * @return The (ksname,cfname) pair for the given id, or null if it has been dropped.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/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 5585df4..38fa361 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -280,8 +280,7 @@ public class SelectStatement implements CQLStatement
             SliceQueryFilter filter = new SliceQueryFilter(new ColumnSlice[]{slice},
                                                            isReversed,
                                                            getLimit(),
-                                                           toGroup,
-                                                           multiplier);
+                                                           toGroup);
             QueryProcessor.validateSliceFilter(cfDef.cfm, filter);
             return filter;
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java b/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
index ff96795..3016499 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
@@ -187,27 +187,12 @@ public class ColumnFamilySerializer implements IVersionedSerializer<ColumnFamily
 
     public void serializeCfId(UUID cfId, DataOutput out, int version) throws IOException
     {
-        if (version < MessagingService.VERSION_12) // try to use CF's old id where possible (CASSANDRA-3794)
-        {
-            Integer oldId = Schema.instance.convertNewCfId(cfId);
-
-            if (oldId == null)
-                throw new IOException("Can't serialize ColumnFamily ID " + cfId + " to be used by version " + version +
-                                      ", because int <-> uuid mapping could not be established (CF was created in mixed version cluster).");
-
-            out.writeInt(oldId);
-        }
-        else
-            UUIDSerializer.serializer.serialize(cfId, out, version);
+        UUIDSerializer.serializer.serialize(cfId, out, version);
     }
 
     public UUID deserializeCfId(DataInput in, int version) throws IOException
     {
-        // create a ColumnFamily based on the cf id
-        UUID cfId = (version < MessagingService.VERSION_12)
-                     ? Schema.instance.convertOldCfId(in.readInt())
-                     : UUIDSerializer.serializer.deserialize(in, version);
-
+        UUID cfId = UUIDSerializer.serializer.deserialize(in, version);
         if (Schema.instance.getCF(cfId) == null)
             throw new UnknownColumnFamilyException("Couldn't find cfId=" + cfId, cfId);
 
@@ -216,17 +201,6 @@ public class ColumnFamilySerializer implements IVersionedSerializer<ColumnFamily
 
     public int cfIdSerializedSize(UUID cfId, TypeSizes typeSizes, int version)
     {
-        if (version < MessagingService.VERSION_12) // try to use CF's old id where possible (CASSANDRA-3794)
-        {
-            Integer oldId = Schema.instance.convertNewCfId(cfId);
-
-            if (oldId == null)
-                throw new RuntimeException("Can't serialize ColumnFamily ID " + cfId + " to be used by version " + version +
-                        ", because int <-> uuid mapping could not be established (CF was created in mixed version cluster).");
-
-            return typeSizes.sizeof(oldId);
-        }
-
         return typeSizes.sizeof(cfId);
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/DefinitionsUpdateVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefinitionsUpdateVerbHandler.java b/src/java/org/apache/cassandra/db/DefinitionsUpdateVerbHandler.java
index 5d59549..95187ec 100644
--- a/src/java/org/apache/cassandra/db/DefinitionsUpdateVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/DefinitionsUpdateVerbHandler.java
@@ -47,11 +47,6 @@ public class DefinitionsUpdateVerbHandler implements IVerbHandler<Collection<Row
         {
             public void runMayThrow() throws Exception
             {
-                if (message.version < MessagingService.VERSION_117)
-                {
-                    logger.error("Can't accept schema migrations from Cassandra versions previous to 1.1.7, please upgrade first");
-                    return;
-                }
                 DefsTable.mergeSchema(message.payload);
             }
         });

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/DefsTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefsTable.java b/src/java/org/apache/cassandra/db/DefsTable.java
index 878248c..83d9c22 100644
--- a/src/java/org/apache/cassandra/db/DefsTable.java
+++ b/src/java/org/apache/cassandra/db/DefsTable.java
@@ -156,80 +156,6 @@ public class DefsTable
         return keyspaces;
     }
 
-    public static void fixSchemaNanoTimestamps()
-    {
-        fixSchemaNanoTimestamp(SystemTable.SCHEMA_KEYSPACES_CF);
-        fixSchemaNanoTimestamp(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
-        fixSchemaNanoTimestamp(SystemTable.SCHEMA_COLUMNS_CF);
-    }
-
-    private static void fixSchemaNanoTimestamp(String columnFamily)
-    {
-        ColumnFamilyStore cfs = Table.open(Table.SYSTEM_KS).getColumnFamilyStore(columnFamily);
-
-        boolean needsCleanup = false;
-        Date now = new Date();
-
-        List<Row> rows = SystemTable.serializedSchema(columnFamily);
-
-        row_check_loop:
-        for (Row row : rows)
-        {
-            if (Schema.invalidSchemaRow(row))
-                continue;
-
-            for (Column column : row.cf)
-            {
-                Date columnDate = new Date(column.timestamp());
-
-                if (columnDate.after(now))
-                {
-                    Date micros = new Date(column.timestamp() / 1000); // assume that it was in micros
-
-                    Calendar calendar = Calendar.getInstance();
-                    calendar.setTime(micros);
-
-                    if ((micros.before(now) && calendar.get(Calendar.YEAR) == 1970) || micros.after(now))
-                    {
-                        needsCleanup = true;
-                        break row_check_loop;
-                    }
-                }
-                else // millis and we have to fix it to micros
-                {
-                    needsCleanup = true;
-                    break row_check_loop;
-                }
-            }
-        }
-
-        if (!needsCleanup)
-            return;
-
-        logger.info("Fixing timestamps of schema ColumnFamily " + columnFamily + "...");
-
-        cfs.truncateBlocking();
-
-        long microTimestamp = now.getTime() * 1000;
-        for (Row row : rows)
-        {
-            if (Schema.invalidSchemaRow(row))
-                continue;
-
-            RowMutation mutation = new RowMutation(Table.SYSTEM_KS, row.key.key);
-
-            for (Column column : row.cf)
-            {
-                if (column.isLive())
-                    mutation.add(columnFamily, column.name(), column.value(), microTimestamp);
-            }
-
-            mutation.apply();
-        }
-        // flush immediately because we read schema before replaying the commitlog
-        cfs.forceBlockingFlush();
-    }
-
     public static ByteBuffer searchComposite(String name, boolean start)
     {
         assert name != null;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/DeletionInfo.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DeletionInfo.java b/src/java/org/apache/cassandra/db/DeletionInfo.java
index 70c0e76..cdb2dde 100644
--- a/src/java/org/apache/cassandra/db/DeletionInfo.java
+++ b/src/java/org/apache/cassandra/db/DeletionInfo.java
@@ -310,18 +310,7 @@ public class DeletionInfo
         public void serialize(DeletionInfo info, DataOutput out, int version) throws IOException
         {
             DeletionTime.serializer.serialize(info.topLevel, out);
-            // Pre-1.2 version don't know about range tombstones and thus users should upgrade all
-            // nodes before using them. If they didn't, better fail early that propagating bad info
-            if (version < MessagingService.VERSION_12)
-            {
-                if (!info.ranges.isEmpty())
-                    throw new RuntimeException("Cannot send range tombstone to pre-1.2 node. You should upgrade all node to Cassandra 1.2+ before using range tombstone.");
-                // Otherwise we're done
-            }
-            else
-            {
-                itSerializer.serialize(info.ranges, out, version);
-            }
+            itSerializer.serialize(info.ranges, out, version);
         }
 
         public void serializeForSSTable(DeletionInfo info, DataOutput out) throws IOException
@@ -340,11 +329,7 @@ public class DeletionInfo
 
         public DeletionInfo deserialize(DataInput in, int version, Comparator<ByteBuffer> comparator) throws IOException
         {
-            assert version < MessagingService.VERSION_12 || comparator != null;
             DeletionTime topLevel = DeletionTime.serializer.deserialize(in);
-            if (version < MessagingService.VERSION_12)
-                return new DeletionInfo(topLevel, IntervalTree.<ByteBuffer, DeletionTime, RangeTombstone>emptyTree());
-
             IntervalTree<ByteBuffer, DeletionTime, RangeTombstone> ranges = itSerializer.deserialize(in, version, comparator);
             return new DeletionInfo(topLevel, ranges);
         }
@@ -358,9 +343,6 @@ public class DeletionInfo
         public long serializedSize(DeletionInfo info, TypeSizes typeSizes, int version)
         {
             long size = DeletionTime.serializer.serializedSize(info.topLevel, typeSizes);
-            if (version < MessagingService.VERSION_12)
-                return size;
-
             return size + itSerializer.serializedSize(info.ranges, typeSizes, version);
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Directories.java b/src/java/org/apache/cassandra/db/Directories.java
index 7aebe8d..bfef737 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -484,196 +484,6 @@ public class Directories
         return StringUtils.join(s, File.separator);
     }
 
-    /**
-     * To check if sstables needs migration, we look at the System directory.
-     * If it does not contain a directory for the schema cfs, we'll attempt a sstable
-     * migration.
-     *
-     * Note that it is mostly harmless to try a migration uselessly, except
-     * maybe for some wasted cpu cycles.
-     */
-    public static boolean sstablesNeedsMigration()
-    {
-        if (StorageService.instance.isClientMode())
-            return false;
-
-        boolean hasSystemKeyspace = false;
-        for (DataDirectory dir : dataFileLocations)
-        {
-            File systemDir = new File(dir.location, Table.SYSTEM_KS);
-            hasSystemKeyspace |= (systemDir.exists() && systemDir.isDirectory());
-            File statusCFDir = new File(systemDir, SystemTable.SCHEMA_KEYSPACES_CF);
-            if (statusCFDir.exists())
-                return false;
-        }
-        if (!hasSystemKeyspace)
-            // This is a brand new node.
-            return false;
-
-        // Check whether the migration might create too long a filename
-        int longestLocation = -1;
-        for (DataDirectory loc : dataFileLocations)
-            longestLocation = Math.max(longestLocation, FileUtils.getCanonicalPath(loc.location).length());
-
-        // Check that migration won't error out halfway through from too-long paths.  For Windows, we need to check
-        // total path length <= 255 (see http://msdn.microsoft.com/en-us/library/aa365247.aspx and discussion on CASSANDRA-2749);
-        // elsewhere, we just need to make sure filename is <= 255.
-        for (KSMetaData ksm : Schema.instance.getTableDefinitions())
-        {
-            String ksname = ksm.name;
-            for (Map.Entry<String, CFMetaData> entry : ksm.cfMetaData().entrySet())
-            {
-                String cfname = entry.getKey();
-
-                // max path is roughly (guess-estimate) <location>/ksname/cfname/snapshots/1324314347102-somename/ksname-cfname-tmp-hb-65536-Statistics.db
-                if (System.getProperty("os.name").startsWith("Windows")
-                    && longestLocation + (ksname.length() + cfname.length()) * 2 + 63 > 255)
-                {
-                    throw new RuntimeException(String.format("Starting with 1.1, keyspace names and column family " +
-                                                             "names must be less than %s characters long. %s/%s doesn't" +
-                                                             " respect that restriction. Please rename your " +
-                                                             "keyspace/column families to respect that restriction " +
-                                                             "before updating.", Schema.NAME_LENGTH, ksname, cfname));
-                }
-
-                if (ksm.name.length() + cfname.length() + 28 > 255)
-                {
-                    throw new RuntimeException("Starting with 1.1, the keyspace name is included in data filenames.  For "
-                                               + ksm.name + "/" + cfname + ", this puts you over the largest possible filename of 255 characters");
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Move sstables from the pre-#2749 layout to their new location/names.
-     * This involves:
-     *   - moving each sstable to their CF specific directory
-     *   - rename the sstable to include the keyspace in the filename
-     *
-     * Note that this also move leveled manifests, snapshots and backups.
-     */
-    public static void migrateSSTables()
-    {
-        logger.info("Upgrade from pre-1.1 version detected: migrating sstables to new directory layout");
-
-        for (DataDirectory dir : dataFileLocations)
-        {
-            if (!dir.location.exists() || !dir.location.isDirectory())
-                continue;
-
-            File[] ksDirs = dir.location.listFiles();
-            if (ksDirs != null)
-            {
-                for (File ksDir : ksDirs)
-                {
-                    if (!ksDir.isDirectory())
-                        continue;
-
-                    File[] files = ksDir.listFiles();
-                    if (files != null)
-                    {
-                        for (File file : files)
-                            migrateFile(file, ksDir, null);
-                    }
-
-                    migrateSnapshots(ksDir);
-                    migrateBackups(ksDir);
-                }
-            }
-        }
-    }
-
-    private static void migrateSnapshots(File ksDir)
-    {
-        File snapshotDir = new File(ksDir, SNAPSHOT_SUBDIR);
-        if (!snapshotDir.exists())
-            return;
-
-        File[] snapshots = snapshotDir.listFiles();
-        if (snapshots != null)
-        {
-            for (File snapshot : snapshots)
-            {
-                if (!snapshot.isDirectory())
-                    continue;
-
-                File[] files = snapshot.listFiles();
-                if (files != null)
-                {
-                    for (File f : files)
-                        migrateFile(f, ksDir, join(SNAPSHOT_SUBDIR, snapshot.getName()));
-                }
-                if (!snapshot.delete())
-                    logger.info("Old snapsot directory {} not deleted by migraation as it is not empty", snapshot);
-            }
-        }
-        if (!snapshotDir.delete())
-            logger.info("Old directory {} not deleted by migration as it is not empty", snapshotDir);
-    }
-
-    private static void migrateBackups(File ksDir)
-    {
-        File backupDir = new File(ksDir, BACKUPS_SUBDIR);
-        if (!backupDir.exists())
-            return;
-
-        File[] files = backupDir.listFiles();
-        if (files != null)
-        {
-            for (File f : files)
-                migrateFile(f, ksDir, BACKUPS_SUBDIR);
-        }
-        if (!backupDir.delete())
-            logger.info("Old directory {} not deleted by migration as it is not empty", backupDir);
-    }
-
-    private static void migrateFile(File file, File ksDir, String additionalPath)
-    {
-        if (file.isDirectory())
-            return;
-
-        try
-        {
-            String name = file.getName();
-            boolean isManifest = name.endsWith(LeveledManifest.EXTENSION);
-            int separatorIndex = name.indexOf(Component.separator);
-
-            if (isManifest || (separatorIndex >= 0))
-            {
-                String cfname = isManifest
-                              ? getCfNameFromManifest(name)
-                              : name.substring(0, separatorIndex);
-
-                int idx = cfname.indexOf(SECONDARY_INDEX_NAME_SEPARATOR); // idx > 0 => secondary index
-                String dirname = idx > 0 ? cfname.substring(0, idx) : cfname;
-                File destDir = getOrCreate(ksDir, dirname, additionalPath);
-
-                File destFile = new File(destDir, isManifest ? name : ksDir.getName() + Component.separator + name);
-                logger.debug(String.format("[upgrade to 1.1] Moving %s to %s", file, destFile));
-                FileUtils.renameWithConfirm(file, destFile);
-            }
-            else
-            {
-                logger.warn("Found unrecognized file {} while migrating sstables from pre 1.1 format, ignoring.", file);
-            }
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(String.format("Failed migrating file %s from pre 1.1 format.", file.getPath()), e);
-        }
-    }
-
-    private static String getCfNameFromManifest(String name)
-    {
-        String withoutExt = name.substring(0, name.length() - LeveledManifest.EXTENSION.length());
-        return withoutExt.endsWith("-old") || withoutExt.endsWith("-tmp")
-                ? withoutExt.substring(0, withoutExt.length() - 4)
-                : withoutExt;
-    }
-
     // Hack for tests, don't use otherwise
     static void overrideDataDirectoriesForTest(String loc)
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/IndexScanCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/IndexScanCommand.java b/src/java/org/apache/cassandra/db/IndexScanCommand.java
deleted file mode 100644
index e4be841..0000000
--- a/src/java/org/apache/cassandra/db/IndexScanCommand.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.db;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import org.apache.cassandra.dht.AbstractBounds;
-import org.apache.cassandra.io.IVersionedSerializer;
-import org.apache.cassandra.net.MessageOut;
-import org.apache.cassandra.net.MessagingService;
-import org.apache.cassandra.thrift.IndexClause;
-import org.apache.cassandra.thrift.SlicePredicate;
-import org.apache.cassandra.thrift.TBinaryProtocol;
-import org.apache.cassandra.utils.FBUtilities;
-import org.apache.thrift.TDeserializer;
-import org.apache.thrift.TSerializer;
-
-public class IndexScanCommand
-{
-    public static final IndexScanCommandSerializer serializer = new IndexScanCommandSerializer();
-
-    public final String keyspace;
-    public final String column_family;
-    public final IndexClause index_clause;
-    public final SlicePredicate predicate;
-    public final AbstractBounds<RowPosition> range;
-
-    public IndexScanCommand(String keyspace, String column_family, IndexClause index_clause, SlicePredicate predicate, AbstractBounds<RowPosition> range)
-    {
-
-        this.keyspace = keyspace;
-        this.column_family = column_family;
-        this.index_clause = index_clause;
-        this.predicate = predicate;
-        this.range = range;
-    }
-
-    public MessageOut<IndexScanCommand> createMessage()
-    {
-        return new MessageOut<IndexScanCommand>(MessagingService.Verb.INDEX_SCAN, this, serializer);
-    }
-
-    static class IndexScanCommandSerializer implements IVersionedSerializer<IndexScanCommand>
-    {
-        public void serialize(IndexScanCommand o, DataOutput out, int version) throws IOException
-        {
-            assert version < MessagingService.VERSION_12; // 1.2 only uses RangeScanCommand
-
-            out.writeUTF(o.keyspace);
-            out.writeUTF(o.column_family);
-            TSerializer ser = new TSerializer(new TBinaryProtocol.Factory());
-            FBUtilities.serialize(ser, o.index_clause, out);
-            FBUtilities.serialize(ser, o.predicate, out);
-            AbstractBounds.serializer.serialize(o.range, out, version);
-        }
-
-        public IndexScanCommand deserialize(DataInput in, int version) throws IOException
-        {
-            assert version < MessagingService.VERSION_12; // 1.2 only uses RangeScanCommand
-
-            String keyspace = in.readUTF();
-            String columnFamily = in.readUTF();
-
-            IndexClause indexClause = new IndexClause();
-            SlicePredicate predicate = new SlicePredicate();
-            TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
-            FBUtilities.deserialize(dser, indexClause, in);
-            FBUtilities.deserialize(dser, predicate, in);
-            AbstractBounds<RowPosition> range = AbstractBounds.serializer.deserialize(in, version).toRowBounds();
-            return new IndexScanCommand(keyspace, columnFamily, indexClause, predicate, range);
-        }
-
-        public long serializedSize(IndexScanCommand object, int version)
-        {
-            throw new UnsupportedOperationException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java b/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
index 5a6625f..8c5b12a 100644
--- a/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
@@ -41,12 +41,7 @@ public class MigrationRequestVerbHandler implements IVerbHandler
     {
         logger.debug("Received migration request from {}.", message.from);
 
-        if (message.version < MessagingService.VERSION_12)
-            logger.debug("Returning empty response to the migration request from {} (version < 1.2).", message.from);
-
-        Collection<RowMutation> schema = message.version < MessagingService.VERSION_12
-                                         ? Collections.EMPTY_SET
-                                         : SystemTable.serializeSchema();
+        Collection<RowMutation> schema = SystemTable.serializeSchema();
 
         MessageOut<Collection<RowMutation>> response = new MessageOut<Collection<RowMutation>>(MessagingService.Verb.INTERNAL_RESPONSE,
                                                                                                schema,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/RangeSliceCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RangeSliceCommand.java b/src/java/org/apache/cassandra/db/RangeSliceCommand.java
index 706def2..ae9fab1 100644
--- a/src/java/org/apache/cassandra/db/RangeSliceCommand.java
+++ b/src/java/org/apache/cassandra/db/RangeSliceCommand.java
@@ -131,37 +131,6 @@ public class RangeSliceCommand implements IReadCommand
         return keyspace;
     }
 
-    // Convert to a equivalent IndexScanCommand for backward compatibility sake
-    public IndexScanCommand toIndexScanCommand()
-    {
-        assert row_filter != null && !row_filter.isEmpty();
-        if (countCQL3Rows || isPaging)
-            throw new IllegalStateException("Cannot proceed with range query as the remote end has a version < 1.1. Please update the full cluster first.");
-
-        CFMetaData cfm = Schema.instance.getCFMetaData(keyspace, column_family);
-        try
-        {
-            if (!ThriftValidation.validateFilterClauses(cfm, row_filter))
-                throw new IllegalStateException("Cannot proceed with non-indexed query as the remote end has a version < 1.1. Please update the full cluster first.");
-        }
-        catch (InvalidRequestException e)
-        {
-            throw new RuntimeException(e);
-        }
-
-        RowPosition start = range.left;
-        ByteBuffer startKey = ByteBufferUtil.EMPTY_BYTE_BUFFER;
-        if (start instanceof DecoratedKey)
-        {
-            startKey = ((DecoratedKey)start).key;
-        }
-
-        IndexClause clause = new IndexClause(row_filter, startKey, maxResults);
-        // IndexScanCommand is deprecated so don't bother
-        SlicePredicate pred = RangeSliceCommandSerializer.asSlicePredicate(predicate);
-        return new IndexScanCommand(keyspace, column_family, clause, pred, range);
-    }
-
     public long getTimeout()
     {
         return DatabaseDescriptor.getRangeRpcTimeout();
@@ -211,46 +180,26 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
                 ByteBufferUtil.write(sc, out);
         }
 
-        if (version < MessagingService.VERSION_12)
+        IDiskAtomFilter.Serializer.instance.serialize(sliceCommand.predicate, out, version);
+
+        if (sliceCommand.row_filter == null)
         {
-            FBUtilities.serialize(new TSerializer(new TBinaryProtocol.Factory()), asSlicePredicate(sliceCommand.predicate), out);
+            out.writeInt(0);
         }
         else
         {
-            IDiskAtomFilter.Serializer.instance.serialize(sliceCommand.predicate, out, version);
-        }
-
-        if (version >= MessagingService.VERSION_11)
-        {
-            if (sliceCommand.row_filter == null)
+            out.writeInt(sliceCommand.row_filter.size());
+            for (IndexExpression expr : sliceCommand.row_filter)
             {
-                out.writeInt(0);
-            }
-            else
-            {
-                out.writeInt(sliceCommand.row_filter.size());
-                for (IndexExpression expr : sliceCommand.row_filter)
-                {
-                    if (version < MessagingService.VERSION_12)
-                    {
-                        FBUtilities.serialize(new TSerializer(new TBinaryProtocol.Factory()), expr, out);
-                    }
-                    else
-                    {
-                        ByteBufferUtil.writeWithShortLength(expr.column_name, out);
-                        out.writeInt(expr.op.getValue());
-                        ByteBufferUtil.writeWithShortLength(expr.value, out);
-                    }
-                }
+                ByteBufferUtil.writeWithShortLength(expr.column_name, out);
+                out.writeInt(expr.op.getValue());
+                ByteBufferUtil.writeWithShortLength(expr.value, out);
             }
         }
         AbstractBounds.serializer.serialize(sliceCommand.range, out, version);
         out.writeInt(sliceCommand.maxResults);
-        if (version >= MessagingService.VERSION_11)
-        {
-            out.writeBoolean(sliceCommand.countCQL3Rows);
-            out.writeBoolean(sliceCommand.isPaging);
-        }
+        out.writeBoolean(sliceCommand.countCQL3Rows);
+        out.writeBoolean(sliceCommand.isPaging);
     }
 
     public RangeSliceCommand deserialize(DataInput in, int version) throws IOException
@@ -283,16 +232,7 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
                 comparator = metadata.comparator;
             }
 
-            if (version < MessagingService.VERSION_12)
-            {
-                SlicePredicate pred = new SlicePredicate();
-                FBUtilities.deserialize(new TDeserializer(new TBinaryProtocol.Factory()), pred, in);
-                predicate = ThriftValidation.asIFilter(pred, metadata, superColumn);
-            }
-            else
-            {
-                predicate = IDiskAtomFilter.Serializer.instance.deserialize(in, version, comparator);
-            }
+            predicate = IDiskAtomFilter.Serializer.instance.deserialize(in, version, comparator);
 
             if (metadata.cfType == ColumnFamilyType.Super)
                 predicate = SuperColumns.fromSCFilter((CompositeType)metadata.comparator, superColumn, predicate);
@@ -303,37 +243,21 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
         }
 
         List<IndexExpression> rowFilter = null;
-        if (version >= MessagingService.VERSION_11)
+        int filterCount = in.readInt();
+        rowFilter = new ArrayList<IndexExpression>(filterCount);
+        for (int i = 0; i < filterCount; i++)
         {
-            int filterCount = in.readInt();
-            rowFilter = new ArrayList<IndexExpression>(filterCount);
-            for (int i = 0; i < filterCount; i++)
-            {
-                IndexExpression expr;
-                if (version < MessagingService.VERSION_12)
-                {
-                    expr = new IndexExpression();
-                    FBUtilities.deserialize(new TDeserializer(new TBinaryProtocol.Factory()), expr, in);
-                }
-                else
-                {
-                    expr = new IndexExpression(ByteBufferUtil.readWithShortLength(in),
-                                               IndexOperator.findByValue(in.readInt()),
-                                               ByteBufferUtil.readWithShortLength(in));
-                }
-                rowFilter.add(expr);
-            }
+            IndexExpression expr;
+            expr = new IndexExpression(ByteBufferUtil.readWithShortLength(in),
+                                       IndexOperator.findByValue(in.readInt()),
+                                       ByteBufferUtil.readWithShortLength(in));
+            rowFilter.add(expr);
         }
         AbstractBounds<RowPosition> range = AbstractBounds.serializer.deserialize(in, version).toRowBounds();
 
         int maxResults = in.readInt();
-        boolean countCQL3Rows = false;
-        boolean isPaging = false;
-        if (version >= MessagingService.VERSION_11)
-        {
-            countCQL3Rows = in.readBoolean();
-            isPaging = in.readBoolean();
-        }
+        boolean countCQL3Rows = in.readBoolean();
+        boolean isPaging = in.readBoolean();
         return new RangeSliceCommand(keyspace, columnFamily, predicate, range, rowFilter, maxResults, countCQL3Rows, isPaging);
     }
 
@@ -365,66 +289,26 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
             }
         }
 
-        if (version < MessagingService.VERSION_12)
+        size += IDiskAtomFilter.Serializer.instance.serializedSize(filter, version);
+
+        if (rsc.row_filter == null)
         {
-            TSerializer ser = new TSerializer(new TBinaryProtocol.Factory());
-            try
-            {
-                int predicateLength = ser.serialize(asSlicePredicate(filter)).length;
-                if (version < MessagingService.VERSION_12)
-                    size += TypeSizes.NATIVE.sizeof(predicateLength);
-                size += predicateLength;
-            }
-            catch (TException e)
-            {
-                throw new RuntimeException(e);
-            }
+            size += TypeSizes.NATIVE.sizeof(0);
         }
         else
         {
-            size += IDiskAtomFilter.Serializer.instance.serializedSize(filter, version);
-        }
-
-        if (version >= MessagingService.VERSION_11)
-        {
-            if (rsc.row_filter == null)
+            size += TypeSizes.NATIVE.sizeof(rsc.row_filter.size());
+            for (IndexExpression expr : rsc.row_filter)
             {
-                size += TypeSizes.NATIVE.sizeof(0);
-            }
-            else
-            {
-                size += TypeSizes.NATIVE.sizeof(rsc.row_filter.size());
-                for (IndexExpression expr : rsc.row_filter)
-                {
-                    if (version < MessagingService.VERSION_12)
-                    {
-                        try
-                        {
-                            int filterLength = new TSerializer(new TBinaryProtocol.Factory()).serialize(expr).length;
-                            size += TypeSizes.NATIVE.sizeof(filterLength);
-                            size += filterLength;
-                        }
-                        catch (TException e)
-                        {
-                            throw new RuntimeException(e);
-                        }
-                    }
-                    else
-                    {
-                        size += TypeSizes.NATIVE.sizeofWithShortLength(expr.column_name);
-                        size += TypeSizes.NATIVE.sizeof(expr.op.getValue());
-                        size += TypeSizes.NATIVE.sizeofWithLength(expr.value);
-                    }
-                }
+                size += TypeSizes.NATIVE.sizeofWithShortLength(expr.column_name);
+                size += TypeSizes.NATIVE.sizeof(expr.op.getValue());
+                size += TypeSizes.NATIVE.sizeofWithLength(expr.value);
             }
         }
         size += AbstractBounds.serializer.serializedSize(rsc.range, version);
         size += TypeSizes.NATIVE.sizeof(rsc.maxResults);
-        if (version >= MessagingService.VERSION_11)
-        {
-            size += TypeSizes.NATIVE.sizeof(rsc.countCQL3Rows);
-            size += TypeSizes.NATIVE.sizeof(rsc.isPaging);
-        }
+        size += TypeSizes.NATIVE.sizeof(rsc.countCQL3Rows);
+        size += TypeSizes.NATIVE.sizeof(rsc.isPaging);
         return size;
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/RowIndexEntry.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowIndexEntry.java b/src/java/org/apache/cassandra/db/RowIndexEntry.java
index bd9b483..e987cb5 100644
--- a/src/java/org/apache/cassandra/db/RowIndexEntry.java
+++ b/src/java/org/apache/cassandra/db/RowIndexEntry.java
@@ -110,9 +110,6 @@ public class RowIndexEntry implements IMeasurableMemory
         {
             long position = in.readLong();
 
-            if (!version.hasPromotedIndexes)
-                return new RowIndexEntry(position);
-
             int size = in.readInt();
             if (size > 0)
             {
@@ -123,14 +120,6 @@ public class RowIndexEntry implements IMeasurableMemory
                 for (int i = 0; i < entries; i++)
                     columnsIndex.add(IndexHelper.IndexInfo.deserialize(in));
 
-                if (version.hasRowLevelBF)
-                {
-                    // we only ever used murmur3 BF in the promoted index
-                    in.readInt(); // hash count
-                    int words = in.readInt(); // number of Longs in the OpenBitSet
-                    FileUtils.skipBytesFully(in, words * 8);
-                }
-
                 return new IndexedEntry(position, deletionTime, columnsIndex);
             }
             else
@@ -139,11 +128,10 @@ public class RowIndexEntry implements IMeasurableMemory
             }
         }
 
-        public void skip(DataInput in, Descriptor.Version version) throws IOException
+        public void skip(DataInput in) throws IOException
         {
             in.readLong();
-            if (version.hasPromotedIndexes)
-                skipPromotedIndex(in);
+            skipPromotedIndex(in);
         }
 
         public void skipPromotedIndex(DataInput in) throws IOException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/RowMutation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowMutation.java b/src/java/org/apache/cassandra/db/RowMutation.java
index 9e0e78f..b08055f 100644
--- a/src/java/org/apache/cassandra/db/RowMutation.java
+++ b/src/java/org/apache/cassandra/db/RowMutation.java
@@ -252,11 +252,7 @@ public class RowMutation implements IMutation
             out.writeInt(size);
             assert size > 0;
             for (Map.Entry<UUID, ColumnFamily> entry : rm.modifications.entrySet())
-            {
-                if (version < MessagingService.VERSION_12)
-                    ColumnFamily.serializer.serializeCfId(entry.getKey(), out, version);
                 ColumnFamily.serializer.serialize(entry.getValue(), out, version);
-            }
         }
 
         public RowMutation deserialize(DataInput in, int version, ColumnSerializer.Flag flag) throws IOException
@@ -292,9 +288,6 @@ public class RowMutation implements IMutation
 
         private ColumnFamily deserializeOneCf(DataInput in, int version, ColumnSerializer.Flag flag) throws IOException
         {
-            // We used to uselessly write the cf id here
-            if (version < MessagingService.VERSION_12)
-                ColumnFamily.serializer.deserializeCfId(in, version);
             ColumnFamily cf = ColumnFamily.serializer.deserialize(in, UnsortedColumns.factory, flag, version);
             // We don't allow RowMutation with null column family, so we should never get null back.
             assert cf != null;
@@ -319,11 +312,7 @@ public class RowMutation implements IMutation
 
             size += sizes.sizeof(rm.modifications.size());
             for (Map.Entry<UUID,ColumnFamily> entry : rm.modifications.entrySet())
-            {
-                if (version < MessagingService.VERSION_12)
-                    size += ColumnFamily.serializer.cfIdSerializedSize(entry.getValue().id(), sizes, version);
                 size += ColumnFamily.serializer.serializedSize(entry.getValue(), TypeSizes.NATIVE, version);
-            }
 
             return size;
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java b/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
index 588852c..744dca9 100644
--- a/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
@@ -45,7 +45,7 @@ public class RowMutationVerbHandler implements IVerbHandler<RowMutation>
             if (from == null)
             {
                 byte[] forwardBytes = message.parameters.get(RowMutation.FORWARD_TO);
-                if (forwardBytes != null && message.version >= MessagingService.VERSION_11)
+                if (forwardBytes != null)
                     forwardToLocalNodes(rm, message.verb, forwardBytes, message.from);
             }
             else

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/SuperColumns.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SuperColumns.java b/src/java/org/apache/cassandra/db/SuperColumns.java
index adcde06..753cd91 100644
--- a/src/java/org/apache/cassandra/db/SuperColumns.java
+++ b/src/java/org/apache/cassandra/db/SuperColumns.java
@@ -34,7 +34,6 @@ import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.filter.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CompositeType;
-import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
 public class SuperColumns
@@ -69,7 +68,7 @@ public class SuperColumns
             List<DeletionTime> delTimes = delInfo.rangeCovering(entry.getKey());
             assert delTimes.size() <= 1; // We're supposed to have either no deletion, or a full SC deletion.
             DeletionInfo scDelInfo = delTimes.isEmpty() ? DeletionInfo.LIVE : new DeletionInfo(delTimes.get(0));
-            DeletionInfo.serializer().serialize(scDelInfo, out, MessagingService.VERSION_10);
+            DeletionTime.serializer.serialize(scDelInfo.getTopLevelDeletion(), out);
 
             out.writeInt(entry.getValue().size());
             for (Column subColumn : entry.getValue())
@@ -129,7 +128,7 @@ public class SuperColumns
             List<DeletionTime> delTimes = delInfo.rangeCovering(entry.getKey());
             assert delTimes.size() <= 1; // We're supposed to have either no deletion, or a full SC deletion.
             DeletionInfo scDelInfo = delTimes.isEmpty() ? DeletionInfo.LIVE : new DeletionInfo(delTimes.get(0));
-            size += DeletionInfo.serializer().serializedSize(scDelInfo, MessagingService.VERSION_10);
+            size += DeletionTime.serializer.serializedSize(scDelInfo.getTopLevelDeletion(), TypeSizes.NATIVE);
 
             size += typeSizes.sizeof(entry.getValue().size());
             for (Column subColumn : entry.getValue())
@@ -177,7 +176,7 @@ public class SuperColumns
                 ++read;
 
                 scName = ByteBufferUtil.readWithShortLength(in);
-                DeletionInfo delInfo = DeletionInfo.serializer().deserialize(in, MessagingService.VERSION_10, null);
+                DeletionInfo delInfo = new DeletionInfo(DeletionTime.serializer.deserialize(in));
                 assert !delInfo.rangeIterator().hasNext(); // We assume no range tombstone (there was no way to insert some in a SCF in 1.2)
 
                 /* read the number of columns */
@@ -379,7 +378,7 @@ public class SuperColumns
                 CompositeType.Builder builder = type.builder().add(bb);
                 slices[i++] = new ColumnSlice(builder.build(), builder.buildAsEndOfRange());
             }
-            return new SliceQueryFilter(slices, false, slices.length, 1, 1);
+            return new SliceQueryFilter(slices, false, slices.length, 1);
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/SystemTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemTable.java b/src/java/org/apache/cassandra/db/SystemTable.java
index 5a18314..dc99bc8 100644
--- a/src/java/org/apache/cassandra/db/SystemTable.java
+++ b/src/java/org/apache/cassandra/db/SystemTable.java
@@ -78,11 +78,6 @@ public class SystemTable
     public static final String COMPACTION_LOG = "compactions_in_progress";
     public static final String PAXOS_CF = "paxos";
 
-    @Deprecated
-    public static final String OLD_STATUS_CF = "LocationInfo";
-    @Deprecated
-    public static final String OLD_HINTS_CF = "HintsColumnFamily";
-
     private static final String LOCAL_KEY = "local";
     private static final ByteBuffer ALL_LOCAL_NODE_ID_KEY = ByteBufferUtil.bytes("Local");
 
@@ -100,20 +95,7 @@ public class SystemTable
 
     public static void finishStartup()
     {
-        DefsTable.fixSchemaNanoTimestamps();
         setupVersion();
-        try
-        {
-            upgradeSystemData();
-        }
-        catch (ExecutionException e)
-        {
-            throw new RuntimeException(e);
-        }
-        catch (InterruptedException e)
-        {
-            throw new RuntimeException(e);
-        }
 
         // add entries to system schema columnfamilies for the hardcoded system definitions
         for (String ksname : Schema.systemKeyspaceNames)
@@ -146,47 +128,6 @@ public class SystemTable
                                          DatabaseDescriptor.getPartitioner().getClass().getName()));
     }
 
-    /** if system data becomes incompatible across versions of cassandra, that logic (and associated purging) is managed here */
-    private static void upgradeSystemData() throws ExecutionException, InterruptedException
-    {
-        Table table = Table.open(Table.SYSTEM_KS);
-        ColumnFamilyStore oldStatusCfs = table.getColumnFamilyStore(OLD_STATUS_CF);
-        if (oldStatusCfs.getSSTables().size() > 0)
-        {
-            SortedSet<ByteBuffer> cols = new TreeSet<ByteBuffer>(BytesType.instance);
-            cols.add(ByteBufferUtil.bytes("ClusterName"));
-            cols.add(ByteBufferUtil.bytes("Token"));
-            QueryFilter filter = QueryFilter.getNamesFilter(decorate(ByteBufferUtil.bytes("L")), OLD_STATUS_CF, cols);
-            ColumnFamily oldCf = oldStatusCfs.getColumnFamily(filter);
-            Iterator<Column> oldColumns = oldCf.iterator();
-
-            String clusterName = null;
-            try
-            {
-                clusterName = ByteBufferUtil.string(oldColumns.next().value());
-            }
-            catch (CharacterCodingException e)
-            {
-                throw new RuntimeException(e);
-            }
-            // serialize the old token as a collection of (one )tokens.
-            Token token = StorageService.getPartitioner().getTokenFactory().fromByteArray(oldColumns.next().value());
-            String tokenBytes = tokensAsSet(Collections.singleton(token));
-            // (assume that any node getting upgraded was bootstrapped, since that was stored in a separate row for no particular reason)
-            String req = "INSERT INTO system.%s (key, cluster_name, tokens, bootstrapped) VALUES ('%s', '%s', %s, '%s')";
-            processInternal(String.format(req, LOCAL_CF, LOCAL_KEY, clusterName, tokenBytes, BootstrapState.COMPLETED.name()));
-
-            oldStatusCfs.truncateBlocking();
-        }
-
-        ColumnFamilyStore oldHintsCfs = table.getColumnFamilyStore(OLD_HINTS_CF);
-        if (oldHintsCfs.getSSTables().size() > 0)
-        {
-            logger.info("Possible old-format hints found. Truncating");
-            oldHintsCfs.truncateBlocking();
-        }
-    }
-
     /**
      * Write compaction log, except columfamilies under system keyspace.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/WriteResponse.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/WriteResponse.java b/src/java/org/apache/cassandra/db/WriteResponse.java
index 7bc2032..bfed215 100644
--- a/src/java/org/apache/cassandra/db/WriteResponse.java
+++ b/src/java/org/apache/cassandra/db/WriteResponse.java
@@ -45,30 +45,15 @@ public class WriteResponse
     {
         public void serialize(WriteResponse wm, DataOutput out, int version) throws IOException
         {
-            if (version < MessagingService.VERSION_12)
-            {
-                out.writeUTF("");
-                ByteBufferUtil.writeWithShortLength(ByteBufferUtil.EMPTY_BYTE_BUFFER, out);
-                out.writeBoolean(true);
-            }
         }
 
         public WriteResponse deserialize(DataInput in, int version) throws IOException
         {
-            if (version < MessagingService.VERSION_12)
-            {
-                in.readUTF();
-                ByteBufferUtil.readWithShortLength(in);
-                in.readBoolean();
-            }
             return new WriteResponse();
         }
 
         public long serializedSize(WriteResponse response, int version)
         {
-            TypeSizes sizes = TypeSizes.NATIVE;
-            if (version < MessagingService.VERSION_12)
-                return sizes.sizeof("") + sizes.sizeof((short) 0) + sizes.sizeof(true);
             return 0;
         }
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
index f315ee9..ffbca1a 100644
--- a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
+++ b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
@@ -73,34 +73,19 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskA
         try
         {
             Descriptor.Version version = sstable.descriptor.version;
-            if (version.hasPromotedIndexes)
-            {
-                this.indexes = indexEntry.columnsIndex();
-                if (indexes.isEmpty())
-                {
-                    setToRowStart(sstable, indexEntry, input);
-                    this.emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
-                    emptyColumnFamily.delete(DeletionInfo.serializer().deserializeFromSSTable(file, version));
-                    fetcher = new SimpleBlockFetcher();
-                }
-                else
-                {
-                    emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
-                    emptyColumnFamily.delete(indexEntry.deletionTime());
-                    fetcher = new IndexedBlockFetcher(indexEntry.position);
-                }
-            }
-            else
+            this.indexes = indexEntry.columnsIndex();
+            if (indexes.isEmpty())
             {
                 setToRowStart(sstable, indexEntry, input);
-                IndexHelper.skipBloomFilter(file);
-                this.indexes = IndexHelper.deserializeIndex(file);
                 this.emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
                 emptyColumnFamily.delete(DeletionInfo.serializer().deserializeFromSSTable(file, version));
-                fetcher = indexes.isEmpty()
-                        ? new SimpleBlockFetcher()
-                        : new IndexedBlockFetcher(file.getFilePointer() + 4); // We still have the column count to
-                                                                              // skip to get the basePosition
+                fetcher = new SimpleBlockFetcher();
+            }
+            else
+            {
+                emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
+                emptyColumnFamily.delete(indexEntry.deletionTime());
+                fetcher = new IndexedBlockFetcher(indexEntry.position);
             }
         }
         catch (IOException e)
@@ -124,8 +109,8 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskA
             this.file = input;
             input.seek(indexEntry.position);
         }
-        sstable.decodeKey(ByteBufferUtil.readWithShortLength(file));
-        SSTableReader.readRowSize(file, sstable.descriptor);
+        sstable.partitioner.decorateKey(ByteBufferUtil.readWithShortLength(file));
+        file.readLong();
     }
 
     public ColumnFamily getColumnFamily()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java b/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
index c202763..bc0af30 100644
--- a/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
+++ b/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
@@ -113,23 +113,12 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator implement
             else
                 file.seek(indexEntry.position);
 
-            DecoratedKey keyInDisk = SSTableReader.decodeKey(sstable.partitioner,
-                                                             sstable.descriptor,
-                                                             ByteBufferUtil.readWithShortLength(file));
+            DecoratedKey keyInDisk = sstable.partitioner.decorateKey(ByteBufferUtil.readWithShortLength(file));
             assert keyInDisk.equals(key) : String.format("%s != %s in %s", keyInDisk, key, file.getPath());
-            SSTableReader.readRowSize(file, sstable.descriptor);
+            file.readLong();
         }
 
-        if (sstable.descriptor.version.hasPromotedIndexes)
-        {
-            indexList = indexEntry.columnsIndex();
-        }
-        else
-        {
-            assert file != null;
-            IndexHelper.skipBloomFilter(file);
-            indexList = IndexHelper.deserializeIndex(file);
-        }
+        indexList = indexEntry.columnsIndex();
 
         if (!indexEntry.isIndexed())
         {
@@ -157,18 +146,7 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator implement
         }
         else
         {
-            long basePosition;
-            if (sstable.descriptor.version.hasPromotedIndexes)
-            {
-                basePosition = indexEntry.position;
-            }
-            else
-            {
-                assert file != null;
-                file.readInt(); // column count
-                basePosition = file.getFilePointer();
-            }
-            readIndexedColumns(sstable.metadata, file, columns, indexList, basePosition, result);
+            readIndexedColumns(sstable.metadata, file, columns, indexList, indexEntry.position, result);
         }
 
         // create an iterator view of the columns we read

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java b/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
index 45f58a7..efbb92c 100644
--- a/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
+++ b/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
@@ -63,14 +63,9 @@ class SimpleSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskAt
 
             // Skip key and data size
             ByteBufferUtil.skipShortLength(file);
-            SSTableReader.readRowSize(file, sstable.descriptor);
+            file.readLong();
 
             Descriptor.Version version = sstable.descriptor.version;
-            if (!version.hasPromotedIndexes)
-            {
-                IndexHelper.skipBloomFilter(file);
-                IndexHelper.skipIndex(file);
-            }
 
             emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
             emptyColumnFamily.delete(DeletionInfo.serializer().deserializeFromSSTable(file, version));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
index 533219c..87de7d8 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
@@ -33,7 +33,6 @@ public class CommitLogDescriptor
     // match both legacy and new version of commitlogs Ex: CommitLog-12345.log and CommitLog-4-12345.log.
     private static final Pattern COMMIT_LOG_FILE_PATTERN = Pattern.compile(FILENAME_PREFIX + "((\\d+)(" + SEPARATOR + "\\d+)?)" + FILENAME_EXTENSION);
 
-    public static final int LEGACY_VERSION = 1;
     public static final int VERSION_12 = 2;
     public static final int VERSION_20 = 3;
     /**
@@ -62,16 +61,11 @@ public class CommitLogDescriptor
         if (!(matcher = COMMIT_LOG_FILE_PATTERN.matcher(name)).matches())
             throw new RuntimeException("Cannot parse the version of the file: " + name);
 
-        if (matcher.group(3) != null)
-        {
-            long id = Long.parseLong(matcher.group(3).split(SEPARATOR)[1]);
-            return new CommitLogDescriptor(Integer.parseInt(matcher.group(2)), id);
-        }
-        else
-        {
-            long id = Long.parseLong(matcher.group(1));
-            return new CommitLogDescriptor(LEGACY_VERSION, id);
-        }
+        if (matcher.group(3) == null)
+            throw new UnsupportedOperationException("Commitlog segment is too old to open; upgrade to 1.2.5+ first");
+
+        long id = Long.parseLong(matcher.group(3).split(SEPARATOR)[1]);
+        return new CommitLogDescriptor(Integer.parseInt(matcher.group(2)), id);
     }
 
     public int getMessagingVersion()
@@ -79,8 +73,6 @@ public class CommitLogDescriptor
         assert MessagingService.current_version == MessagingService.VERSION_20;
         switch (version)
         {
-            case LEGACY_VERSION:
-                return MessagingService.VERSION_11;
             case VERSION_12:
                 return MessagingService.VERSION_12;
             case VERSION_20:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/compaction/Scrubber.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/Scrubber.java b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
index 993cf3c..fa4dd51 100644
--- a/src/java/org/apache/cassandra/db/compaction/Scrubber.java
+++ b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
@@ -126,8 +126,8 @@ public class Scrubber implements Closeable
                 long dataSize = -1;
                 try
                 {
-                    key = SSTableReader.decodeKey(sstable.partitioner, sstable.descriptor, ByteBufferUtil.readWithShortLength(dataFile));
-                    dataSize = sstable.descriptor.version.hasIntRowSize ? dataFile.readInt() : dataFile.readLong();
+                    key = sstable.partitioner.decorateKey(ByteBufferUtil.readWithShortLength(dataFile));
+                    dataSize = dataFile.readLong();
                     outputHandler.debug(String.format("row %s is %s bytes", ByteBufferUtil.bytesToHex(key.key), dataSize));
                 }
                 catch (Throwable th)
@@ -155,7 +155,7 @@ public class Scrubber implements Closeable
                 long dataStart = dataFile.getFilePointer();
                 long dataStartFromIndex = currentIndexKey == null
                                         ? -1
-                                        : rowStart + 2 + currentIndexKey.remaining() + (sstable.descriptor.version.hasIntRowSize ? 4 : 8);
+                                        : rowStart + 2 + currentIndexKey.remaining() + 8;
                 long dataSizeFromIndex = nextRowPositionFromIndex - dataStartFromIndex;
                 assert currentIndexKey != null || indexFile.isEOF();
                 if (currentIndexKey != null)
@@ -201,7 +201,7 @@ public class Scrubber implements Closeable
                     {
                         outputHandler.output(String.format("Retrying from row index; data is %s bytes starting at %s",
                                                   dataSizeFromIndex, dataStartFromIndex));
-                        key = SSTableReader.decodeKey(sstable.partitioner, sstable.descriptor, currentIndexKey);
+                        key = sstable.partitioner.decorateKey(currentIndexKey);
                         try
                         {
                             SSTableIdentityIterator row = new SSTableIdentityIterator(sstable, dataFile, key, dataStartFromIndex, dataSizeFromIndex, true);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f2c3a8e/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
index bc2f71c..4e31cf2 100644
--- a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
@@ -157,10 +157,7 @@ public class NamesQueryFilter implements IDiskAtomFilter
             {
                 ByteBufferUtil.writeWithShortLength(cName, out);
             }
-            // If we talking against an older node, we have no way to tell him that we want to count CQL3 rows. This does mean that
-            // this node may return less data than required. The workaround being to upgrade all nodes.
-            if (version >= MessagingService.VERSION_12)
-                out.writeBoolean(f.countCQL3Rows);
+            out.writeBoolean(f.countCQL3Rows);
         }
 
         public NamesQueryFilter deserialize(DataInput in, int version) throws IOException
@@ -174,9 +171,7 @@ public class NamesQueryFilter implements IDiskAtomFilter
             SortedSet<ByteBuffer> columns = new TreeSet<ByteBuffer>(comparator);
             for (int i = 0; i < size; ++i)
                 columns.add(ByteBufferUtil.readWithShortLength(in));
-            boolean countCQL3Rows = version >= MessagingService.VERSION_12
-                                  ? in.readBoolean()
-                                  : false;
+            boolean countCQL3Rows = in.readBoolean();
             return new NamesQueryFilter(columns, countCQL3Rows);
         }
 
@@ -189,8 +184,7 @@ public class NamesQueryFilter implements IDiskAtomFilter
                 int cNameSize = cName.remaining();
                 size += sizes.sizeof((short) cNameSize) + cNameSize;
             }
-            if (version >= MessagingService.VERSION_12)
-                size += sizes.sizeof(f.countCQL3Rows);
+            size += sizes.sizeof(f.countCQL3Rows);
             return size;
         }
     }


Mime
View raw message