Updated Branches: refs/heads/cassandra-2.0 b4020979c -> 0e9906e6d
Allow LOCAL_ONE/LOCAL_QUORUM to work with SimpleStrategy patch by Alex Liu; reviewed by jasobrown for CASSANDRA-6238 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e5715f4e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e5715f4e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e5715f4e Branch: refs/heads/cassandra-2.0 Commit: e5715f4e9618e933fca4d4537ff84fd4ee24a641 Parents: 8c24044 Author: Jason Brown <jasedbr...@gmail.com> Authored: Wed Nov 6 22:02:49 2013 -0800 Committer: Jason Brown <jasedbr...@gmail.com> Committed: Wed Nov 6 22:02:49 2013 -0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/db/ConsistencyLevel.java | 14 ++------------ 2 files changed, 3 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e5715f4e/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index eab185a..d27c495 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,7 @@ * make calculatePendingRanges asynchronous (CASSANDRA-6244) * Remove blocking flushes in gossip thread (CASSANDRA-6297) * Fix potential socket leak in connectionpool creation (CASSANDRA-6308) + * Allow LOCAL_ONE/LOCAL_QUORUM to work with SimpleSrrategy (CASSANDRA-6238) 1.2.11 http://git-wip-us.apache.org/repos/asf/cassandra/blob/e5715f4e/src/java/org/apache/cassandra/db/ConsistencyLevel.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/ConsistencyLevel.java b/src/java/org/apache/cassandra/db/ConsistencyLevel.java index 1ce019b..25fb25b 100644 --- a/src/java/org/apache/cassandra/db/ConsistencyLevel.java +++ b/src/java/org/apache/cassandra/db/ConsistencyLevel.java @@ -275,10 +275,6 @@ public enum ConsistencyLevel { case ANY: throw new InvalidRequestException("ANY ConsistencyLevel is only supported for writes"); - case LOCAL_QUORUM: - case LOCAL_ONE: - requireNetworkTopologyStrategy(table); - break; case EACH_QUORUM: throw new InvalidRequestException("EACH_QUORUM ConsistencyLevel is only supported for writes"); } @@ -286,14 +282,8 @@ public enum ConsistencyLevel public void validateForWrite(String table) throws InvalidRequestException { - switch (this) - { - case LOCAL_QUORUM: - case EACH_QUORUM: - case LOCAL_ONE: - requireNetworkTopologyStrategy(table); - break; - } + if(this == EACH_QUORUM) + requireNetworkTopologyStrategy(table); } public void validateCounterForWrite(CFMetaData metadata) throws InvalidRequestException