cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [2/2] git commit: LeveledManifest.maxBytesForLevel calculates wrong for sstable_size_in_mb larger than 512 patch by dbrosius reviewed by jbellis for CASSANDRA-4263
Date Mon, 21 May 2012 23:20:04 GMT
LeveledManifest.maxBytesForLevel calculates wrong for sstable_size_in_mb larger than 512
patch by dbrosius reviewed by jbellis for CASSANDRA-4263


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

Branch: refs/heads/cassandra-1.1
Commit: e515e4b25b4839d8c15fbf0b747185d2fa93ca66
Parents: 189e133
Author: Dave Brosius <dbrosius@apache.org>
Authored: Mon May 21 19:15:09 2012 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Mon May 21 19:15:09 2012 -0400

----------------------------------------------------------------------
 .../cassandra/db/compaction/LeveledManifest.java   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e515e4b2/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 592f0e9..7950e97 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -225,7 +225,7 @@ public class LeveledManifest
     private long maxBytesForLevel(int level)
     {
         if (level == 0)
-            return 4 * maxSSTableSizeInMB * 1024 * 1024;
+            return 4L * maxSSTableSizeInMB * 1024 * 1024;
         double bytes = Math.pow(10, level) * maxSSTableSizeInMB * 1024 * 1024;
         if (bytes > Long.MAX_VALUE)
             throw new RuntimeException("At most " + Long.MAX_VALUE + " bytes may be in a
compaction level; your maxSSTableSize must be absurdly high to compute " + bytes);
@@ -469,7 +469,7 @@ public class LeveledManifest
         for (int i = generations.length - 1; i >= 0; i--)
         {
             List<SSTableReader> sstables = generations[i];
-            long n = Math.max(0L, SSTableReader.getTotalBytes(sstables) - maxBytesForLevel(i))
/ (maxSSTableSizeInMB * 1024 * 1024);
+            long n = Math.max(0L, SSTableReader.getTotalBytes(sstables) - maxBytesForLevel(i))
/ (maxSSTableSizeInMB * 1024L * 1024);
             logger.debug("Estimating " + n + " compaction tasks in level " + i);
             tasks += n;
         }


Mime
View raw message