You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2015/07/28 17:00:24 UTC

cassandra git commit: fix build

Repository: cassandra
Updated Branches:
  refs/heads/trunk a7f41345a -> 3879bfd1e


fix build


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

Branch: refs/heads/trunk
Commit: 3879bfd1ebe41c3e503928cb74fc58b56f62183e
Parents: a7f4134
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Tue Jul 28 16:00:05 2015 +0100
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Tue Jul 28 16:00:05 2015 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/lifecycle/View.java    | 10 ++++++++++
 src/java/org/apache/cassandra/utils/concurrent/Ref.java |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3879bfd1/src/java/org/apache/cassandra/db/lifecycle/View.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/lifecycle/View.java b/src/java/org/apache/cassandra/db/lifecycle/View.java
index 324dbc1..75590fa 100644
--- a/src/java/org/apache/cassandra/db/lifecycle/View.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/View.java
@@ -19,6 +19,7 @@ package org.apache.cassandra.db.lifecycle;
 
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
 import com.google.common.base.Functions;
 import com.google.common.base.Predicate;
@@ -41,6 +42,7 @@ import static com.google.common.collect.Iterables.filter;
 import static com.google.common.collect.Iterables.transform;
 import static java.util.Collections.singleton;
 import static org.apache.cassandra.db.lifecycle.Helpers.emptySet;
+import static org.apache.cassandra.db.lifecycle.Helpers.filterOut;
 import static org.apache.cassandra.db.lifecycle.Helpers.replace;
 
 /**
@@ -124,6 +126,14 @@ public class View
         return select(sstableSet, filter(sstables, filter));
     }
 
+    // any sstable known by this tracker in any form; we have a special method here since it's only used for testing/debug
+    // (strong leak detection), and it does not follow the normal pattern
+    @VisibleForTesting
+    public Iterable<SSTableReader> allKnownSSTables()
+    {
+        return Iterables.concat(sstables, filterOut(compacting, sstables));
+    }
+
     private Iterable<SSTableReader> select(SSTableSet sstableSet, Iterable<SSTableReader> sstables)
     {
         switch (sstableSet)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3879bfd1/src/java/org/apache/cassandra/utils/concurrent/Ref.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/concurrent/Ref.java b/src/java/org/apache/cassandra/utils/concurrent/Ref.java
index 522caca..92c1a0c 100644
--- a/src/java/org/apache/cassandra/utils/concurrent/Ref.java
+++ b/src/java/org/apache/cassandra/utils/concurrent/Ref.java
@@ -498,7 +498,7 @@ public final class Ref<T> implements RefCounted<T>
                 for (ColumnFamilyStore cfs : ks.getColumnFamilyStores())
                 {
                     View view = cfs.getTracker().getView();
-                    for (SSTableReader reader : Iterables.concat(view.sstables, view.compacting))
+                    for (SSTableReader reader : view.allKnownSSTables())
                         reader.addTo(expected);
                 }
             }