cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1098733 - in /cassandra/branches/cassandra-0.8: src/java/org/apache/cassandra/db/CompactionManager.java test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
Date Mon, 02 May 2011 18:58:11 GMT
Author: jbellis
Date: Mon May  2 18:58:11 2011
New Revision: 1098733

URL: http://svn.apache.org/viewvc?rev=1098733&view=rev
Log:
fix CompactionsPurgeTest

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/CompactionManager.java?rev=1098733&r1=1098732&r2=1098733&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/CompactionManager.java
Mon May  2 18:58:11 2011
@@ -378,7 +378,7 @@ public class CompactionManager implement
         submitUserDefined(cfs, descriptors, getDefaultGcBefore(cfs));
     }
 
-    private Future<Object> submitUserDefined(final ColumnFamilyStore cfs, final Collection<Descriptor>
dataFiles, final int gcBefore)
+    Future<Object> submitUserDefined(final ColumnFamilyStore cfs, final Collection<Descriptor>
dataFiles, final int gcBefore)
     {
         Callable<Object> callable = new Callable<Object>()
         {

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java?rev=1098733&r1=1098732&r2=1098733&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
(original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
Mon May  2 18:58:11 2011
@@ -21,6 +21,7 @@ package org.apache.cassandra.db;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.concurrent.ExecutionException;
 
 import org.junit.Test;
@@ -28,6 +29,7 @@ import org.junit.Test;
 import org.apache.cassandra.CleanupHelper;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.Util;
 
@@ -148,7 +150,7 @@ public class CompactionsPurgeTest extend
 
         Table table = Table.open(TABLE1);
         String cfName = "Standard2";
-        ColumnFamilyStore store = table.getColumnFamilyStore(cfName);
+        ColumnFamilyStore cfs = table.getColumnFamilyStore(cfName);
 
         DecoratedKey key = Util.dk("key1");
         RowMutation rm;
@@ -168,13 +170,14 @@ public class CompactionsPurgeTest extend
             rm.delete(new QueryPath(cfName, null, ByteBufferUtil.bytes(String.valueOf(i))),
1);
             rm.apply();
         }
-        store.forceBlockingFlush();
+        cfs.forceBlockingFlush();
 
-        assert store.getSSTables().size() == 1 : store.getSSTables(); // inserts & deletes
were in the same memtable -> only deletes in sstable
+        assert cfs.getSSTables().size() == 1 : cfs.getSSTables(); // inserts & deletes
were in the same memtable -> only deletes in sstable
 
         // compact and test that the row is completely gone
-        CompactionManager.instance.submitMajor(store, 0, Integer.MAX_VALUE).get();
-        assert store.getSSTables().isEmpty();
+        Descriptor descriptor = cfs.getSSTables().iterator().next().descriptor;
+        CompactionManager.instance.submitUserDefined(cfs, Collections.singletonList(descriptor),
Integer.MAX_VALUE).get();
+        assert cfs.getSSTables().isEmpty();
         ColumnFamily cf = table.getColumnFamilyStore(cfName).getColumnFamily(QueryFilter.getIdentityFilter(key,
new QueryPath(cfName)));
         assert cf == null : cf;
     }
@@ -210,8 +213,9 @@ public class CompactionsPurgeTest extend
 
         // flush and major compact
         cfs.forceBlockingFlush();
-        CompactionManager.instance.submitMajor(cfs, 0, Integer.MAX_VALUE).get();
-        //cfs.invalidateCachedRow(key);
+        assert cfs.getSSTables().size() == 1;
+        Descriptor descriptor = cfs.getSSTables().iterator().next().descriptor;
+        CompactionManager.instance.submitUserDefined(cfs, Collections.singletonList(descriptor),
Integer.MAX_VALUE).get();
 
         // re-inserts with timestamp lower than delete
         rm = new RowMutation(tableName, key.key);



Mime
View raw message