cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1144692 - /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java
Date Sat, 09 Jul 2011 16:12:15 GMT
Author: jbellis
Date: Sat Jul  9 16:12:15 2011
New Revision: 1144692

URL: http://svn.apache.org/viewvc?rev=1144692&view=rev
Log:
handle zero rowSize in throttleResolution calculation

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java?rev=1144692&r1=1144691&r2=1144692&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionController.java
Sat Jul  9 16:12:15 2011
@@ -57,7 +57,11 @@ public class CompactionController
         this.forceDeserialize = forceDeserialize;
         isMajor = cfs.isCompleteSSTables(this.sstables);
         // how many rows we expect to compact in 100ms
-        throttleResolution = (int) (DatabaseDescriptor.getCompactionThroughputMbPerSec()
* 1024 * 1024 / (10 * cfs.getMeanRowSize()));
+        long rowSize = cfs.getMeanRowSize();
+        int rowsPerSecond = rowSize > 0
+                          ? (int) (DatabaseDescriptor.getCompactionThroughputMbPerSec() *
1024 * 1024 / rowSize)
+                          : 1000;
+        throttleResolution = rowsPerSecond / 10;
         if (throttleResolution <= 0)
             throttleResolution = 1;
     }



Mime
View raw message