Updated Branches:
  refs/heads/trunk 2a7786e45 -> e75c53ea1

fix LeveledCompactionStrategy broken because of generation pre-allocation in 
LeveledManifest
patch by Sylvain Lebresne; reviewed by Pavel Yaskevich for CASSANDRA-3691


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

Branch: refs/heads/trunk
Commit: e75c53ea14630bb89cde29328723be5e9dcbeb58
Parents: 2a7786e
Author: Pavel Yaskevich <[email protected]>
Authored: Tue Jan 3 22:32:44 2012 +0200
Committer: Pavel Yaskevich <[email protected]>
Committed: Tue Jan 3 22:34:12 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 ++
 .../cassandra/db/compaction/LeveledManifest.java   |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e75c53ea/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 24f4656..3be6393 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -37,6 +37,8 @@
  * introduce 'crc_check_chance' in CompressionParameters to support
    a checksum percentage checking chance similarly to read-repair 
(CASSANDRA-3611)
  * a way to deactivate global key/row cache on per-CF basis (CASSANDRA-3667)
+ * fix LeveledCompactionStrategy broken because of generation pre-allocation
+   in LeveledManifest (CASSANDRA-3691)
 
 
 1.0.7

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e75c53ea/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 b80aace..bc99e71 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 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;
 import org.apache.cassandra.io.sstable.SSTable;
@@ -59,7 +59,7 @@ public class LeveledManifest
 
     private final ColumnFamilyStore cfs;
     private final List<SSTableReader>[] generations;
-    private final DecoratedKey[] lastCompactedKeys;
+    private final RowPosition[] lastCompactedKeys;
     private final int maxSSTableSizeInMB;
     private int levelCount;
 
@@ -71,11 +71,11 @@ public class LeveledManifest
         // allocate enough generations for a PB of data
         int n = (int) Math.log10(1000 * 1000 * 1000 / maxSSTableSizeInMB);
         generations = new List[n];
-        lastCompactedKeys = new DecoratedKey[n];
+        lastCompactedKeys = new RowPosition[n];
         for (int i = 0; i < generations.length; i++)
         {
             generations[i] = new ArrayList<SSTableReader>();
-            lastCompactedKeys[i] = new 
DecoratedKey(cfs.partitioner.getMinimumToken(), null);
+            lastCompactedKeys[i] = 
cfs.partitioner.getMinimumToken().minKeyBound();
         }
     }
 

Reply via email to