cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/6] git commit: revert assertions from #4233
Date Wed, 09 May 2012 19:57:13 GMT
revert assertions from #4233


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

Branch: refs/heads/trunk
Commit: a2a28a4081d244b8e6c2da90b4f63beefdbccfaf
Parents: 08848e7
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed May 9 14:55:59 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed May 9 14:55:59 2012 -0500

----------------------------------------------------------------------
 .../db/compaction/LeveledCompactionStrategy.java   |   25 ++-------------
 .../cassandra/db/compaction/LeveledManifest.java   |    9 -----
 2 files changed, 3 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a2a28a40/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
index 5403aa2..858a2bc 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -172,40 +172,21 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
implem
     {
         Multimap<Integer, SSTableReader> byLevel = ArrayListMultimap.create();
         for (SSTableReader sstable : sstables)
-        {
-            int level = manifest.levelOf(sstable);
-            assert level >= 0;
-            byLevel.get(level).add(sstable);
-        }
+            byLevel.get(manifest.levelOf(sstable)).add(sstable);
 
         List<ICompactionScanner> scanners = new ArrayList<ICompactionScanner>(sstables.size());
         for (Integer level : byLevel.keySet())
         {
             if (level == 0)
             {
-                // L0 makes no guarantees about overlapping-ness.  Just create a direct scanner
for each.
+                // L0 makes no guarantees about overlapping-ness.  Just create a direct scanner
for each
                 for (SSTableReader sstable : byLevel.get(level))
                     scanners.add(sstable.getDirectScanner(range));
             }
             else
             {
                 // Create a LeveledScanner that only opens one sstable at a time, in sorted
order
-                ArrayList<SSTableReader> sstables1 = new ArrayList<SSTableReader>(byLevel.get(level));
-                scanners.add(new LeveledScanner(sstables1, range));
-
-                Collections.sort(sstables1, SSTable.sstableComparator);
-                SSTableReader previous = null;
-                for (SSTableReader sstable : sstables1)
-                {
-                    assert previous == null || sstable.first.compareTo(previous.last) >
0 : String.format("%s >= %s in %s and %s for %s in %s",
-                                                                                        
                 previous.last,
-                                                                                        
                 sstable.first,
-                                                                                        
                 previous,
-                                                                                        
                 sstable,
-                                                                                        
                 sstable.getColumnFamilyName(),
-                                                                                        
                 manifest.getLevel(level));
-                    previous = sstable;
-                }
+                scanners.add(new LeveledScanner(byLevel.get(level), range));
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a2a28a40/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index c3517e1..69ab492 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -32,7 +32,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.DecoratedKey;
 import org.apache.cassandra.db.RowPosition;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.dht.Token;
@@ -189,14 +188,6 @@ public class LeveledManifest
         for (SSTableReader ssTableReader : added)
             add(ssTableReader, newLevel);
 
-        DecoratedKey last = null;
-        Collections.sort(generations[newLevel], SSTable.sstableComparator);
-        for (SSTableReader sstable : generations[newLevel])
-        {
-            assert last == null || sstable.first.compareTo(last) > 0;
-            last = sstable.last;
-        }
-
         serialize();
     }
 


Mime
View raw message