Updated Branches:
  refs/heads/trunk 3634eab1d -> cabf0fa32

Make standalone scrubber handle both old and new style leveled manifest.

Patch by marcuse, reviewed by jbellis for CASSANDRA-6005


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

Branch: refs/heads/trunk
Commit: fa70e064c41b13c1528359485c0e2bffcf3b23f6
Parents: c788117
Author: Marcus Eriksson <marc...@spotify.com>
Authored: Fri Sep 13 09:15:24 2013 +0200
Committer: Marcus Eriksson <marc...@spotify.com>
Committed: Fri Sep 13 09:18:21 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                 | 2 ++
 src/java/org/apache/cassandra/tools/StandaloneScrubber.java | 9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fa70e064/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 053eb70..814029d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -13,6 +13,8 @@
  * Improve native protocol serialization (CASSANDRA-5664)
  * Upgrade Thrift to 0.9.1 (CASSANDRA-5923)
  * Require superuser status for adding triggers (CASSANDRA-5963)
+ * Make standalone scrubber handle old and new style leveled manifest
+   (CASSANDRA-6005)
 Merged from 1.2:
 1.2.10
  * Fix possible divide-by-zero in HHOM (CASSANDRA-5990)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fa70e064/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java 
b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
index 4971bbd..780ff5b 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
@@ -28,6 +28,7 @@ import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Directories;
 import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.db.compaction.LeveledCompactionStrategy;
 import org.apache.cassandra.db.compaction.LeveledManifest;
 import org.apache.cassandra.db.compaction.Scrubber;
 import org.apache.cassandra.io.sstable.*;
@@ -97,13 +98,17 @@ public class StandaloneScrubber
             }
             System.out.println(String.format("Pre-scrub sstables snapshotted 
into snapshot %s", snapshotName));
 
-            // If leveled, load the manifest
-            LeveledManifest manifest = null;
+            // if old-style json manifest, snapshot it
             if (cfs.directories.tryGetLeveledManifest() != null)
             {
                 cfs.directories.snapshotLeveledManifest(snapshotName);
                 System.out.println(String.format("Leveled manifest snapshotted 
into snapshot %s", snapshotName));
+            }
 
+            LeveledManifest manifest = null;
+            // If leveled, load the manifest
+            if (cfs.getCompactionStrategy() instanceof 
LeveledCompactionStrategy)
+            {
                 int maxSizeInMB = 
(int)((cfs.getCompactionStrategy().getMaxSSTableSize()) / (1024L * 1024L));
                 manifest = LeveledManifest.create(cfs, maxSizeInMB, sstables);
             }

Reply via email to