cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1060590 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
Date Tue, 18 Jan 2011 21:45:23 GMT
Author: jbellis
Date: Tue Jan 18 21:45:22 2011
New Revision: 1060590

URL: http://svn.apache.org/viewvc?rev=1060590&view=rev
Log:
add some asserts to doCompaction
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java?rev=1060590&r1=1060589&r2=1060590&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
Tue Jan 18 21:45:22 2011
@@ -362,10 +362,17 @@ public class CompactionManager implement
     {
         // The collection of sstables passed may be empty (but not null); even if
         // it is not empty, it may compact down to nothing if all rows are deleted.
+        assert sstables != null;
+
         Table table = cfs.table;
         if (DatabaseDescriptor.isSnapshotBeforeCompaction())
             table.snapshot("compact-" + cfs.columnFamily);
+
+        // sanity check: all sstables must belong to the same cfs
         logger.info("Compacting [" + StringUtils.join(sstables, ",") + "]");
+        for (SSTableReader sstable : sstables)
+            assert sstable.descriptor.cfname.equals(cfs.columnFamily);
+
         String compactionFileLocation = table.getDataFileLocation(cfs.getExpectedCompactedFileSize(sstables));
         // If the compaction file path is null that means we have no space left for this
compaction.
         // try again w/o the largest one.



Mime
View raw message