From 47f4c02caa74d2210194c679043aa350e5349f7e Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Tue, 28 Dec 2010 19:13:32 +0000 Subject: [PATCH] allow [LOCAL|EACH]_QUORUM to be used with non-NetworkTopology Strategies patch by jbellis git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1053409 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../locator/AbstractReplicationStrategy.java | 4 ++++ .../cassandra/locator/NetworkTopologyStrategy.java | 14 -------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f6912b36c4..2bdeadb430 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,8 @@ dev * count timeouts towards dynamicsnitch latencies (CASSANDRA-1905) * Expose index-building status in JMX + cli schema description (CASSANDRA-1871) + * allow [LOCAL|EACH]_QUORUM to be used with non-NetworkTopology + replication Strategies 0.7.0-rc3 diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java index 36e8702a17..c4e58dc6f6 100644 --- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java +++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java @@ -224,6 +224,10 @@ public abstract class AbstractReplicationStrategy public QuorumResponseHandler getQuorumResponseHandler(IResponseResolver responseResolver, ConsistencyLevel consistencyLevel) { + if (consistencyLevel.equals(ConsistencyLevel.LOCAL_QUORUM) || consistencyLevel.equals(ConsistencyLevel.EACH_QUORUM)) + { + return new DatacenterQuorumResponseHandler(responseResolver, consistencyLevel, table); + } return new QuorumResponseHandler(responseResolver, consistencyLevel, table); } diff --git a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java index 9bd6214f80..0545f6c54e 100644 --- a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java +++ b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java @@ -164,18 +164,4 @@ public class NetworkTopologyStrategy extends AbstractReplicationStrategy } return super.getWriteResponseHandler(writeEndpoints, hintedEndpoints, consistency_level); } - - /** - * This method will generate the WRH object and returns. If the Consistency - * level is LOCAL_QUORUM/EACH_QUORUM then it will return a DCQRH. - */ - @Override - public QuorumResponseHandler getQuorumResponseHandler(IResponseResolver responseResolver, ConsistencyLevel consistencyLevel) - { - if (consistencyLevel.equals(ConsistencyLevel.LOCAL_QUORUM) || consistencyLevel.equals(ConsistencyLevel.EACH_QUORUM)) - { - return new DatacenterQuorumResponseHandler(responseResolver, consistencyLevel, table); - } - return super.getQuorumResponseHandler(responseResolver, consistencyLevel); - } }