cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/4] git commit: reduce garbage creation in calculatePendingRanges
Date Thu, 08 May 2014 01:24:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk e48a00b6d -> 67ed3375b


reduce garbage creation in calculatePendingRanges

patch by dbrosius reviewed by bwilliams for cassandra-7191


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

Branch: refs/heads/trunk
Commit: d839350f42405ccd85ff478bd13bad9920522dee
Parents: 21b3a67
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Wed May 7 21:17:48 2014 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Wed May 7 21:17:48 2014 -0400

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 .../cassandra/service/PendingRangeCalculatorService.java       | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d839350f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8533e64..312cf06 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -22,6 +22,7 @@
  * fix time conversion to milliseconds in SimpleCondition.await (CASSANDRA-7149)
  * remove duplicate query for local tokens (CASSANDRA-7182)
  * raise streaming phi convict threshold level (CASSANDRA-7063)
+ * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
 
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d839350f/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
index b408c75..6f77ace 100644
--- a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
+++ b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
@@ -43,7 +43,6 @@ import java.util.Set;
 import java.util.Collection;
 import java.util.concurrent.*;
 
-
 public class PendingRangeCalculatorService extends PendingRangeCalculatorServiceMBean
 {
     public static final PendingRangeCalculatorService instance = new PendingRangeCalculatorService();
@@ -157,9 +156,10 @@ public class PendingRangeCalculatorService extends PendingRangeCalculatorService
 
         // For each of the bootstrapping nodes, simply add and remove them one by one to
         // allLeftMetadata and check in between what their ranges would be.
-        for (InetAddress endpoint : bootstrapTokens.inverse().keySet())
+        Multimap<InetAddress, Token> bootstrapAddresses = bootstrapTokens.inverse();
+        for (InetAddress endpoint : bootstrapAddresses.keySet())
         {
-            Collection<Token> tokens = bootstrapTokens.inverse().get(endpoint);
+            Collection<Token> tokens = bootstrapAddresses.get(endpoint);
 
             allLeftMetadata.updateNormalTokens(tokens, endpoint);
             for (Range<Token> range : strategy.getAddressRanges(allLeftMetadata).get(endpoint))


Mime
View raw message