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

[1/2] cassandra git commit: Switch references to Refs

Repository: cassandra
Updated Branches:
  refs/heads/trunk 49f1a629d -> 4231b4e2a


Switch references to Refs


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

Branch: refs/heads/trunk
Commit: 2d5d30114107bfb6bb7b6f9571264eef6ad4985f
Parents: e60089d
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Thu Feb 5 16:41:47 2015 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Thu Feb 5 16:41:47 2015 +0300

----------------------------------------------------------------------
 .../org/apache/cassandra/db/SizeEstimatesRecorder.java  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2d5d3011/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java b/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java
index b739ba5..b7e5715 100644
--- a/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java
+++ b/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java
@@ -29,6 +29,7 @@ import org.apache.cassandra.service.MigrationListener;
 import org.apache.cassandra.service.MigrationManager;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.Pair;
+import org.apache.cassandra.utils.concurrent.Refs;
 
 /**
  * A very simplistic/crude partition count/size estimator.
@@ -71,8 +72,13 @@ public class SizeEstimatesRecorder extends MigrationListener implements Runnable
         for (Range<Token> range : localRanges)
         {
             // filter sstables that have partitions in this range.
-            List<SSTableReader> sstables = table.viewFilter(range.toRowBounds()).apply(table.getDataTracker().getView());
-            SSTableReader.acquireReferences(sstables);
+            List<SSTableReader> sstables = null;
+            Refs<SSTableReader> refs = null;
+            while (refs == null)
+            {
+                sstables = table.viewFilter(range.toRowBounds()).apply(table.getDataTracker().getView());
+                refs = Refs.tryRef(sstables);
+            }
 
             long partitionsCount, meanPartitionSize;
             try
@@ -83,7 +89,7 @@ public class SizeEstimatesRecorder extends MigrationListener implements Runnable
             }
             finally
             {
-                SSTableReader.releaseReferences(sstables);
+                refs.release();
             }
 
             estimates.put(range, Pair.create(partitionsCount, meanPartitionSize));


[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

Posted by al...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 4231b4e2a1be2d4f9107090949896f1ebc58e014
Parents: 49f1a62 2d5d301
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Thu Feb 5 16:42:06 2015 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Thu Feb 5 16:42:06 2015 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------