cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [10/10] cassandra git commit: Merge branch 'cassandra-3.0' into trunk
Date Thu, 11 Feb 2016 07:51:53 GMT
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/11de522b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/11de522b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/11de522b

Branch: refs/heads/trunk
Commit: 11de522b5c2d98baa7d73ecace9935097ae8ee10
Parents: 5c2a4ef fdd2cd0
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Thu Feb 11 08:50:42 2016 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Feb 11 08:50:42 2016 +0100

----------------------------------------------------------------------
 .../LeveledCompactionStrategyTest.java          | 31 ++++++++++++++++----
 1 file changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11de522b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index 1676896,77d2d12..6ed57ba
--- a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@@ -198,13 -196,29 +198,32 @@@ public class LeveledCompactionStrategyT
       */
      private void waitForLeveling(ColumnFamilyStore cfs) throws InterruptedException
      {
-         CompactionStrategyManager strategy = cfs.getCompactionStrategyManager();
-         // L0 is the lowest priority, so when that's done, we know everything is done
-         while (strategy.getSSTableCountPerLevel()[0] > 1)
+         CompactionStrategyManager strategyManager = cfs.getCompactionStrategyManager();
+         while (true)
+         {
+             // since we run several compaction strategies we wait until L0 in all strategies
is empty and
+             // atleast one L1+ is non-empty. In these tests we always run a single data
directory with only unrepaired data
+             // so it should be good enough
+             boolean allL0Empty = true;
+             boolean anyL1NonEmpty = false;
 -            for (AbstractCompactionStrategy strategy : strategyManager.getStrategies())
++            for (List<AbstractCompactionStrategy> strategies : strategyManager.getStrategies())
+             {
 -                if (!(strategy instanceof LeveledCompactionStrategy))
 -                    return;
 -                // note that we check > 1 here, if there is too little data in L0, we
don't compact it up to L1
 -                if (((LeveledCompactionStrategy)strategy).getLevelSize(0) > 1)
 -                    allL0Empty = false;
 -                for (int i = 1; i < 5; i++)
 -                    if (((LeveledCompactionStrategy)strategy).getLevelSize(i) > 0)
 -                        anyL1NonEmpty = true;
++                for (AbstractCompactionStrategy strategy : strategies)
++                {
++                    if (!(strategy instanceof LeveledCompactionStrategy))
++                        return;
++                    // note that we check > 1 here, if there is too little data in L0,
we don't compact it up to L1
++                    if (((LeveledCompactionStrategy)strategy).getLevelSize(0) > 1)
++                        allL0Empty = false;
++                    for (int i = 1; i < 5; i++)
++                        if (((LeveledCompactionStrategy)strategy).getLevelSize(i) > 0)
++                            anyL1NonEmpty = true;
++                }
+             }
+             if (allL0Empty && anyL1NonEmpty)
+                 return;
              Thread.sleep(100);
- 
-         // in AbstractCompationStrategy.replaceSSTables() first we remove and then we add
sstables so wait a little bit longer
-         Thread.sleep(10);
+         }
      }
  
      @Test


Mime
View raw message