Repository: cassandra Updated Branches: refs/heads/trunk b74c2ade5 -> 67b852182
Properly use the paxos consistency for (non-protocol) batches patch by slebresne; reviewed by jbellis for CASSANDRA-6837 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9527b17f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9527b17f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9527b17f Branch: refs/heads/trunk Commit: 9527b17f1f1eaa572b036ce2c33300b36fc533e6 Parents: 245038f Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Mon Mar 17 11:01:28 2014 +0100 Committer: Sylvain Lebresne <sylv...@datastax.com> Committed: Mon Mar 17 11:01:28 2014 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/statements/BatchStatement.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9527b17f/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 61b1ee1..c4e1bd4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,7 @@ * Fix CompactionManager.needsCleanup (CASSANDRA-6845) * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779) * Read message id as string from earlier versions (CASSANDRA-6840) + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837) Merged from 1.2: * fix nodetool getsstables for blob PK (CASSANDRA-6803) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9527b17f/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java index b1dbb31..675ce7a 100644 --- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java @@ -181,7 +181,7 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache if (options.getConsistency() == null) throw new InvalidRequestException("Invalid empty consistency level"); - return execute(new PreparedBatchVariables(options.getValues()), false, options.getConsistency(), queryState.getTimestamp()); + return execute(new PreparedBatchVariables(options.getValues()), false, options.getConsistency(), options.getSerialConsistency(), queryState.getTimestamp()); } public ResultMessage executeWithPerStatementVariables(ConsistencyLevel cl, QueryState queryState, List<List<ByteBuffer>> variables) throws RequestExecutionException, RequestValidationException @@ -189,16 +189,16 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache if (cl == null) throw new InvalidRequestException("Invalid empty consistency level"); - return execute(new BatchOfPreparedVariables(variables), false, cl, queryState.getTimestamp()); + return execute(new BatchOfPreparedVariables(variables), false, cl, ConsistencyLevel.SERIAL, queryState.getTimestamp()); } - public ResultMessage execute(BatchVariables variables, boolean local, ConsistencyLevel cl, long now) + public ResultMessage execute(BatchVariables variables, boolean local, ConsistencyLevel cl, ConsistencyLevel serialCl, long now) throws RequestExecutionException, RequestValidationException { // TODO: we don't support a serial consistency for batches in the protocol so defaulting to SERIAL for now. // We'll need to fix that. if (hasConditions) - return executeWithConditions(variables, cl, ConsistencyLevel.SERIAL, now); + return executeWithConditions(variables, cl, serialCl, now); executeWithoutConditions(getMutations(variables, local, cl, now), cl); return null;