You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jm...@apache.org on 2015/08/19 16:26:42 UTC

[1/3] cassandra git commit: Fix LeveledCompactionStrategyTest on Windows

Repository: cassandra
Updated Branches:
  refs/heads/trunk bc0e695e2 -> b83b674ee


Fix LeveledCompactionStrategyTest on Windows

Patch by jmckenzie; reviewed by marcuse for CASSANDRA-10115


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

Branch: refs/heads/trunk
Commit: de2e0a6c9a853234a381b28839f4736b666dc2a3
Parents: fce8478
Author: Joshua McKenzie <jm...@apache.org>
Authored: Wed Aug 19 10:25:06 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Wed Aug 19 10:25:06 2015 -0400

----------------------------------------------------------------------
 .../LeveledCompactionStrategyTest.java          | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/de2e0a6c/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index c7935fe..ccfc6ab 100644
--- a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@ -28,12 +28,16 @@ import java.util.Random;
 import java.util.UUID;
 
 import org.apache.cassandra.io.sstable.format.SSTableReader;
+import junit.framework.Assert;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.cassandra.OrderedJUnit4ClassRunner;
 import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.Util;
@@ -61,6 +65,8 @@ import static org.junit.Assert.assertTrue;
 @RunWith(OrderedJUnit4ClassRunner.class)
 public class LeveledCompactionStrategyTest
 {
+    private static final Logger logger = LoggerFactory.getLogger(LeveledCompactionStrategyTest.class);
+
     private static final String KEYSPACE1 = "LeveledCompactionStrategyTest";
     private static final String CF_STANDARDDLEVELED = "StandardLeveled";
     private Keyspace keyspace;
@@ -108,8 +114,8 @@ public class LeveledCompactionStrategyTest
         new Random().nextBytes(value.array());
 
         // Enough data to have a level 1 and 2
-        int rows = 20;
-        int columns = 10;
+        int rows = 40;
+        int columns = 20;
 
         // Adds enough data to trigger multiple sstable per level
         for (int r = 0; r < rows; r++)
@@ -127,8 +133,15 @@ public class LeveledCompactionStrategyTest
         waitForLeveling(cfs);
         WrappingCompactionStrategy strategy = (WrappingCompactionStrategy) cfs.getCompactionStrategy();
         // Checking we're not completely bad at math
-        assert strategy.getSSTableCountPerLevel()[1] > 0;
-        assert strategy.getSSTableCountPerLevel()[2] > 0;
+        int l1Count = strategy.getSSTableCountPerLevel()[1];
+        int l2Count = strategy.getSSTableCountPerLevel()[2];
+        if (l1Count == 0 || l2Count == 0)
+        {
+            logger.error("L1 or L2 has 0 sstables. Expected > 0 on both.");
+            logger.error("L1: " + l1Count);
+            logger.error("L2: " + l2Count);
+            Assert.fail();
+        }
 
         Collection<Collection<SSTableReader>> groupedSSTables = cfs.getCompactionStrategy().groupSSTablesForAntiCompaction(cfs.getSSTables());
         for (Collection<SSTableReader> sstableGroup : groupedSSTables)


[2/3] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Posted by jm...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0

Conflicts:
	test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java


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

Branch: refs/heads/trunk
Commit: 811ee6ca2e167d1676501b64b4c1506ff281bf20
Parents: db78236 de2e0a6
Author: Joshua McKenzie <jm...@apache.org>
Authored: Wed Aug 19 10:25:57 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Wed Aug 19 10:25:57 2015 -0400

----------------------------------------------------------------------
 .../LeveledCompactionStrategyTest.java          | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/811ee6ca/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index 46c7068,ccfc6ab..bb15e88
--- a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@@ -26,6 -26,9 +26,7 @@@ import java.util.List
  import java.util.Random;
  import java.util.UUID;
  
 -import org.apache.cassandra.io.sstable.format.SSTableReader;
+ import junit.framework.Assert;
  import org.junit.After;
  import org.junit.Before;
  import org.junit.BeforeClass;
@@@ -116,12 -131,19 +122,19 @@@ public class LeveledCompactionStrategyT
          }
  
          waitForLeveling(cfs);
 -        WrappingCompactionStrategy strategy = (WrappingCompactionStrategy) cfs.getCompactionStrategy();
 +        CompactionStrategyManager strategy =  cfs.getCompactionStrategyManager();
          // Checking we're not completely bad at math
-         assert strategy.getSSTableCountPerLevel()[1] > 0;
-         assert strategy.getSSTableCountPerLevel()[2] > 0;
+         int l1Count = strategy.getSSTableCountPerLevel()[1];
+         int l2Count = strategy.getSSTableCountPerLevel()[2];
+         if (l1Count == 0 || l2Count == 0)
+         {
+             logger.error("L1 or L2 has 0 sstables. Expected > 0 on both.");
+             logger.error("L1: " + l1Count);
+             logger.error("L2: " + l2Count);
+             Assert.fail();
+         }
  
 -        Collection<Collection<SSTableReader>> groupedSSTables = cfs.getCompactionStrategy().groupSSTablesForAntiCompaction(cfs.getSSTables());
 +        Collection<Collection<SSTableReader>> groupedSSTables = cfs.getCompactionStrategyManager().groupSSTablesForAntiCompaction(cfs.getLiveSSTables());
          for (Collection<SSTableReader> sstableGroup : groupedSSTables)
          {
              int groupLevel = -1;


[3/3] cassandra git commit: Merge branch 'cassandra-3.0' into trunk

Posted by jm...@apache.org.
Merge branch 'cassandra-3.0' into trunk


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

Branch: refs/heads/trunk
Commit: b83b674ee6c3d74717d555f1c08e009c52982337
Parents: bc0e695 811ee6c
Author: Joshua McKenzie <jm...@apache.org>
Authored: Wed Aug 19 10:26:19 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Wed Aug 19 10:26:19 2015 -0400

----------------------------------------------------------------------
 .../LeveledCompactionStrategyTest.java          | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------