cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1179433 - in /cassandra/branches/cassandra-1.0.0: CHANGES.txt src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
Date Wed, 05 Oct 2011 20:48:22 GMT
Author: jbellis
Date: Wed Oct  5 20:48:22 2011
New Revision: 1179433

URL: http://svn.apache.org/viewvc?rev=1179433&view=rev
Log:
add estimated tasks to LeveledCompactionStrategy
patch by jbellis; reviewed by bcoverston for CASSANDRA-3322

Modified:
    cassandra/branches/cassandra-1.0.0/CHANGES.txt
    cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
    cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java

Modified: cassandra/branches/cassandra-1.0.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/CHANGES.txt?rev=1179433&r1=1179432&r2=1179433&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0.0/CHANGES.txt Wed Oct  5 20:48:22 2011
@@ -6,6 +6,7 @@
    (CASSANDRA-3295)
  * Fix broken CompressedRandomAccessReaderTest (CASSANDRA-3298)
  * (CQL) fix type information returned for wildcard queries (CASSANDRA-3311)
+ * add estimated tasks to LeveledCompactionStrategy (CASSANDRA-3322)
 Fixes merged from 0.8 below:
  * Fix tool .bat files when CASSANDRA_HOME contains spaces (CASSANDRA-3258)
  * Force flush of status table when removing/updating token (CASSANDRA-3243)

Modified: cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java?rev=1179433&r1=1179432&r2=1179433&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
(original)
+++ cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
Wed Oct  5 20:48:22 2011
@@ -135,7 +135,7 @@ public class LeveledCompactionStrategy e
 
     public int getEstimatedRemainingTasks()
     {
-        return 0;
+        return manifest.getEstimatedTasks();
     }
 
     public void handleNotification(INotification notification, Object sender)

Modified: cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java?rev=1179433&r1=1179432&r2=1179433&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
(original)
+++ cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
Wed Oct  5 20:48:22 2011
@@ -418,4 +418,17 @@ public class LeveledManifest
     {
         return generations[i];
     }
+
+    public int getEstimatedTasks()
+    {
+        int n = 0;
+        for (int i = generations.length - 1; i >= 0; i--)
+        {
+            List<SSTableReader> sstables = generations[i];
+            if (sstables.isEmpty())
+                continue;
+            n += (SSTableReader.getTotalBytes(sstables) - maxBytesForLevel(i)) / maxSSTableSizeInMB;
+        }
+        return n;
+    }
 }



Mime
View raw message