cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [1/3] git commit: Add UNLOGGED, COUNTER options to BATCH docs
Date Wed, 19 Mar 2014 16:43:14 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 a45fea8fc -> 2a2141ce6


Add UNLOGGED, COUNTER options to BATCH docs

patch by Tyler Hobbs; reviewed by Sylvain Lebresne for CASSANDRA-6816


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

Branch: refs/heads/cassandra-2.1
Commit: 7e870018dc2b1b78cf1754056c260c77379d5b47
Parents: 3008532
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Wed Mar 19 11:37:09 2014 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Wed Mar 19 11:37:09 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt          |  1 +
 doc/cql3/CQL.textile | 19 +++++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7e870018/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f88345d..960b0e9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.2.16
+ * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
  * add extra SSL cipher suites (CASSANDRA-6613)
  * fix nodetool getsstables for blob PK (CASSANDRA-6803)
  * Add CMSClassUnloadingEnabled JVM option (CASSANDRA-6541)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7e870018/doc/cql3/CQL.textile
----------------------------------------------------------------------
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index ecd3b7e..91e2625 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -536,7 +536,7 @@ h3(#batchStmt). BATCH
 __Syntax:__
 
 bc(syntax).. 
-<batch-stmt> ::= BEGIN BATCH
+<batch-stmt> ::= BEGIN ( UNLOGGED | COUNTER ) BATCH
                  ( USING <option> ( AND <option> )* )?
                     <modification-stmt> ( ';' <modification-stmt> )*
                  APPLY BATCH
@@ -557,11 +557,22 @@ BEGIN BATCH
   DELETE name FROM users WHERE userid = 'user1';
 APPLY BATCH;
 
-The @BATCH@ statement group multiple modification statements (insertions/updates and deletions)
into a single statement. It mainly serves two purposes:
-# it saves network round-trips between the client and the server (and sometimes between the
server coordinator and the replicas) when batching multiple updates.
-# all updates in a @BATCH@ belonging to a given partition key are performed atomically and
in isolation
+The @BATCH@ statement group multiple modification statements (insertions/updates and deletions)
into a single statement. It serves several purposes:
+# It saves network round-trips between the client and the server (and sometimes between the
server coordinator and the replicas) when batching multiple updates.
+# All updates in a @BATCH@ belonging to a given partition key are performed in isolation.
+# By default, all operations in the batch are performed atomically.  See the notes on "@UNLOGGED@":#unloggedBatch
for more details.
 Note however that the @BATCH@ statement only allows @UPDATE@, @INSERT@ and @DELETE@ statements
and is _not_ a full analogue for SQL transactions.
 
+h4(#unloggedBatch). @UNLOGGED@
+
+By default, Cassandra uses a batch log to ensure all operations in a batch are applied atomically.
(Note that the operations are still only isolated within a single partition.)
+
+There is a performance penalty for batch atomicity when a batch spans multiple partitions.
If you do not want to incur this penalty, you can tell Cassandra to skip the batchlog with
the @UNLOGGED@ option. If the @UNLOGGED@ option is used, operations are only atomic within
a single partition.
+
+h4(#counterBatch). @COUNTER@
+
+Use the @COUNTER@ option for batched counter updates.  Unlike other updates in Cassandra,
counter updates are not idempotent.
+
 h4(#batchOptions). @<option>@
 
 @BATCH@ supports both the @TIMESTAMP@ option, with similar semantic to the one described
in the "@UPDATE@":#updateOptions statement (the timestamp applies to all the statement inside
the batch). However, if used, @TIMESTAMP@ *must not* be used in the statements within the
batch.


Mime
View raw message