cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject cassandra git commit: Don't use RangeFetchMapCalculator when RF=1
Date Thu, 17 Aug 2017 14:40:37 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 22b2a82f7 -> 4f5bf0b67


Don't use RangeFetchMapCalculator when RF=1

Patch by marcuse; reviewed by Alex Petrov for CASSANDRA-13576


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

Branch: refs/heads/trunk
Commit: 4f5bf0b67d2e0a93595cc8061018b20aa2309566
Parents: 22b2a82
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Aug 14 18:10:01 2017 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Aug 17 16:39:17 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                          | 1 +
 src/java/org/apache/cassandra/dht/RangeStreamer.java | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f5bf0b6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2961a1d..c0a8067 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0
+ * Don't use RangeFetchMapCalculator when RF=1 (CASSANDRA-13576)
  * Don't optimise trivial ranges in RangeFetchMapCalculator (CASSANDRA-13664)
  * Use an ExecutorService for repair commands instead of new Thread(..).start() (CASSANDRA-13594)
  * Fix race / ref leak in anticompaction (CASSANDRA-13688)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f5bf0b6/src/java/org/apache/cassandra/dht/RangeStreamer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/RangeStreamer.java b/src/java/org/apache/cassandra/dht/RangeStreamer.java
index 134ed13..eabb212 100644
--- a/src/java/org/apache/cassandra/dht/RangeStreamer.java
+++ b/src/java/org/apache/cassandra/dht/RangeStreamer.java
@@ -192,9 +192,10 @@ public class RangeStreamer
         for (Map.Entry<Range<Token>, InetAddress> entry : rangesForKeyspace.entries())
             logger.info("{}: range {} exists on {} for keyspace {}", description, entry.getKey(),
entry.getValue(), keyspaceName);
 
-
-        Multimap<InetAddress, Range<Token>> rangeFetchMap = useStrictSource ?
getRangeFetchMap(rangesForKeyspace, sourceFilters, keyspaceName, useStrictConsistency) :
-                getOptimizedRangeFetchMap(rangesForKeyspace, sourceFilters, keyspaceName);
+        AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy();
+        Multimap<InetAddress, Range<Token>> rangeFetchMap = useStrictSource ||
strat == null || strat.getReplicationFactor() == 1
+                                                            ? getRangeFetchMap(rangesForKeyspace,
sourceFilters, keyspaceName, useStrictConsistency)
+                                                            : getOptimizedRangeFetchMap(rangesForKeyspace,
sourceFilters, keyspaceName);
 
         for (Map.Entry<InetAddress, Collection<Range<Token>>> entry : rangeFetchMap.asMap().entrySet())
         {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message