[03/14] cassandra git commit: Improve digest calculation in the presence of overlapping tombstones.

2016-07-05 Thread slebresne
Improve digest calculation in the presence of overlapping tombstones.

Patch by Branimir Lambov; reviewed by Sylvain Lebresne for
CASSANDRA-11349

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

Branch: refs/heads/cassandra-3.0
Commit: 408066c57a66e0d5a6691af1695742ef49786bf2
Parents: 40b18d5
Author: Branimir Lambov 
Authored: Thu May 5 16:20:52 2016 +0300
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:17:37 2016 +0200

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/db/ColumnIndex.java| 12 +--
 .../org/apache/cassandra/db/OnDiskAtom.java |  8 +++-
 .../org/apache/cassandra/db/RangeTombstone.java |  6 +++---
 .../db/compaction/LazilyCompactedRow.java   | 21 
 5 files changed, 38 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 3aa5ea9..33014d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 2.1.16
  * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
+ * Improve digest calculation in the presence of overlapping tombstones 
(CASSANDRA-11349)
 
 2.1.15
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/ColumnIndex.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnIndex.java 
b/src/java/org/apache/cassandra/db/ColumnIndex.java
index f63dfe1..8f147cc 100644
--- a/src/java/org/apache/cassandra/db/ColumnIndex.java
+++ b/src/java/org/apache/cassandra/db/ColumnIndex.java
@@ -68,12 +68,20 @@ public class ColumnIndex
 private final ByteBuffer key;
 private final DeletionInfo deletionInfo; // only used for serializing 
and calculating row header size
 
-private final OnDiskAtom.Serializer atomSerializer;
+private final OnDiskAtom.SerializerForWriting atomSerializer;
 
 public Builder(ColumnFamily cf,
ByteBuffer key,
DataOutputPlus output)
 {
+this(cf, key, output, cf.getComparator().onDiskAtomSerializer());
+}
+
+public Builder(ColumnFamily cf,
+ByteBuffer key,
+DataOutputPlus output,
+OnDiskAtom.SerializerForWriting serializer)
+{
 assert cf != null;
 assert key != null;
 assert output != null;
@@ -84,7 +92,7 @@ public class ColumnIndex
 this.result = new ColumnIndex(new 
ArrayList());
 this.output = output;
 this.tombstoneTracker = new 
RangeTombstone.Tracker(cf.getComparator());
-this.atomSerializer = cf.getComparator().onDiskAtomSerializer();
+this.atomSerializer = serializer;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/OnDiskAtom.java
--
diff --git a/src/java/org/apache/cassandra/db/OnDiskAtom.java 
b/src/java/org/apache/cassandra/db/OnDiskAtom.java
index b53e43b..3e768ea 100644
--- a/src/java/org/apache/cassandra/db/OnDiskAtom.java
+++ b/src/java/org/apache/cassandra/db/OnDiskAtom.java
@@ -43,7 +43,13 @@ public interface OnDiskAtom
 public void validateFields(CFMetaData metadata) throws MarshalException;
 public void updateDigest(MessageDigest digest);
 
-public static class Serializer implements ISSTableSerializer
+public interface SerializerForWriting
+{
+public void serializeForSSTable(OnDiskAtom atom, DataOutputPlus out) 
throws IOException;
+public long serializedSizeForSSTable(OnDiskAtom atom);
+}
+
+public static class Serializer implements ISSTableSerializer, 
SerializerForWriting
 {
 private final CellNameType type;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/RangeTombstone.java
--
diff --git a/src/java/org/apache/cassandra/db/RangeTombstone.java 
b/src/java/org/apache/cassandra/db/RangeTombstone.java
index 5e41792..9dc2723 100644
--- a/src/java/org/apache/cassandra/db/RangeTombstone.java
+++ b/src/java/org/apache/cassandra/db/RangeTombstone.java
@@ -152,7 +152,7 @@ public class RangeTombstone extends 

[10/14] cassandra git commit: Merge commit '9199a29f6f3394abb75840234474fe858fb644b7' into cassandra-3.0

2016-07-05 Thread slebresne
Merge commit '9199a29f6f3394abb75840234474fe858fb644b7' into cassandra-3.0

* commit '9199a29f6f3394abb75840234474fe858fb644b7':
  Improve digest calculation in the presence of overlapping tombstones.


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

Branch: refs/heads/cassandra-3.0
Commit: d95d8a915ba7f175d3cc764636e0f17b29d17a7e
Parents: 9244531 9199a29
Author: Sylvain Lebresne 
Authored: Tue Jul 5 11:23:13 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:23:13 2016 +0200

--

--




[12/14] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.9

2016-07-05 Thread slebresne
Merge branch 'cassandra-3.0' into cassandra-3.9

* cassandra-3.0:
  Improve digest calculation in the presence of overlapping tombstones.


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

Branch: refs/heads/cassandra-3.9
Commit: f8cf5b5b6f82c6de562644cfc5dee2c97aa2cc32
Parents: cb0d1ca d95d8a9
Author: Sylvain Lebresne 
Authored: Tue Jul 5 11:23:32 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:23:32 2016 +0200

--

--




[14/14] cassandra git commit: Merge branch 'cassandra-3.9' into trunk

2016-07-05 Thread slebresne
Merge branch 'cassandra-3.9' into trunk

* cassandra-3.9:
  Improve digest calculation in the presence of overlapping tombstones.


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

Branch: refs/heads/trunk
Commit: b2f036a15992884e5180e61e0efef8ba78f23ef3
Parents: 5d8d489 f8cf5b5
Author: Sylvain Lebresne 
Authored: Tue Jul 5 11:23:51 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:23:51 2016 +0200

--

--




[01/14] cassandra git commit: Improve digest calculation in the presence of overlapping tombstones.

2016-07-05 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 e06dae81f -> 9199a29f6
  refs/heads/cassandra-3.0 9244531ab -> d95d8a915
  refs/heads/cassandra-3.9 cb0d1ca45 -> f8cf5b5b6
  refs/heads/trunk 5d8d4893b -> b2f036a15


Improve digest calculation in the presence of overlapping tombstones.

Patch by Branimir Lambov; reviewed by Sylvain Lebresne for
CASSANDRA-11349

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

Branch: refs/heads/cassandra-2.2
Commit: 408066c57a66e0d5a6691af1695742ef49786bf2
Parents: 40b18d5
Author: Branimir Lambov 
Authored: Thu May 5 16:20:52 2016 +0300
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:17:37 2016 +0200

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/db/ColumnIndex.java| 12 +--
 .../org/apache/cassandra/db/OnDiskAtom.java |  8 +++-
 .../org/apache/cassandra/db/RangeTombstone.java |  6 +++---
 .../db/compaction/LazilyCompactedRow.java   | 21 
 5 files changed, 38 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 3aa5ea9..33014d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 2.1.16
  * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
+ * Improve digest calculation in the presence of overlapping tombstones 
(CASSANDRA-11349)
 
 2.1.15
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/ColumnIndex.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnIndex.java 
b/src/java/org/apache/cassandra/db/ColumnIndex.java
index f63dfe1..8f147cc 100644
--- a/src/java/org/apache/cassandra/db/ColumnIndex.java
+++ b/src/java/org/apache/cassandra/db/ColumnIndex.java
@@ -68,12 +68,20 @@ public class ColumnIndex
 private final ByteBuffer key;
 private final DeletionInfo deletionInfo; // only used for serializing 
and calculating row header size
 
-private final OnDiskAtom.Serializer atomSerializer;
+private final OnDiskAtom.SerializerForWriting atomSerializer;
 
 public Builder(ColumnFamily cf,
ByteBuffer key,
DataOutputPlus output)
 {
+this(cf, key, output, cf.getComparator().onDiskAtomSerializer());
+}
+
+public Builder(ColumnFamily cf,
+ByteBuffer key,
+DataOutputPlus output,
+OnDiskAtom.SerializerForWriting serializer)
+{
 assert cf != null;
 assert key != null;
 assert output != null;
@@ -84,7 +92,7 @@ public class ColumnIndex
 this.result = new ColumnIndex(new 
ArrayList());
 this.output = output;
 this.tombstoneTracker = new 
RangeTombstone.Tracker(cf.getComparator());
-this.atomSerializer = cf.getComparator().onDiskAtomSerializer();
+this.atomSerializer = serializer;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/OnDiskAtom.java
--
diff --git a/src/java/org/apache/cassandra/db/OnDiskAtom.java 
b/src/java/org/apache/cassandra/db/OnDiskAtom.java
index b53e43b..3e768ea 100644
--- a/src/java/org/apache/cassandra/db/OnDiskAtom.java
+++ b/src/java/org/apache/cassandra/db/OnDiskAtom.java
@@ -43,7 +43,13 @@ public interface OnDiskAtom
 public void validateFields(CFMetaData metadata) throws MarshalException;
 public void updateDigest(MessageDigest digest);
 
-public static class Serializer implements ISSTableSerializer
+public interface SerializerForWriting
+{
+public void serializeForSSTable(OnDiskAtom atom, DataOutputPlus out) 
throws IOException;
+public long serializedSizeForSSTable(OnDiskAtom atom);
+}
+
+public static class Serializer implements ISSTableSerializer, 
SerializerForWriting
 {
 private final CellNameType type;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408066c5/src/java/org/apache/cassandra/db/RangeTombstone.java
--
diff --git a/src/java/org/apache/cassandra/db/RangeTombstone.java 

[06/14] cassandra git commit: Merge commit '408066c57a66e0d5a6691af1695742ef49786bf2' into cassandra-2.2

2016-07-05 Thread slebresne
Merge commit '408066c57a66e0d5a6691af1695742ef49786bf2' into cassandra-2.2

* commit '408066c57a66e0d5a6691af1695742ef49786bf2':
  Improve digest calculation in the presence of overlapping tombstones.


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

Branch: refs/heads/cassandra-2.2
Commit: 9199a29f6f3394abb75840234474fe858fb644b7
Parents: e06dae8 408066c
Author: Sylvain Lebresne 
Authored: Tue Jul 5 11:21:48 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:22:36 2016 +0200

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/db/ColumnIndex.java| 12 +--
 .../org/apache/cassandra/db/OnDiskAtom.java |  8 ++-
 .../org/apache/cassandra/db/RangeTombstone.java |  6 +++---
 .../db/compaction/LazilyCompactedRow.java   | 22 
 5 files changed, 39 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9199a29f/CHANGES.txt
--
diff --cc CHANGES.txt
index 451575c,33014d5..65c7c1f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,42 -1,9 +1,43 @@@
 -2.1.16
 - * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
 +2.2.8
 + * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 +Merged from 2.1:
+  * Improve digest calculation in the presence of overlapping tombstones 
(CASSANDRA-11349)
 -
 -2.1.15
 + * Fix filtering on clustering columns when 2i is used (CASSANDRA-11907)
   * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
 +
 +
 +2.2.7
 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
   * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
   * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
   * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9199a29f/src/java/org/apache/cassandra/db/OnDiskAtom.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9199a29f/src/java/org/apache/cassandra/db/RangeTombstone.java

[09/14] cassandra git commit: Merge commit '9199a29f6f3394abb75840234474fe858fb644b7' into cassandra-3.0

2016-07-05 Thread slebresne
Merge commit '9199a29f6f3394abb75840234474fe858fb644b7' into cassandra-3.0

* commit '9199a29f6f3394abb75840234474fe858fb644b7':
  Improve digest calculation in the presence of overlapping tombstones.


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

Branch: refs/heads/cassandra-3.9
Commit: d95d8a915ba7f175d3cc764636e0f17b29d17a7e
Parents: 9244531 9199a29
Author: Sylvain Lebresne 
Authored: Tue Jul 5 11:23:13 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jul 5 11:23:13 2016 +0200

--

--




[3/3] cassandra git commit: Merge commit '40b18d5' into cassandra-2.2

2016-06-30 Thread slebresne
Merge commit '40b18d5' into cassandra-2.2

* commit '40b18d5':
  Fix changelog (2.1.15 is frozen)


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

Branch: refs/heads/cassandra-2.2
Commit: fdee942ba646e01227b60479bb7da31b6689fd32
Parents: f4288f4 40b18d5
Author: Sylvain Lebresne 
Authored: Thu Jun 30 17:10:41 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 17:10:41 2016 +0200

--

--




[1/3] cassandra git commit: Fix changelog (2.1.15 is frozen)

2016-06-30 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 fda3d8ee2 -> 40b18d574
  refs/heads/cassandra-2.2 f4288f402 -> fdee942ba


Fix changelog (2.1.15 is frozen)


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

Branch: refs/heads/cassandra-2.1
Commit: 40b18d57465d9cdbb9e5c633ffb5fdf0a8c164cf
Parents: fda3d8e
Author: Sylvain Lebresne 
Authored: Thu Jun 30 17:10:15 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 17:10:15 2016 +0200

--
 CHANGES.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/40b18d57/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 02afcc2..3aa5ea9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
-2.1.15
+2.1.16
  * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
+
+2.1.15
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)



[2/3] cassandra git commit: Fix changelog (2.1.15 is frozen)

2016-06-30 Thread slebresne
Fix changelog (2.1.15 is frozen)


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

Branch: refs/heads/cassandra-2.2
Commit: 40b18d57465d9cdbb9e5c633ffb5fdf0a8c164cf
Parents: fda3d8e
Author: Sylvain Lebresne 
Authored: Thu Jun 30 17:10:15 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 17:10:15 2016 +0200

--
 CHANGES.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/40b18d57/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 02afcc2..3aa5ea9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
-2.1.15
+2.1.16
  * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
+
+2.1.15
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)



[1/3] cassandra git commit: Reduce contention getting instances of CompositeType

2016-06-30 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 5a9820d4a -> fda3d8ee2
  refs/heads/cassandra-2.2 f72927e8e -> f4288f402


Reduce contention getting instances of CompositeType

patch by schlosna; reviewed by slebresne for CASSANDRA-10433


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

Branch: refs/heads/cassandra-2.1
Commit: fda3d8ee25adc4837bb5754f718062e522c04788
Parents: 5a9820d
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Thu Oct 15 09:50:40 2015 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 30 17:06:24 2016 +0200

--
 CHANGES.txt |  1 +
 .../cassandra/db/marshal/CompositeType.java | 20 
 2 files changed, 13 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fda3d8ee/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 354a1c2..02afcc2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fda3d8ee/src/java/org/apache/cassandra/db/marshal/CompositeType.java
--
diff --git a/src/java/org/apache/cassandra/db/marshal/CompositeType.java 
b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
index f8ac22d..d25336d 100644
--- a/src/java/org/apache/cassandra/db/marshal/CompositeType.java
+++ b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
@@ -19,18 +19,18 @@ package org.apache.cassandra.db.marshal;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.util.Arrays;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import com.google.common.collect.ImmutableList;
 
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.cql3.ColumnIdentifier;
 import org.apache.cassandra.cql3.Operator;
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.serializers.MarshalException;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -67,7 +67,7 @@ public class CompositeType extends AbstractCompositeType
 public final List<AbstractType> types;
 
 // interning instances
-private static final Map<List<AbstractType>, CompositeType> instances = 
new HashMap<List<AbstractType>, CompositeType>();
+private static final ConcurrentMap<List<AbstractType>, CompositeType> 
instances = new ConcurrentHashMap<List<AbstractType>, CompositeType>();
 
 public static CompositeType getInstance(TypeParser parser) throws 
ConfigurationException, SyntaxException
 {
@@ -97,7 +97,7 @@ public class CompositeType extends AbstractCompositeType
 return true;
 }
 
-public static synchronized CompositeType getInstance(List<AbstractType> 
types)
+public static CompositeType getInstance(List<AbstractType> types)
 {
 assert types != null && !types.isEmpty();
 
@@ -105,7 +105,11 @@ public class CompositeType extends AbstractCompositeType
 if (ct == null)
 {
 ct = new CompositeType(types);
-instances.put(types, ct);
+CompositeType previous = instances.putIfAbsent(types, ct);
+if (previous != null)
+{
+ct = previous;
+}
 }
 return ct;
 }



[2/3] cassandra git commit: Reduce contention getting instances of CompositeType

2016-06-30 Thread slebresne
Reduce contention getting instances of CompositeType

patch by schlosna; reviewed by slebresne for CASSANDRA-10433


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

Branch: refs/heads/cassandra-2.2
Commit: fda3d8ee25adc4837bb5754f718062e522c04788
Parents: 5a9820d
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Thu Oct 15 09:50:40 2015 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 30 17:06:24 2016 +0200

--
 CHANGES.txt |  1 +
 .../cassandra/db/marshal/CompositeType.java | 20 
 2 files changed, 13 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fda3d8ee/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 354a1c2..02afcc2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
  * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fda3d8ee/src/java/org/apache/cassandra/db/marshal/CompositeType.java
--
diff --git a/src/java/org/apache/cassandra/db/marshal/CompositeType.java 
b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
index f8ac22d..d25336d 100644
--- a/src/java/org/apache/cassandra/db/marshal/CompositeType.java
+++ b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
@@ -19,18 +19,18 @@ package org.apache.cassandra.db.marshal;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.util.Arrays;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import com.google.common.collect.ImmutableList;
 
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.cql3.ColumnIdentifier;
 import org.apache.cassandra.cql3.Operator;
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.serializers.MarshalException;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -67,7 +67,7 @@ public class CompositeType extends AbstractCompositeType
 public final List<AbstractType> types;
 
 // interning instances
-private static final Map<List<AbstractType>, CompositeType> instances = 
new HashMap<List<AbstractType>, CompositeType>();
+private static final ConcurrentMap<List<AbstractType>, CompositeType> 
instances = new ConcurrentHashMap<List<AbstractType>, CompositeType>();
 
 public static CompositeType getInstance(TypeParser parser) throws 
ConfigurationException, SyntaxException
 {
@@ -97,7 +97,7 @@ public class CompositeType extends AbstractCompositeType
 return true;
 }
 
-public static synchronized CompositeType getInstance(List<AbstractType> 
types)
+public static CompositeType getInstance(List<AbstractType> types)
 {
 assert types != null && !types.isEmpty();
 
@@ -105,7 +105,11 @@ public class CompositeType extends AbstractCompositeType
 if (ct == null)
 {
 ct = new CompositeType(types);
-instances.put(types, ct);
+CompositeType previous = instances.putIfAbsent(types, ct);
+if (previous != null)
+{
+ct = previous;
+}
 }
 return ct;
 }



[3/3] cassandra git commit: Merge commit 'fda3d8ee25adc4837bb5754f718062e522c04788' into cassandra-2.2

2016-06-30 Thread slebresne
Merge commit 'fda3d8ee25adc4837bb5754f718062e522c04788' into cassandra-2.2

* commit 'fda3d8ee25adc4837bb5754f718062e522c04788':
  Reduce contention getting instances of CompositeType


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

Branch: refs/heads/cassandra-2.2
Commit: f4288f40265a11cec34dd8ba0d727bc87dc3f6d2
Parents: f72927e fda3d8e
Author: Sylvain Lebresne 
Authored: Thu Jun 30 17:08:17 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 17:08:17 2016 +0200

--

--




[1/6] cassandra git commit: Exclude static columns from digest on empty static row

2016-06-30 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 b23fcc2cd -> 4f14bc50d
  refs/heads/cassandra-3.9 2df345af0 -> 3dceaaba8
  refs/heads/trunk db174f31c -> c7f4600be


Exclude static columns from digest on empty static row

patch by Tommy Stendahl; reviewed by Sylvain Lebresne for CASSANDRA-12090


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

Branch: refs/heads/cassandra-3.0
Commit: 4f14bc50d9037e01e709a925465d195eec4ab6df
Parents: b23fcc2
Author: Sylvain Lebresne 
Authored: Thu Jun 30 13:38:36 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:51:25 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 573f704..f12d704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
  * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/PartitionColumns.java
--
diff --git a/src/java/org/apache/cassandra/db/PartitionColumns.java 
b/src/java/org/apache/cassandra/db/PartitionColumns.java
index 93204f4..bf4ac43 100644
--- a/src/java/org/apache/cassandra/db/PartitionColumns.java
+++ b/src/java/org/apache/cassandra/db/PartitionColumns.java
@@ -18,7 +18,6 @@
 package org.apache.cassandra.db;
 
 import java.util.*;
-import java.security.MessageDigest;
 
 import com.google.common.collect.Iterators;
 
@@ -136,12 +135,6 @@ public class PartitionColumns implements 
Iterable
 return Objects.hash(statics, regulars);
 }
 
-public void digest(MessageDigest digest)
-{
-regulars.digest(digest);
-statics.digest(digest);
-}
-
 public static Builder builder()
 {
 return new Builder();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
--
diff --git 
a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java 
b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
index cc90c40..9b7d7eb 100644
--- a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
+++ b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
@@ -78,17 +78,6 @@ public abstract class PartitionIterators
 return MorePartitions.extend(iterators.get(0), new Extend());
 }
 
-public static void digest(PartitionIterator iterator, MessageDigest digest)
-{
-while (iterator.hasNext())
-{
-try (RowIterator partition = iterator.next())
-{
-RowIterators.digest(partition, digest);
-}
-}
-}
-
 public static PartitionIterator singletonIterator(RowIterator iterator)
 {
 return new SingletonPartitionIterator(iterator);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/rows/RowIterators.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/RowIterators.java 
b/src/java/org/apache/cassandra/db/rows/RowIterators.java
index 551edb8..ae051c0 100644
--- a/src/java/org/apache/cassandra/db/rows/RowIterators.java
+++ b/src/java/org/apache/cassandra/db/rows/RowIterators.java
@@ -37,10 +37,13 @@ public abstract class RowIterators
 
 public static void digest(RowIterator iterator, MessageDigest digest)
 {
-// TODO: we're not computing digest the same way that old nodes so 
we'll need
-// to pass the version we're computing the digest for and deal with 
that.
+// TODO: we're not computing digest the same way that old nodes. This 
is
+// currently ok as this is only used for schema digest 

[3/6] cassandra git commit: Exclude static columns from digest on empty static row

2016-06-30 Thread slebresne
Exclude static columns from digest on empty static row

patch by Tommy Stendahl; reviewed by Sylvain Lebresne for CASSANDRA-12090


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

Branch: refs/heads/trunk
Commit: 4f14bc50d9037e01e709a925465d195eec4ab6df
Parents: b23fcc2
Author: Sylvain Lebresne 
Authored: Thu Jun 30 13:38:36 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:51:25 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 573f704..f12d704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
  * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/PartitionColumns.java
--
diff --git a/src/java/org/apache/cassandra/db/PartitionColumns.java 
b/src/java/org/apache/cassandra/db/PartitionColumns.java
index 93204f4..bf4ac43 100644
--- a/src/java/org/apache/cassandra/db/PartitionColumns.java
+++ b/src/java/org/apache/cassandra/db/PartitionColumns.java
@@ -18,7 +18,6 @@
 package org.apache.cassandra.db;
 
 import java.util.*;
-import java.security.MessageDigest;
 
 import com.google.common.collect.Iterators;
 
@@ -136,12 +135,6 @@ public class PartitionColumns implements 
Iterable
 return Objects.hash(statics, regulars);
 }
 
-public void digest(MessageDigest digest)
-{
-regulars.digest(digest);
-statics.digest(digest);
-}
-
 public static Builder builder()
 {
 return new Builder();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
--
diff --git 
a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java 
b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
index cc90c40..9b7d7eb 100644
--- a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
+++ b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
@@ -78,17 +78,6 @@ public abstract class PartitionIterators
 return MorePartitions.extend(iterators.get(0), new Extend());
 }
 
-public static void digest(PartitionIterator iterator, MessageDigest digest)
-{
-while (iterator.hasNext())
-{
-try (RowIterator partition = iterator.next())
-{
-RowIterators.digest(partition, digest);
-}
-}
-}
-
 public static PartitionIterator singletonIterator(RowIterator iterator)
 {
 return new SingletonPartitionIterator(iterator);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/rows/RowIterators.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/RowIterators.java 
b/src/java/org/apache/cassandra/db/rows/RowIterators.java
index 551edb8..ae051c0 100644
--- a/src/java/org/apache/cassandra/db/rows/RowIterators.java
+++ b/src/java/org/apache/cassandra/db/rows/RowIterators.java
@@ -37,10 +37,13 @@ public abstract class RowIterators
 
 public static void digest(RowIterator iterator, MessageDigest digest)
 {
-// TODO: we're not computing digest the same way that old nodes so 
we'll need
-// to pass the version we're computing the digest for and deal with 
that.
+// TODO: we're not computing digest the same way that old nodes. This 
is
+// currently ok as this is only used for schema digest and the is no 
exchange
+// of schema digest between different versions. If this changes 
however,
+// we'll need to agree on a version.
 

[6/6] cassandra git commit: Merge branch 'cassandra-3.9' into trunk

2016-06-30 Thread slebresne
Merge branch 'cassandra-3.9' into trunk

* cassandra-3.9:
  Exclude static columns from digest on empty static row


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

Branch: refs/heads/trunk
Commit: c7f4600be3cb8e816158674599287b7279fb8ff0
Parents: db174f3 3dceaab
Author: Sylvain Lebresne 
Authored: Thu Jun 30 16:54:00 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:54:00 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7f4600b/CHANGES.txt
--
diff --cc CHANGES.txt
index 6068b14,475365f..44b6699
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,8 -1,6 +1,9 @@@
 +3.10
 + * Remove pre-startup check for open JMX port (CASSANDRA-12074)
 +
  3.9
  Merged from 3.0:
+  * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
   * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)



[2/6] cassandra git commit: Exclude static columns from digest on empty static row

2016-06-30 Thread slebresne
Exclude static columns from digest on empty static row

patch by Tommy Stendahl; reviewed by Sylvain Lebresne for CASSANDRA-12090


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

Branch: refs/heads/cassandra-3.9
Commit: 4f14bc50d9037e01e709a925465d195eec4ab6df
Parents: b23fcc2
Author: Sylvain Lebresne 
Authored: Thu Jun 30 13:38:36 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:51:25 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 573f704..f12d704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
  * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/PartitionColumns.java
--
diff --git a/src/java/org/apache/cassandra/db/PartitionColumns.java 
b/src/java/org/apache/cassandra/db/PartitionColumns.java
index 93204f4..bf4ac43 100644
--- a/src/java/org/apache/cassandra/db/PartitionColumns.java
+++ b/src/java/org/apache/cassandra/db/PartitionColumns.java
@@ -18,7 +18,6 @@
 package org.apache.cassandra.db;
 
 import java.util.*;
-import java.security.MessageDigest;
 
 import com.google.common.collect.Iterators;
 
@@ -136,12 +135,6 @@ public class PartitionColumns implements 
Iterable
 return Objects.hash(statics, regulars);
 }
 
-public void digest(MessageDigest digest)
-{
-regulars.digest(digest);
-statics.digest(digest);
-}
-
 public static Builder builder()
 {
 return new Builder();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
--
diff --git 
a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java 
b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
index cc90c40..9b7d7eb 100644
--- a/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
+++ b/src/java/org/apache/cassandra/db/partitions/PartitionIterators.java
@@ -78,17 +78,6 @@ public abstract class PartitionIterators
 return MorePartitions.extend(iterators.get(0), new Extend());
 }
 
-public static void digest(PartitionIterator iterator, MessageDigest digest)
-{
-while (iterator.hasNext())
-{
-try (RowIterator partition = iterator.next())
-{
-RowIterators.digest(partition, digest);
-}
-}
-}
-
 public static PartitionIterator singletonIterator(RowIterator iterator)
 {
 return new SingletonPartitionIterator(iterator);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4f14bc50/src/java/org/apache/cassandra/db/rows/RowIterators.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/RowIterators.java 
b/src/java/org/apache/cassandra/db/rows/RowIterators.java
index 551edb8..ae051c0 100644
--- a/src/java/org/apache/cassandra/db/rows/RowIterators.java
+++ b/src/java/org/apache/cassandra/db/rows/RowIterators.java
@@ -37,10 +37,13 @@ public abstract class RowIterators
 
 public static void digest(RowIterator iterator, MessageDigest digest)
 {
-// TODO: we're not computing digest the same way that old nodes so 
we'll need
-// to pass the version we're computing the digest for and deal with 
that.
+// TODO: we're not computing digest the same way that old nodes. This 
is
+// currently ok as this is only used for schema digest and the is no 
exchange
+// of schema digest between different versions. If this changes 
however,
+// we'll need to agree on a version.
 

[5/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.9

2016-06-30 Thread slebresne
Merge branch 'cassandra-3.0' into cassandra-3.9

* cassandra-3.0:
  Exclude static columns from digest on empty static row


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

Branch: refs/heads/cassandra-3.9
Commit: 3dceaaba80b9f7cd364424558f77c1128907b632
Parents: 2df345a 4f14bc5
Author: Sylvain Lebresne 
Authored: Thu Jun 30 16:53:48 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:53:48 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/CHANGES.txt
--
diff --cc CHANGES.txt
index ed884a9,f12d704..475365f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,5 -1,5 +1,6 @@@
 -3.0.9
 +3.9
 +Merged from 3.0:
+  * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
   * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/src/java/org/apache/cassandra/db/rows/RowIterators.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
--



[4/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.9

2016-06-30 Thread slebresne
Merge branch 'cassandra-3.0' into cassandra-3.9

* cassandra-3.0:
  Exclude static columns from digest on empty static row


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

Branch: refs/heads/trunk
Commit: 3dceaaba80b9f7cd364424558f77c1128907b632
Parents: 2df345a 4f14bc5
Author: Sylvain Lebresne 
Authored: Thu Jun 30 16:53:48 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 16:53:48 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/db/PartitionColumns.java |  7 ---
 .../cassandra/db/partitions/PartitionIterators.java   | 11 ---
 .../org/apache/cassandra/db/rows/RowIterators.java|  9 ++---
 .../cassandra/db/rows/UnfilteredRowIterators.java | 14 +-
 5 files changed, 20 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/CHANGES.txt
--
diff --cc CHANGES.txt
index ed884a9,f12d704..475365f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,5 -1,5 +1,6 @@@
 -3.0.9
 +3.9
 +Merged from 3.0:
+  * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
   * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/src/java/org/apache/cassandra/db/rows/RowIterators.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3dceaaba/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
--



[6/6] cassandra git commit: Merge branch 'cassandra-3.9' into trunk

2016-06-30 Thread slebresne
Merge branch 'cassandra-3.9' into trunk

* cassandra-3.9:
  Avoid deserialization error after altering column type


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

Branch: refs/heads/trunk
Commit: 9242c85cf48bbfe7e46fde180576315370c66b0c
Parents: e423527 1f014b2
Author: Sylvain Lebresne 
Authored: Thu Jun 30 11:16:17 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 11:16:17 2016 +0200

--
 CHANGES.txt |  2 +
 .../apache/cassandra/db/rows/BufferCell.java|  1 -
 src/java/org/apache/cassandra/db/rows/Cell.java | 16 +++
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 97 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9242c85c/CHANGES.txt
--
diff --cc CHANGES.txt
index 81740ab,ed884a9..6068b14
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,7 -1,6 +1,9 @@@
 +3.10
 + * Remove pre-startup check for open JMX port (CASSANDRA-12074)
 +
  3.9
+ Merged from 3.0:
+  * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
  Merged from 2.1:



[1/6] cassandra git commit: Avoid deserialization error after altering column type

2016-06-30 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 362e13206 -> e4c344c58
  refs/heads/cassandra-3.9 c7547e0de -> 1f014b2ca
  refs/heads/trunk e42352763 -> 9242c85cf


Avoid deserialization error after altering column type

This makes sure the column used when serializing intra-node messages is
"current". Previously, we would use the type used during deserialization
which could not be "current" due to an ALTER TYPE.

patch by slebresne; reviewed by thobbs for CASSANDRA-11820


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

Branch: refs/heads/cassandra-3.0
Commit: e4c344c58f8ca8f69224855080de4ec266fb671e
Parents: 362e132
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Mon Jun 27 14:17:27 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 30 11:14:01 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/db/rows/BufferCell.java| 16 +++
 src/java/org/apache/cassandra/db/rows/Cell.java |  4 +-
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 98 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index ae37d2c..573f704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/src/java/org/apache/cassandra/db/rows/BufferCell.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/BufferCell.java 
b/src/java/org/apache/cassandra/db/rows/BufferCell.java
index 22b629a..db0ded5 100644
--- a/src/java/org/apache/cassandra/db/rows/BufferCell.java
+++ b/src/java/org/apache/cassandra/db/rows/BufferCell.java
@@ -228,7 +228,7 @@ public class BufferCell extends AbstractCell
 private final static int USE_ROW_TIMESTAMP_MASK  = 0x08; // Wether 
the cell has the same timestamp than the row this is a cell of.
 private final static int USE_ROW_TTL_MASK= 0x10; // Wether 
the cell has the same ttl than the row this is a cell of.
 
-public void serialize(Cell cell, DataOutputPlus out, LivenessInfo 
rowLiveness, SerializationHeader header) throws IOException
+public void serialize(Cell cell, ColumnDefinition column, 
DataOutputPlus out, LivenessInfo rowLiveness, SerializationHeader header) 
throws IOException
 {
 assert cell != null;
 boolean hasValue = cell.value().hasRemaining();
@@ -260,11 +260,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 header.writeTTL(cell.ttl(), out);
 
-if (cell.column().isComplex())
-cell.column().cellPathSerializer().serialize(cell.path(), out);
+if (column.isComplex())
+column.cellPathSerializer().serialize(cell.path(), out);
 
 if (hasValue)
-header.getType(cell.column()).writeValue(cell.value(), out);
+header.getType(column).writeValue(cell.value(), out);
 }
 
 public Cell deserialize(DataInputPlus in, LivenessInfo rowLiveness, 
ColumnDefinition column, SerializationHeader header, SerializationHelper 
helper) throws IOException
@@ -308,7 +308,7 @@ public class BufferCell extends AbstractCell
 return new BufferCell(column, timestamp, ttl, localDeletionTime, 
value, path);
 }
 
-public long serializedSize(Cell cell, LivenessInfo rowLiveness, 
SerializationHeader header)
+public long serializedSize(Cell cell, ColumnDefinition column, 
LivenessInfo rowLiveness, SerializationHeader header)
 {
 long size = 1; // flags
 boolean hasValue = cell.value().hasRemaining();
@@ -325,11 +325,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 size += header.ttlSerializedSize(cell.ttl());
 
-if (cell.column().isComplex())
-size += 
cell.column().cellPathSerializer().seria

[2/6] cassandra git commit: Avoid deserialization error after altering column type

2016-06-30 Thread slebresne
Avoid deserialization error after altering column type

This makes sure the column used when serializing intra-node messages is
"current". Previously, we would use the type used during deserialization
which could not be "current" due to an ALTER TYPE.

patch by slebresne; reviewed by thobbs for CASSANDRA-11820


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

Branch: refs/heads/cassandra-3.9
Commit: e4c344c58f8ca8f69224855080de4ec266fb671e
Parents: 362e132
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Mon Jun 27 14:17:27 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 30 11:14:01 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/db/rows/BufferCell.java| 16 +++
 src/java/org/apache/cassandra/db/rows/Cell.java |  4 +-
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 98 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index ae37d2c..573f704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/src/java/org/apache/cassandra/db/rows/BufferCell.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/BufferCell.java 
b/src/java/org/apache/cassandra/db/rows/BufferCell.java
index 22b629a..db0ded5 100644
--- a/src/java/org/apache/cassandra/db/rows/BufferCell.java
+++ b/src/java/org/apache/cassandra/db/rows/BufferCell.java
@@ -228,7 +228,7 @@ public class BufferCell extends AbstractCell
 private final static int USE_ROW_TIMESTAMP_MASK  = 0x08; // Wether 
the cell has the same timestamp than the row this is a cell of.
 private final static int USE_ROW_TTL_MASK= 0x10; // Wether 
the cell has the same ttl than the row this is a cell of.
 
-public void serialize(Cell cell, DataOutputPlus out, LivenessInfo 
rowLiveness, SerializationHeader header) throws IOException
+public void serialize(Cell cell, ColumnDefinition column, 
DataOutputPlus out, LivenessInfo rowLiveness, SerializationHeader header) 
throws IOException
 {
 assert cell != null;
 boolean hasValue = cell.value().hasRemaining();
@@ -260,11 +260,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 header.writeTTL(cell.ttl(), out);
 
-if (cell.column().isComplex())
-cell.column().cellPathSerializer().serialize(cell.path(), out);
+if (column.isComplex())
+column.cellPathSerializer().serialize(cell.path(), out);
 
 if (hasValue)
-header.getType(cell.column()).writeValue(cell.value(), out);
+header.getType(column).writeValue(cell.value(), out);
 }
 
 public Cell deserialize(DataInputPlus in, LivenessInfo rowLiveness, 
ColumnDefinition column, SerializationHeader header, SerializationHelper 
helper) throws IOException
@@ -308,7 +308,7 @@ public class BufferCell extends AbstractCell
 return new BufferCell(column, timestamp, ttl, localDeletionTime, 
value, path);
 }
 
-public long serializedSize(Cell cell, LivenessInfo rowLiveness, 
SerializationHeader header)
+public long serializedSize(Cell cell, ColumnDefinition column, 
LivenessInfo rowLiveness, SerializationHeader header)
 {
 long size = 1; // flags
 boolean hasValue = cell.value().hasRemaining();
@@ -325,11 +325,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 size += header.ttlSerializedSize(cell.ttl());
 
-if (cell.column().isComplex())
-size += 
cell.column().cellPathSerializer().serializedSize(cell.path());
+if (column.isComplex())
+size += 
column.cellPathSerializer().serializedSize(cell.path());
 
 if (hasValue)
-size += 
header

[3/6] cassandra git commit: Avoid deserialization error after altering column type

2016-06-30 Thread slebresne
Avoid deserialization error after altering column type

This makes sure the column used when serializing intra-node messages is
"current". Previously, we would use the type used during deserialization
which could not be "current" due to an ALTER TYPE.

patch by slebresne; reviewed by thobbs for CASSANDRA-11820


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

Branch: refs/heads/trunk
Commit: e4c344c58f8ca8f69224855080de4ec266fb671e
Parents: 362e132
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Mon Jun 27 14:17:27 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 30 11:14:01 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/db/rows/BufferCell.java| 16 +++
 src/java/org/apache/cassandra/db/rows/Cell.java |  4 +-
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 98 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index ae37d2c..573f704 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Fix EOF exception when altering column type (CASSANDRA-11820)
 Merged from 2.2:
  * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4c344c5/src/java/org/apache/cassandra/db/rows/BufferCell.java
--
diff --git a/src/java/org/apache/cassandra/db/rows/BufferCell.java 
b/src/java/org/apache/cassandra/db/rows/BufferCell.java
index 22b629a..db0ded5 100644
--- a/src/java/org/apache/cassandra/db/rows/BufferCell.java
+++ b/src/java/org/apache/cassandra/db/rows/BufferCell.java
@@ -228,7 +228,7 @@ public class BufferCell extends AbstractCell
 private final static int USE_ROW_TIMESTAMP_MASK  = 0x08; // Wether 
the cell has the same timestamp than the row this is a cell of.
 private final static int USE_ROW_TTL_MASK= 0x10; // Wether 
the cell has the same ttl than the row this is a cell of.
 
-public void serialize(Cell cell, DataOutputPlus out, LivenessInfo 
rowLiveness, SerializationHeader header) throws IOException
+public void serialize(Cell cell, ColumnDefinition column, 
DataOutputPlus out, LivenessInfo rowLiveness, SerializationHeader header) 
throws IOException
 {
 assert cell != null;
 boolean hasValue = cell.value().hasRemaining();
@@ -260,11 +260,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 header.writeTTL(cell.ttl(), out);
 
-if (cell.column().isComplex())
-cell.column().cellPathSerializer().serialize(cell.path(), out);
+if (column.isComplex())
+column.cellPathSerializer().serialize(cell.path(), out);
 
 if (hasValue)
-header.getType(cell.column()).writeValue(cell.value(), out);
+header.getType(column).writeValue(cell.value(), out);
 }
 
 public Cell deserialize(DataInputPlus in, LivenessInfo rowLiveness, 
ColumnDefinition column, SerializationHeader header, SerializationHelper 
helper) throws IOException
@@ -308,7 +308,7 @@ public class BufferCell extends AbstractCell
 return new BufferCell(column, timestamp, ttl, localDeletionTime, 
value, path);
 }
 
-public long serializedSize(Cell cell, LivenessInfo rowLiveness, 
SerializationHeader header)
+public long serializedSize(Cell cell, ColumnDefinition column, 
LivenessInfo rowLiveness, SerializationHeader header)
 {
 long size = 1; // flags
 boolean hasValue = cell.value().hasRemaining();
@@ -325,11 +325,11 @@ public class BufferCell extends AbstractCell
 if (isExpiring && !useRowTTL)
 size += header.ttlSerializedSize(cell.ttl());
 
-if (cell.column().isComplex())
-size += 
cell.column().cellPathSerializer().serializedSize(cell.path());
+if (column.isComplex())
+size += 
column.cellPathSerializer().serializedSize(cell.path());
 
 if (hasValue)
-size += 
header

[4/6] cassandra git commit: Merge commit 'e4c344c58f8ca8f69224855080de4ec266fb671e' into cassandra-3.9

2016-06-30 Thread slebresne
Merge commit 'e4c344c58f8ca8f69224855080de4ec266fb671e' into cassandra-3.9

* commit 'e4c344c58f8ca8f69224855080de4ec266fb671e':
  Avoid deserialization error after altering column type


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

Branch: refs/heads/trunk
Commit: 1f014b2cac739439bcf97adb34ae5b8ede6d2fed
Parents: c7547e0 e4c344c
Author: Sylvain Lebresne 
Authored: Thu Jun 30 11:14:48 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 11:16:06 2016 +0200

--
 CHANGES.txt |  2 +
 .../apache/cassandra/db/rows/BufferCell.java|  1 -
 src/java/org/apache/cassandra/db/rows/Cell.java | 16 +++
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 97 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f014b2c/CHANGES.txt
--
diff --cc CHANGES.txt
index 463cf78,573f704..ed884a9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,10 +1,37 @@@
 -3.0.9
 +3.9
++Merged from 3.0:
+  * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 +Merged from 2.1:
 + * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
 + * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 +
  
 -3.0.8
 - * Fix potential race in schema during new table creation (CASSANDRA-12083)
 +3.8
 + * Improve details in compaction log message (CASSANDRA-12080)
 + * Allow unset values in CQLSSTableWriter (CASSANDRA-11911)
 + * Chunk cache to request compressor-compatible buffers if pool space is 
exhausted (CASSANDRA-11993)
 + * Remove DatabaseDescriptor dependencies from SequentialWriter 
(CASSANDRA-11579)
 + * Move skip_stop_words filter before stemming (CASSANDRA-12078)
 + * Support seek() in EncryptedFileSegmentInputStream (CASSANDRA-11957)
 + * SSTable tools mishandling LocalPartitioner (CASSANDRA-12002)
 + * When SEPWorker assigned work, set thread name to match pool 
(CASSANDRA-11966)
 + * Add cross-DC latency metrics (CASSANDRA-11596)
 + * Allow terms in selection clause (CASSANDRA-10783)
 + * Add bind variables to trace (CASSANDRA-11719)
 + * Switch counter shards' clock to timestamps (CASSANDRA-9811)
 + * Introduce HdrHistogram and response/service/wait separation to stress tool 
(CASSANDRA-11853)
 + * entry-weighers in QueryProcessor should respect partitionKeyBindIndexes 
field (CASSANDRA-11718)
 + * Support older ant versions (CASSANDRA-11807)
 + * Estimate compressed on disk size when deciding if sstable size limit 
reached (CASSANDRA-11623)
 + * cassandra-stress profiles should support case sensitive schemas 
(CASSANDRA-11546)
 + * Remove DatabaseDescriptor dependency from FileUtils (CASSANDRA-11578)
 + * Faster streaming (CASSANDRA-9766)
 + * Add prepared query parameter to trace for "Execute CQL3 prepared query" 
session (CASSANDRA-11425)
 + * Add repaired percentage metric (CASSANDRA-11503)
 + * Add Change-Data-Capture (CASSANDRA-8844)
 +Merged from 3.0:
   * cqlsh: fix error handling in rare COPY FROM failure scenario 
(CASSANDRA-12070)
   * Disable autocompaction during drain (CASSANDRA-11878)
   * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f014b2c/src/java/org/apache/cassandra/db/rows/BufferCell.java
--
diff --cc src/java/org/apache/cassandra/db/rows/BufferCell.java
index d998d69,db0ded5..7bb1f4b
--- a/src/java/org/apache/cassandra/db/rows/BufferCell.java
+++ b/src/java/org/apache/cassandra/db/rows/BufferCell.java
@@@ -125,5 -200,166 +125,4 @@@ public class BufferCell extends Abstrac
  {
  return EMPTY_SIZE + ObjectSizes.sizeOnHeapExcludingData(value) + 
(path == null ? 0 : path.unsharedHeapSizeExcludingData());
  }
 -
 -/**
 - * The serialization format for cell is:
 - * [ flags ][ timestamp ][ deletion time ][ttl][ path size ][ 
path ][ value size ][ value ]
 - * [   1b  ][ 8b (vint) ][   4b (vint)   ][ 4b (vint) ][ 4b (vint) ][ 
 arb ][  4b (vint) ][  arb  ]
 - *
 - * where not all field are always present (in fact, only the 

[5/6] cassandra git commit: Merge commit 'e4c344c58f8ca8f69224855080de4ec266fb671e' into cassandra-3.9

2016-06-30 Thread slebresne
Merge commit 'e4c344c58f8ca8f69224855080de4ec266fb671e' into cassandra-3.9

* commit 'e4c344c58f8ca8f69224855080de4ec266fb671e':
  Avoid deserialization error after altering column type


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

Branch: refs/heads/cassandra-3.9
Commit: 1f014b2cac739439bcf97adb34ae5b8ede6d2fed
Parents: c7547e0 e4c344c
Author: Sylvain Lebresne 
Authored: Thu Jun 30 11:14:48 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 30 11:16:06 2016 +0200

--
 CHANGES.txt |  2 +
 .../apache/cassandra/db/rows/BufferCell.java|  1 -
 src/java/org/apache/cassandra/db/rows/Cell.java | 16 +++
 .../cassandra/db/rows/UnfilteredSerializer.java | 30 +
 .../org/apache/cassandra/cql3/CQLTester.java| 39 +++--
 .../cql3/validation/operations/AlterTest.java   | 46 +---
 6 files changed, 97 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f014b2c/CHANGES.txt
--
diff --cc CHANGES.txt
index 463cf78,573f704..ed884a9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,10 +1,37 @@@
 -3.0.9
 +3.9
++Merged from 3.0:
+  * Fix EOF exception when altering column type (CASSANDRA-11820)
  Merged from 2.2:
   * MemoryUtil.getShort() should return an unsigned short also for 
architectures not supporting unaligned memory accesses (CASSANDRA-11973)
 +Merged from 2.1:
 + * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
 + * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 +
  
 -3.0.8
 - * Fix potential race in schema during new table creation (CASSANDRA-12083)
 +3.8
 + * Improve details in compaction log message (CASSANDRA-12080)
 + * Allow unset values in CQLSSTableWriter (CASSANDRA-11911)
 + * Chunk cache to request compressor-compatible buffers if pool space is 
exhausted (CASSANDRA-11993)
 + * Remove DatabaseDescriptor dependencies from SequentialWriter 
(CASSANDRA-11579)
 + * Move skip_stop_words filter before stemming (CASSANDRA-12078)
 + * Support seek() in EncryptedFileSegmentInputStream (CASSANDRA-11957)
 + * SSTable tools mishandling LocalPartitioner (CASSANDRA-12002)
 + * When SEPWorker assigned work, set thread name to match pool 
(CASSANDRA-11966)
 + * Add cross-DC latency metrics (CASSANDRA-11596)
 + * Allow terms in selection clause (CASSANDRA-10783)
 + * Add bind variables to trace (CASSANDRA-11719)
 + * Switch counter shards' clock to timestamps (CASSANDRA-9811)
 + * Introduce HdrHistogram and response/service/wait separation to stress tool 
(CASSANDRA-11853)
 + * entry-weighers in QueryProcessor should respect partitionKeyBindIndexes 
field (CASSANDRA-11718)
 + * Support older ant versions (CASSANDRA-11807)
 + * Estimate compressed on disk size when deciding if sstable size limit 
reached (CASSANDRA-11623)
 + * cassandra-stress profiles should support case sensitive schemas 
(CASSANDRA-11546)
 + * Remove DatabaseDescriptor dependency from FileUtils (CASSANDRA-11578)
 + * Faster streaming (CASSANDRA-9766)
 + * Add prepared query parameter to trace for "Execute CQL3 prepared query" 
session (CASSANDRA-11425)
 + * Add repaired percentage metric (CASSANDRA-11503)
 + * Add Change-Data-Capture (CASSANDRA-8844)
 +Merged from 3.0:
   * cqlsh: fix error handling in rare COPY FROM failure scenario 
(CASSANDRA-12070)
   * Disable autocompaction during drain (CASSANDRA-11878)
   * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f014b2c/src/java/org/apache/cassandra/db/rows/BufferCell.java
--
diff --cc src/java/org/apache/cassandra/db/rows/BufferCell.java
index d998d69,db0ded5..7bb1f4b
--- a/src/java/org/apache/cassandra/db/rows/BufferCell.java
+++ b/src/java/org/apache/cassandra/db/rows/BufferCell.java
@@@ -125,5 -200,166 +125,4 @@@ public class BufferCell extends Abstrac
  {
  return EMPTY_SIZE + ObjectSizes.sizeOnHeapExcludingData(value) + 
(path == null ? 0 : path.unsharedHeapSizeExcludingData());
  }
 -
 -/**
 - * The serialization format for cell is:
 - * [ flags ][ timestamp ][ deletion time ][ttl][ path size ][ 
path ][ value size ][ value ]
 - * [   1b  ][ 8b (vint) ][   4b (vint)   ][ 4b (vint) ][ 4b (vint) ][ 
 arb ][  4b (vint) ][  arb  ]
 - *
 - * where not all field are always present (in fact, 

cassandra git commit: Add support for CQL in pygments (proper syntax highlighting)

2016-06-29 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/trunk 582f9dc08 -> e42352763


Add support for CQL in pygments (proper syntax highlighting)


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

Branch: refs/heads/trunk
Commit: e42352763089a41d4563d67fe800fd2878da842f
Parents: 582f9dc
Author: Sylvain Lebresne 
Authored: Wed Jun 29 09:23:38 2016 +0200
Committer: Sylvain Lebresne 
Committed: Wed Jun 29 12:36:54 2016 +0200

--
 doc/source/_util/cql.py| 267 
 doc/source/conf.py |   6 +-
 doc/source/cql/appendices.rst  |   2 +-
 doc/source/cql/changes.rst |   2 +-
 doc/source/cql/ddl.rst |   2 +-
 doc/source/cql/definitions.rst |   4 +-
 doc/source/cql/dml.rst |   4 +-
 doc/source/cql/functions.rst   |  25 ++--
 doc/source/cql/indexes.rst |   2 +-
 doc/source/cql/json.rst|   2 +-
 doc/source/cql/mvs.rst |   4 +-
 doc/source/cql/security.rst|   7 +-
 doc/source/cql/triggers.rst|   2 +-
 doc/source/cql/types.rst   |   2 +-
 14 files changed, 307 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4235276/doc/source/_util/cql.py
--
diff --git a/doc/source/_util/cql.py b/doc/source/_util/cql.py
new file mode 100644
index 000..b1c8cde
--- /dev/null
+++ b/doc/source/_util/cql.py
@@ -0,0 +1,267 @@
+# -*- coding: utf-8 -*-
+"""
+CQL pygments lexer
+~~
+
+Lexer for the Cassandra Query Language (CQL).
+
+This is heavily inspired from the pygments SQL lexer (and the Postgres one 
in particular) but adapted to CQL
+keywords and specificities.
+
+TODO: This has been hacked quickly, but once it's more tested, we could 
submit it upstream.
+  In particular, we have alot of keywords whose meaning depends on the 
context and we could potentially improve
+  their handling. For instance, SET is a keyword, but also a type name 
(that's why currently we also consider
+  map and list as keywords, not types; we could disambiguate by 
looking if there is a '<' afterwards). Or things
+  like USERS, which can is used in some documentation example as a 
table name but is a keyword too (we could
+  only consider it a keyword if after LIST for instance). Similarly, 
type nanes are not reserved, so they and
+  are sometime used as column identifiers (also, timestamp is both a 
type and a keyword). I "think" we can
+  somewhat disambiguate through "states", but unclear how far it's 
worth going.
+
+  We could also add the predefined functions?
+"""
+
+import re
+
+from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, words
+from pygments.token import Punctuation, Whitespace, Error, \
+Text, Comment, Operator, Keyword, Name, String, Number, Generic, Literal
+from pygments.lexers import get_lexer_by_name, ClassNotFound
+from pygments.util import iteritems
+
+__all__ = [ 'CQLLexer' ]
+
+language_re = re.compile(r"\s+LANGUAGE\s+'?(\w+)'?", re.IGNORECASE)
+
+KEYWORDS = (
+'SELECT',
+'FROM',
+'AS',
+'WHERE',
+'AND',
+'KEY',
+'KEYS',
+'ENTRIES',
+'FULL',
+'INSERT',
+'UPDATE',
+'WITH',
+'LIMIT',
+'PER',
+'PARTITION',
+'USING',
+'USE',
+'DISTINCT',
+'COUNT',
+'SET',
+'BEGIN',
+'UNLOGGED',
+'BATCH',
+'APPLY',
+'TRUNCATE',
+'DELETE',
+'IN',
+'CREATE',
+'KEYSPACE',
+'SCHEMA',
+'KEYSPACES',
+'COLUMNFAMILY',
+'TABLE',
+'MATERIALIZED',
+'VIEW',
+'INDEX',
+'CUSTOM',
+'ON',
+'TO',
+'DROP',
+'PRIMARY',
+'INTO',
+'VALUES',
+'TIMESTAMP',
+'TTL',
+'CAST',
+'ALTER',
+'RENAME',
+'ADD',
+'TYPE',
+'COMPACT',
+'STORAGE',
+'ORDER',
+'BY',
+'ASC',
+'DESC',
+'ALLOW',
+'FILTERING',
+'IF',
+'IS',
+'CONTAINS',
+'GRANT',
+'ALL',
+'PERMISSION',
+'PERMISSIONS',
+'OF',
+'REVOKE',
+'MODIFY',
+'AUTHORIZE',
+'DESCRIBE',
+'EXECUTE',
+'NORECURSIVE',
+'MBEAN',
+'MBEANS',
+'USER',
+'USERS',
+'ROLE',
+'ROLES',
+'SUPERUSER',
+'NOSUPERUSER',
+'PASSWORD',
+'LOGIN',
+'NOLOGIN',
+'OPTIONS',
+'CLUSTERING',
+'TOKEN',
+'WRITETIME',
+'NULL',
+'NOT',
+'EXISTS',
+'MAP',
+'LIST',
+'NAN',
+'INFINITY',
+'TUPLE',
+'TRIGGER',
+'STATIC',
+'FROZEN',
+'FUNCTION',
+

[1/2] cassandra git commit: Add warning that doc is WIP

2016-06-28 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/trunk ad5b30eff -> 3023d59ba


Add warning that doc is WIP


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

Branch: refs/heads/trunk
Commit: 937184b30f7a0d2afb401726a74a20ee2aeb3696
Parents: ad5b30e
Author: Sylvain Lebresne 
Authored: Tue Jun 28 12:03:16 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 17:09:45 2016 +0200

--
 doc/source/_static/extra.css| 9 +
 doc/source/_templates/indexcontent.html | 3 +++
 2 files changed, 12 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/937184b3/doc/source/_static/extra.css
--
diff --git a/doc/source/_static/extra.css b/doc/source/_static/extra.css
index b55515e..fd3573f 100644
--- a/doc/source/_static/extra.css
+++ b/doc/source/_static/extra.css
@@ -41,3 +41,12 @@ table.contentstable {
 td.rightcolumn {
 padding-left: 30px;
 }
+
+div#wipwarning {
+font-size: 14px;
+border: 1px solid #ecc;
+color: #f66;
+background: #ffe8e8;
+padding: 10px 30px;
+margin-bottom: 30px;
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/937184b3/doc/source/_templates/indexcontent.html
--
diff --git a/doc/source/_templates/indexcontent.html 
b/doc/source/_templates/indexcontent.html
index a71a7e9..35c6589 100644
--- a/doc/source/_templates/indexcontent.html
+++ b/doc/source/_templates/indexcontent.html
@@ -1,5 +1,8 @@
 {% extends "defindex.html" %}
 {% block tables %}
+This documentation is currently a work-in-progress and 
contains a number of TODO sections.
+Contributions are welcome.
+
 {% trans %}Main documentation parts:{% endtrans %}
   
 



[2/2] cassandra git commit: Initial FAQ section

2016-06-28 Thread slebresne
Initial FAQ section


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

Branch: refs/heads/trunk
Commit: 3023d59ba3fa572fec8ecba1055065c814eae653
Parents: 937184b
Author: Sylvain Lebresne 
Authored: Tue Jun 28 09:53:31 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 17:09:48 2016 +0200

--
 doc/convert_yaml_to_rst.py|   2 +
 doc/source/architecture/dynamo.rst|   2 +
 doc/source/conf.py|   5 +
 doc/source/faq/index.rst  | 280 -
 doc/source/operating/bulk_loading.rst |  24 +++
 doc/source/operating/index.rst|   1 +
 doc/source/operating/topo_changes.rst |   2 +
 7 files changed, 315 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3023d59b/doc/convert_yaml_to_rst.py
--
diff --git a/doc/convert_yaml_to_rst.py b/doc/convert_yaml_to_rst.py
index fee6d8c..c17 100644
--- a/doc/convert_yaml_to_rst.py
+++ b/doc/convert_yaml_to_rst.py
@@ -58,6 +58,8 @@ def convert(yaml_file, dest_file):
 lines = f.readlines()[7:]
 
 with open(dest_file, 'w') as outfile:
+outfile.write(".. _cassandra-yaml:\n")
+outfile.write("\n")
 outfile.write("Cassandra Configuration File\n")
 outfile.write("\n")
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3023d59b/doc/source/architecture/dynamo.rst
--
diff --git a/doc/source/architecture/dynamo.rst 
b/doc/source/architecture/dynamo.rst
index d146471..a7dbb87 100644
--- a/doc/source/architecture/dynamo.rst
+++ b/doc/source/architecture/dynamo.rst
@@ -17,6 +17,8 @@
 Dynamo
 --
 
+.. _gossip:
+
 Gossip
 ^^
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3023d59b/doc/source/conf.py
--
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 9caf188..2b36353 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -46,8 +46,13 @@ extensions = [
 'sphinx.ext.todo',
 'sphinx.ext.mathjax',
 'sphinx.ext.ifconfig',
+'sphinx.ext.extlinks',
 ]
 
+extlinks = {
+'jira': ( 'https://issues.apache.org/jira/browse/CASSANDRA-%s', 
'CASSANDRA-')
+}
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3023d59b/doc/source/faq/index.rst
--
diff --git a/doc/source/faq/index.rst b/doc/source/faq/index.rst
index 4ac0be4..d985e37 100644
--- a/doc/source/faq/index.rst
+++ b/doc/source/faq/index.rst
@@ -17,4 +17,282 @@
 Frequently Asked Questions
 ==
 
-.. TODO: todo
+- :ref:`why-cant-list-all`
+- :ref:`what-ports`
+- :ref:`what-happens-on-joins`
+- :ref:`asynch-deletes`
+- :ref:`one-entry-ring`
+- :ref:`can-large-blob`
+- :ref:`nodetool-connection-refused`
+- :ref:`to-batch-or-not-to-batch`
+- :ref:`selinux`
+- :ref:`how-to-unsubscribe`
+- :ref:`cassandra-eats-all-my-memory`
+- :ref:`what-are-seeds`
+- :ref:`are-seeds-SPOF`
+- :ref:`why-message-dropped`
+- :ref:`oom-map-failed`
+- :ref:`what-on-same-timestamp-update`
+- :ref:`why-bootstrapping-stream-error`
+
+.. _why-cant-list-all:
+
+Why can't I set ``listen_address`` to listen on 0.0.0.0 (all my addresses)?
+---
+
+Cassandra is a gossip-based distributed system and ``listen_address`` is the 
address a node tells other nodes to reach
+it at. Telling other nodes "contact me on any of my addresses" is a bad idea; 
if different nodes in the cluster pick
+different addresses for you, Bad Things happen.
+
+If you don't want to manually specify an IP to ``listen_address`` for each 
node in your cluster (understandable!), leave
+it blank and Cassandra will use ``InetAddress.getLocalHost()`` to pick an 
address. Then it's up to you or your ops team
+to make things resolve correctly (``/etc/hosts/``, dns, etc).
+
+One exception to this process is JMX, which by default binds to 0.0.0.0 (Java 
bug 6425769).
+
+See :jira:`256` and :jira:`43` for more gory details.
+
+.. _what-ports:
+
+What ports does Cassandra use?
+--
+
+By default, Cassandra uses 7000 for cluster communication (7001 if SSL is 
enabled),  9042 for native protocol clients,
+and 7199 for JMX (and 9160 for the deprecated Thrift interface). The internode 

[08/17] cassandra git commit: Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

2016-06-28 Thread slebresne
Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

* commit '017ec3e99e704db5e1a36ad153af08d6e7eca523':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-3.9
Commit: 6555a87bde4daeb8bd5d9558595a367ec6bc061d
Parents: 3b448b3 017ec3e
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:17:40 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:18:27 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/CHANGES.txt
--
diff --cc CHANGES.txt
index 8d2062d,feeaded..9f42d98
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,36 @@@
 -2.1.15
 +2.2.7
 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
+  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
   * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
   * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
   * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index fa82fa7,4340d42..c702679
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -331,15 -354,52 +331,41 @@@ public class QueryProcessor implements 
   */
  public static UntypedResultSet executeOnceInternal(String query, 
Object... values)
  {
 -try
 -{
 -ParsedStatement.Prepared prepared = parseStatement(query, 

[07/17] cassandra git commit: Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

2016-06-28 Thread slebresne
Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

* commit '017ec3e99e704db5e1a36ad153af08d6e7eca523':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-3.0
Commit: 6555a87bde4daeb8bd5d9558595a367ec6bc061d
Parents: 3b448b3 017ec3e
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:17:40 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:18:27 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/CHANGES.txt
--
diff --cc CHANGES.txt
index 8d2062d,feeaded..9f42d98
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,36 @@@
 -2.1.15
 +2.2.7
 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
+  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
   * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
   * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
   * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index fa82fa7,4340d42..c702679
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -331,15 -354,52 +331,41 @@@ public class QueryProcessor implements 
   */
  public static UntypedResultSet executeOnceInternal(String query, 
Object... values)
  {
 -try
 -{
 -ParsedStatement.Prepared prepared = parseStatement(query, 

[10/17] cassandra git commit: Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

2016-06-28 Thread slebresne
Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

* commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/trunk
Commit: 70059726f08a98ea21af91ce3855bf62f6f4b652
Parents: cb4540e 6555a87
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:19:08 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:19:57 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 11 +++
 8 files changed, 68 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/CHANGES.txt
--
diff --cc CHANGES.txt
index 314a93e,9f42d98..aaeafd6
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -9,38 -2,9 +9,39 @@@ Merged from 2.2
   * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
++ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
 + * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 + * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
 + * Avoid marking too many sstables as repaired (CASSANDRA-11696)
 + * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index da146ef,c702679..af94d3e
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -273,10 -288,10 +273,10 @@@ public class QueryProcessor implements 

[15/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/trunk
Commit: 53f8f09575dfbdc166b257fe71a4d4a832470253
Parents: d289778
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:21:05 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 12 
 8 files changed, 69 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index cd13896..075d44a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 3.9
 Merged from 2.1:
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d812af4..04b 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -258,7 +258,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(cl, boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -331,6 +331,21 @@ public class QueryProcessor implements QueryHandler
 return null;
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(int nowInSec, String 
query, Object... values)
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = select.executeInternal(internalQueryState(), 
makeInternalOptions(prepared, values), nowInSec);
+assert result instanceof ResultMessage.Rows;
+return UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+
 public static UntypedResultSet resultify(String query, RowIterator 
partition)
 {
 return resultify(query, 
PartitionIterators.singletonIterator(partition));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 5f37e5e..f2b484e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -414,7 +414,11 @@ public class SelectStatement implements CQLStatement
 
 public ResultMessage.Rows executeInternal(QueryState state, QueryOptions 
options) throws RequestExecutionException, RequestValidationException
 {
-int nowInSec = FBUtilities.nowInSeconds();
+return executeI

[06/17] cassandra git commit: Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

2016-06-28 Thread slebresne
Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

* commit '017ec3e99e704db5e1a36ad153af08d6e7eca523':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-2.2
Commit: 6555a87bde4daeb8bd5d9558595a367ec6bc061d
Parents: 3b448b3 017ec3e
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:17:40 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:18:27 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/CHANGES.txt
--
diff --cc CHANGES.txt
index 8d2062d,feeaded..9f42d98
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,36 @@@
 -2.1.15
 +2.2.7
 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
+  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
   * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
   * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
   * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index fa82fa7,4340d42..c702679
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -331,15 -354,52 +331,41 @@@ public class QueryProcessor implements 
   */
  public static UntypedResultSet executeOnceInternal(String query, 
Object... values)
  {
 -try
 -{
 -ParsedStatement.Prepared prepared = parseStatement(query, 

[04/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/cassandra-3.9
Commit: 017ec3e99e704db5e1a36ad153af08d6e7eca523
Parents: 2811f15
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:16:00 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5741241..feeaded 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d4ca76f..4340d42 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -296,7 +296,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -374,6 +374,32 @@ public class QueryProcessor implements QueryHandler
 }
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(long now, String 
query, Object... values)
+{
+try
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = 
select.executeInternal(internalQueryState(), makeInternalOptions(prepared, 
values), now);
+assert result instanceof ResultMessage.Rows;
+return 
UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+catch (RequestExecutionException e)
+{
+throw new RuntimeException(e);
+}
+catch (RequestValidationException e)
+{
+throw new RuntimeException("Error validating query " + query, e);
+}
+}
+
 public static UntypedResultSet resultify(String query, Row row)
 {
 return resultify(query, Collections.singletonList(row));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 1e142e0..6351bb5 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.jav

[17/17] cassandra git commit: Merge branch 'cassandra-3.9' into trunk

2016-06-28 Thread slebresne
Merge branch 'cassandra-3.9' into trunk

* cassandra-3.9:
  Avoid stalling Paxos when the paxos state expires
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/trunk
Commit: ad5b30effa9b3585db8670dcb3a92b3a716e367e
Parents: 9ff299e 53f8f09
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:21:21 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:21:21 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 12 
 8 files changed, 69 insertions(+), 12 deletions(-)
--




[02/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/cassandra-2.2
Commit: 017ec3e99e704db5e1a36ad153af08d6e7eca523
Parents: 2811f15
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:16:00 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5741241..feeaded 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d4ca76f..4340d42 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -296,7 +296,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -374,6 +374,32 @@ public class QueryProcessor implements QueryHandler
 }
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(long now, String 
query, Object... values)
+{
+try
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = 
select.executeInternal(internalQueryState(), makeInternalOptions(prepared, 
values), now);
+assert result instanceof ResultMessage.Rows;
+return 
UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+catch (RequestExecutionException e)
+{
+throw new RuntimeException(e);
+}
+catch (RequestValidationException e)
+{
+throw new RuntimeException("Error validating query " + query, e);
+}
+}
+
 public static UntypedResultSet resultify(String query, Row row)
 {
 return resultify(query, Collections.singletonList(row));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 1e142e0..6351bb5 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.jav

[12/17] cassandra git commit: Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

2016-06-28 Thread slebresne
Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

* commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-3.9
Commit: 70059726f08a98ea21af91ce3855bf62f6f4b652
Parents: cb4540e 6555a87
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:19:08 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:19:57 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 11 +++
 8 files changed, 68 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/CHANGES.txt
--
diff --cc CHANGES.txt
index 314a93e,9f42d98..aaeafd6
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -9,38 -2,9 +9,39 @@@ Merged from 2.2
   * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
++ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
 + * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 + * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
 + * Avoid marking too many sstables as repaired (CASSANDRA-11696)
 + * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index da146ef,c702679..af94d3e
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -273,10 -288,10 +273,10 @@@ public class QueryProcessor 

[14/17] cassandra git commit: Merge commit '70059726f08a98ea21af91ce3855bf62f6f4b652' into cassandra-3.9

2016-06-28 Thread slebresne
Merge commit '70059726f08a98ea21af91ce3855bf62f6f4b652' into cassandra-3.9

* commit '70059726f08a98ea21af91ce3855bf62f6f4b652':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-3.9
Commit: d289778e4ecd2824562d18662e4cec0b68904ea9
Parents: 8b60fb7 7005972
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:20:26 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:20:26 2016 +0200

--

--




[11/17] cassandra git commit: Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

2016-06-28 Thread slebresne
Merge commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d' into cassandra-3.0

* commit '6555a87bde4daeb8bd5d9558595a367ec6bc061d':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/cassandra-3.0
Commit: 70059726f08a98ea21af91ce3855bf62f6f4b652
Parents: cb4540e 6555a87
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:19:08 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:19:57 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 11 +++
 8 files changed, 68 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/CHANGES.txt
--
diff --cc CHANGES.txt
index 314a93e,9f42d98..aaeafd6
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -9,38 -2,9 +9,39 @@@ Merged from 2.2
   * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
++ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
 + * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 + * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
 + * Avoid marking too many sstables as repaired (CASSANDRA-11696)
 + * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/70059726/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index da146ef,c702679..af94d3e
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -273,10 -288,10 +273,10 @@@ public class QueryProcessor 

[13/17] cassandra git commit: Merge commit '70059726f08a98ea21af91ce3855bf62f6f4b652' into cassandra-3.9

2016-06-28 Thread slebresne
Merge commit '70059726f08a98ea21af91ce3855bf62f6f4b652' into cassandra-3.9

* commit '70059726f08a98ea21af91ce3855bf62f6f4b652':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/trunk
Commit: d289778e4ecd2824562d18662e4cec0b68904ea9
Parents: 8b60fb7 7005972
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:20:26 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:20:26 2016 +0200

--

--




[01/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 2811f15bc -> 017ec3e99
  refs/heads/cassandra-2.2 3b448b337 -> 6555a87bd
  refs/heads/cassandra-3.0 cb4540ec2 -> 70059726f
  refs/heads/cassandra-3.9 8b60fb779 -> 53f8f0957
  refs/heads/trunk 9ff299e40 -> ad5b30eff


Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/cassandra-2.1
Commit: 017ec3e99e704db5e1a36ad153af08d6e7eca523
Parents: 2811f15
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:16:00 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5741241..feeaded 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d4ca76f..4340d42 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -296,7 +296,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -374,6 +374,32 @@ public class QueryProcessor implements QueryHandler
 }
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(long now, String 
query, Object... values)
+{
+try
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = 
select.executeInternal(internalQueryState(), makeInternalOptions(prepared, 
values), now);
+assert result instanceof ResultMessage.Rows;
+return 
UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+catch (RequestExecutionException e)
+{
+throw new RuntimeException(e);
+}
+catch (RequestValidationException e)
+{
+throw new RuntimeException("Error validating query " + query, e);
+}
+}
+
 public static UntypedResultSet resultify(String query, Row row)
 {
 return resultify(query, Collections.singletonList(row));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apa

[05/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/trunk
Commit: 017ec3e99e704db5e1a36ad153af08d6e7eca523
Parents: 2811f15
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:16:00 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5741241..feeaded 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d4ca76f..4340d42 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -296,7 +296,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -374,6 +374,32 @@ public class QueryProcessor implements QueryHandler
 }
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(long now, String 
query, Object... values)
+{
+try
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = 
select.executeInternal(internalQueryState(), makeInternalOptions(prepared, 
values), now);
+assert result instanceof ResultMessage.Rows;
+return 
UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+catch (RequestExecutionException e)
+{
+throw new RuntimeException(e);
+}
+catch (RequestValidationException e)
+{
+throw new RuntimeException("Error validating query " + query, e);
+}
+}
+
 public static UntypedResultSet resultify(String query, Row row)
 {
 return resultify(query, Collections.singletonList(row));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 1e142e0..6351bb5 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.jav

[16/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/cassandra-3.9
Commit: 53f8f09575dfbdc166b257fe71a4d4a832470253
Parents: d289778
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:21:05 2016 +0200

--
 CHANGES.txt   |  1 +
 .../org/apache/cassandra/cql3/QueryProcessor.java | 17 -
 .../cql3/statements/SelectStatement.java  |  6 +-
 .../org/apache/cassandra/db/SystemKeyspace.java   | 12 ++--
 .../apache/cassandra/service/StorageProxy.java|  4 +++-
 .../cassandra/service/paxos/PaxosState.java   | 11 +--
 .../cassandra/service/paxos/PrepareCallback.java  | 18 +-
 src/java/org/apache/cassandra/utils/UUIDGen.java  | 12 
 8 files changed, 69 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index cd13896..075d44a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 3.9
 Merged from 2.1:
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
 
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d812af4..04b 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -258,7 +258,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(cl, boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -331,6 +331,21 @@ public class QueryProcessor implements QueryHandler
 return null;
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(int nowInSec, String 
query, Object... values)
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = select.executeInternal(internalQueryState(), 
makeInternalOptions(prepared, values), nowInSec);
+assert result instanceof ResultMessage.Rows;
+return UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+
 public static UntypedResultSet resultify(String query, RowIterator 
partition)
 {
 return resultify(query, 
PartitionIterators.singletonIterator(partition));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/53f8f095/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 5f37e5e..f2b484e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -414,7 +414,11 @@ public class SelectStatement implements CQLStatement
 
 public ResultMessage.Rows executeInternal(QueryState state, QueryOptions 
options) throws RequestExecutionException, RequestValidationException
 {
-int nowInSec = FBUtilities.nowInSeconds();
+return executeI

[03/17] cassandra git commit: Avoid stalling Paxos when the paxos state expires

2016-06-28 Thread slebresne
Avoid stalling Paxos when the paxos state expires

This commit does 2 things:
- It ignores MRCs that are old enough to have expired in some nodes paxos tables
- It ensures the same timestamp is used when reading the paxos state and 
ignoring old MRC

patch by slebresne; reviewed by jasobraown for CASSANDRA-12043


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

Branch: refs/heads/cassandra-3.0
Commit: 017ec3e99e704db5e1a36ad153af08d6e7eca523
Parents: 2811f15
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Jun 22 12:12:37 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 28 15:16:00 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5741241..feeaded 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index d4ca76f..4340d42 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -296,7 +296,7 @@ public class QueryProcessor implements QueryHandler
 return QueryOptions.forInternalCalls(boundValues);
 }
 
-private static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
+public static ParsedStatement.Prepared prepareInternal(String query) 
throws RequestValidationException
 {
 ParsedStatement.Prepared prepared = internalStatements.get(query);
 if (prepared != null)
@@ -374,6 +374,32 @@ public class QueryProcessor implements QueryHandler
 }
 }
 
+/**
+ * A special version of executeInternal that takes the time used as "now" 
for the query in argument.
+ * Note that this only make sense for Selects so this only accept SELECT 
statements and is only useful in rare
+ * cases.
+ */
+public static UntypedResultSet executeInternalWithNow(long now, String 
query, Object... values)
+{
+try
+{
+ParsedStatement.Prepared prepared = prepareInternal(query);
+assert prepared.statement instanceof SelectStatement;
+SelectStatement select = (SelectStatement)prepared.statement;
+ResultMessage result = 
select.executeInternal(internalQueryState(), makeInternalOptions(prepared, 
values), now);
+assert result instanceof ResultMessage.Rows;
+return 
UntypedResultSet.create(((ResultMessage.Rows)result).result);
+}
+catch (RequestExecutionException e)
+{
+throw new RuntimeException(e);
+}
+catch (RequestValidationException e)
+{
+throw new RuntimeException("Error validating query " + query, e);
+}
+}
+
 public static UntypedResultSet resultify(String query, Row row)
 {
 return resultify(query, Collections.singletonList(row));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/017ec3e9/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 1e142e0..6351bb5 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.jav

[09/17] cassandra git commit: Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

2016-06-28 Thread slebresne
Merge commit '017ec3e99e704db5e1a36ad153af08d6e7eca523' into cassandra-2.2

* commit '017ec3e99e704db5e1a36ad153af08d6e7eca523':
  Avoid stalling Paxos when the paxos state expires


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

Branch: refs/heads/trunk
Commit: 6555a87bde4daeb8bd5d9558595a367ec6bc061d
Parents: 3b448b3 017ec3e
Author: Sylvain Lebresne 
Authored: Tue Jun 28 15:17:40 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 28 15:18:27 2016 +0200

--
 CHANGES.txt |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 28 +++-
 .../cql3/statements/SelectStatement.java|  6 -
 .../org/apache/cassandra/db/SystemKeyspace.java |  6 ++---
 .../apache/cassandra/service/StorageProxy.java  |  2 +-
 .../cassandra/service/paxos/PaxosState.java | 11 ++--
 .../service/paxos/PrepareCallback.java  | 18 -
 7 files changed, 63 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/CHANGES.txt
--
diff --cc CHANGES.txt
index 8d2062d,feeaded..9f42d98
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,36 @@@
 -2.1.15
 +2.2.7
 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
+  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
   * Remove finished incoming streaming connections from MessagingService 
(CASSANDRA-11854)
   * Don't try to get sstables for non-repairing column families 
(CASSANDRA-12077)
   * Prevent select statements with clustering key > 64k (CASSANDRA-11882)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6555a87b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index fa82fa7,4340d42..c702679
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -331,15 -354,52 +331,41 @@@ public class QueryProcessor implements 
   */
  public static UntypedResultSet executeOnceInternal(String query, 
Object... values)
  {
 -try
 -{
 -ParsedStatement.Prepared prepared = parseStatement(query, 

[21/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/cql/definitions.rst
--
diff --git a/doc/source/cql/definitions.rst b/doc/source/cql/definitions.rst
new file mode 100644
index 000..61ed47c
--- /dev/null
+++ b/doc/source/cql/definitions.rst
@@ -0,0 +1,225 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+Definitions
+---
+
+.. _conventions:
+
+Conventions
+^^^
+
+To aid in specifying the CQL syntax, we will use the following conventions in 
this document:
+
+- Language rules will be given in an informal `BNF variant
+  `_ notation. 
In particular, we'll use square brakets
+  (``[ item ]``) for optional items, ``*`` and ``+`` for repeated items (where 
``+`` imply at least one).
+- The grammar will also use the following convention for convenience: 
non-terminal term will be lowercase (and link to
+  their definition) while terminal keywords will be provided "all caps". Note 
however that keywords are
+  :ref:`identifiers` and are thus case insensitive in practice. We will also 
define some early construction using
+  regexp, which we'll indicate with ``re()``.
+- The grammar is provided for documentation purposes and leave some minor 
details out.  For instance, the comma on the
+  last column definition in a ``CREATE TABLE`` statement is optional but 
supported if present even though the grammar in
+  this document suggests otherwise. Also, not everything accepted by the 
grammar is necessarily valid CQL.
+- References to keywords or pieces of CQL code in running text will be shown 
in a ``fixed-width font``.
+
+
+.. _identifiers:
+
+Identifiers and keywords
+
+
+The CQL language uses *identifiers* (or *names*) to identify tables, columns 
and other objects. An identifier is a token
+matching the regular expression ``[a-zA-Z][a-zA-Z0-9_]*``.
+
+A number of such identifiers, like ``SELECT`` or ``WITH``, are *keywords*. 
They have a fixed meaning for the language
+and most are reserved. The list of those keywords can be found in 
:ref:`appendix-A`.
+
+Identifiers and (unquoted) keywords are case insensitive. Thus ``SELECT`` is 
the same than ``select`` or ``sElEcT``, and
+``myId`` is the same than ``myid`` or ``MYID``. A convention often used (in 
particular by the samples of this
+documentation) is to use upper case for keywords and lower case for other 
identifiers.
+
+There is a second kind of identifiers called *quoted identifiers* defined by 
enclosing an arbitrary sequence of
+characters (non empty) in double-quotes(``"``). Quoted identifiers are never 
keywords. Thus ``"select"`` is not a
+reserved keyword and can be used to refer to a column (note that using this is 
particularly advised), while ``select``
+would raise a parsing error. Also, contrarily to unquoted identifiers and 
keywords, quoted identifiers are case
+sensitive (``"My Quoted Id"`` is *different* from ``"my quoted id"``). A fully 
lowercase quoted identifier that matches
+``[a-zA-Z][a-zA-Z0-9_]*`` is however *equivalent* to the unquoted identifier 
obtained by removing the double-quote (so
+``"myid"`` is equivalent to ``myid`` and to ``myId`` but different from 
``"myId"``).  Inside a quoted identifier, the
+double-quote character can be repeated to escape it, so ``"foo "" bar"`` is a 
valid identifier.
+
+.. note:: *quoted identifiers* allows to declare columns with arbitrary names, 
and those can sometime clash with
+   specific names used by the server. For instance, when using conditional 
update, the server will respond with a
+   result-set containing a special result named ``"[applied]"``. If you’ve 
declared a column with such a name, this
+   could potentially confuse some tools and should be avoided. In general, 
unquoted identifiers should be preferred but
+   if you use quoted identifiers, it is strongly advised to avoid any name 
enclosed by squared brackets (like
+   ``"[applied]"``) and any name that looks like a function call (like 
``"f(x)"``).
+
+More formally, we have:
+
+.. productionlist::
+   identifier: `unquoted_identifier` | `quoted_identifier`
+   

[19/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/getting_started.rst
--
diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst
deleted file mode 100644
index b20376a..000
--- a/doc/source/getting_started.rst
+++ /dev/null
@@ -1,269 +0,0 @@
-.. Licensed to the Apache Software Foundation (ASF) under one
-.. or more contributor license agreements.  See the NOTICE file
-.. distributed with this work for additional information
-.. regarding copyright ownership.  The ASF licenses this file
-.. to you under the Apache License, Version 2.0 (the
-.. "License"); you may not use this file except in compliance
-.. with the License.  You may obtain a copy of the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS,
-.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-.. See the License for the specific language governing permissions and
-.. limitations under the License.
-
-.. highlight:: none
-
-Getting Started
-===
-
-Installing Cassandra
-
-
-Prerequisites
-^
-
-- The latest version of Java 8, either the `Oracle Java Standard Edition 8
-  `__ or 
`OpenJDK 8 `__. To
-  verify that you have the correct version of java installed, type ``java 
-version``.
-
-- For using cqlsh, the latest version of `Python 2.7 
`__. To verify that you have
-  the correct version of Python installed, type ``python --version``.
-
-Installation from binary tarball files
-^^
-
-- Download the latest stable release from the `Apache Cassandra downloads 
website `__.
-
-- Untar the file somewhere, for example:
-
-::
-
-tar -xvf apache-cassandra-3.6-bin.tar.gz cassandra
-
-The files will be extracted into ``apache-cassandra-3.6``, you need to 
substitute 3.6 with the release number that you
-have downloaded.
-
-- Optionally add ``apache-cassandra-3.6\bin`` to your path.
-- Start Cassandra in the foreground by invoking ``bin/cassandra -f`` from the 
command line. Press "Control-C" to stop
-  Cassandra. Start Cassandra in the background by invoking ``bin/cassandra`` 
from the command line. Invoke ``kill pid``
-  or ``pkill -f CassandraDaemon`` to stop Cassandra, where pid is the 
Cassandra process id, which you can find for
-  example by invoking ``pgrep -f CassandraDaemon``.
-- Verify that Cassandra is running by invoking ``bin/nodetool status`` from 
the command line.
-- Configuration files are located in the ``conf`` sub-directory.
-- Since Cassandra 2.1, log and data directories are located in the ``logs`` 
and ``data`` sub-directories respectively.
-  Older versions defaulted to ``/var/log/cassandra`` and 
``/var/lib/cassandra``. Due to this, it is necessary to either
-  start Cassandra with root privileges or change ``conf/cassandra.yaml`` to 
use directories owned by the current user,
-  as explained below in the section on changing the location of directories.
-
-Installation from Debian packages
-^
-
-- Add the Apache repository of Cassandra to 
``/etc/apt/sources.list.d/cassandra.sources.list``, for example for version
-  3.6:
-
-::
-
-echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee 
-a /etc/apt/sources.list.d/cassandra.sources.list
-
-- Update the repositories:
-
-::
-
-sudo apt-get update
-
-- If you encounter this error:
-
-::
-
-GPG error: http://www.apache.org 36x InRelease: The following signatures 
couldn't be verified because the public key is not available: NO_PUBKEY 
749D6EEC0353B12C
-
-Then add the public key 749D6EEC0353B12C as follows:
-
-::
-
-gpg --keyserver pgp.mit.edu --recv-keys 749D6EEC0353B12C
-gpg --export --armor 749D6EEC0353B12C | sudo apt-key add -
-
-and repeat ``sudo apt-get update``. The actual key may be different, you get 
it from the error message itself. For a
-full list of Apache contributors public keys, you can refer to `this link 
`__.
-
-- Install Cassandra:
-
-::
-
-sudo apt-get install cassandra
-
-- You can start Cassandra with ``sudo service cassandra start`` and stop it 
with ``sudo service cassandra stop``.
-  However, normally the service will start automatically. For this reason be 
sure to stop it if you need to make any
-  configuration changes.
-- Verify that Cassandra is running by invoking ``nodetool status`` from the 
command line.
-- The default location of configuration files is ``/etc/cassandra``.
-- The default location of log and data directories is ``/var/log/cassandra/`` 
and ``/var/lib/cassandra``.
-

[28/34] cassandra git commit: Finish fixing the CQL doc

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/source/cql/functions.rst
--
diff --git a/doc/source/cql/functions.rst b/doc/source/cql/functions.rst
index cf52ace..efcdf32 100644
--- a/doc/source/cql/functions.rst
+++ b/doc/source/cql/functions.rst
@@ -16,109 +16,113 @@
 
 .. highlight:: sql
 
-.. _cql_functions:
+.. _cql-functions:
+
+.. Need some intro for UDF and native functions in general and point those to 
it.
+.. _udfs:
+.. _native-functions:
 
 Functions
 -
 
-CQL3 distinguishes between built-in functions (so called ‘native
-functions’) and `user-defined functions <#udfs>`__. CQL3 includes
-several native functions, described below:
+CQL supports 2 main categories of functions:
+
+- the :ref:`scalar functions `, which simply take a number 
of values and produce an output with it.
+- the :ref:`aggregate functions `, which are used to 
aggregate multiple rows results from a
+  ``SELECT`` statement.
+
+In both cases, CQL provides a number of native "hard-coded" functions as well 
as the ability to create new user-defined
+functions.
+
+.. note:: By default, the use of user-defined functions is disabled by default 
for security concerns (even when
+   enabled, the execution of user-defined functions is sandboxed and a "rogue" 
function should not be allowed to do
+   evil, but no sandbox is perfect so using user-defined functions is opt-in). 
See the ``enable_user_defined_functions``
+   in ``cassandra.yaml`` to enable them.
+
+.. _scalar-functions:
 
 Scalar functions
 
 
+.. _scalar-native-functions:
+
 Native functions
 
 
 Cast
 
 
-The ``cast`` function can be used to converts one native datatype to
-another.
-
-The following table describes the conversions supported by the ``cast``
-function. Cassandra will silently ignore any cast converting a datatype
-into its own datatype.
-
-+-+-+
-| from| to 
 |
-+=+=+
-| ``ascii``   | ``text``, ``varchar``  
 |
-+-+-+
-| ``bigint``  | ``tinyint``, ``smallint``, ``int``, ``float``, ``double``, 
``decimal``, ``varint``, ``text``, ``varchar``   |
-+-+-+
-| ``boolean`` | ``text``, ``varchar``  
 |
-+-+-+
-| ``counter`` | ``tinyint``, ``smallint``, ``int``, ``bigint``, ``float``, 
``double``, ``decimal``, ``varint``, ``text``, ``varchar``   |
-+-+-+
-| ``date``| ``timestamp``  
 |
-+-+-+
-| ``decimal`` | ``tinyint``, ``smallint``, ``int``, ``bigint``, ``float``, 
``double``, ``varint``, ``text``, ``varchar``|
-+-+-+
-| ``double``  | ``tinyint``, ``smallint``, ``int``, ``bigint``, ``float``, 
``decimal``, ``varint``, ``text``, ``varchar``   |
-+-+-+
-| ``float``   | ``tinyint``, ``smallint``, ``int``, ``bigint``, 
``double``, ``decimal``, ``varint``, ``text``, ``varchar``  |
-+-+-+
-| ``inet``| ``text``, ``varchar``  
 |
-+-+-+
-| ``int`` | 

[33/34] cassandra git commit: Modify build file to include html doc in artifacts

2016-06-27 Thread slebresne
Modify build file to include html doc in artifacts


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

Branch: refs/heads/trunk
Commit: 5cefe503e0b529ef3d6b81c467de93d39e77a97d
Parents: 7988b3f
Author: Sylvain Lebresne 
Authored: Mon Jun 27 20:31:43 2016 +0200
Committer: Sylvain Lebresne 
Committed: Mon Jun 27 20:31:43 2016 +0200

--
 build.xml | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cefe503/build.xml
--
diff --git a/build.xml b/build.xml
index 51f7252..8946ea3 100644
--- a/build.xml
+++ b/build.xml
@@ -1021,7 +1021,7 @@
 
 
 
-
   
   
@@ -1041,9 +1041,15 @@
   
   
 
-  
+  
+  
+  
 
   
+  
+
+
+  
   
 
   



[31/34] cassandra git commit: Fix minor errors in CQL doc

2016-06-27 Thread slebresne
Fix minor errors in CQL doc


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

Branch: refs/heads/trunk
Commit: 02d262146930c7dda7d2bebe9363a06de504c5aa
Parents: 0e62423
Author: Sylvain Lebresne 
Authored: Mon Jun 27 12:18:35 2016 +0200
Committer: Sylvain Lebresne 
Committed: Mon Jun 27 15:02:05 2016 +0200

--
 doc/source/cql/ddl.rst | 39 +
 doc/source/cql/definitions.rst |  6 +++---
 doc/source/cql/dml.rst | 13 +++--
 doc/source/cql/indexes.rst |  8 
 doc/source/cql/mvs.rst |  6 ++
 doc/source/cql/triggers.rst|  6 ++
 6 files changed, 52 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d26214/doc/source/cql/ddl.rst
--
diff --git a/doc/source/cql/ddl.rst b/doc/source/cql/ddl.rst
index 948298b..7f3431a 100644
--- a/doc/source/cql/ddl.rst
+++ b/doc/source/cql/ddl.rst
@@ -50,6 +50,11 @@ Further, a table is always part of a keyspace and a table 
name can be provided f
 part of. If is is not fully-qualified, the table is assumed to be in the 
*current* keyspace (see :ref:`USE statement
 `).
 
+Further, the valid names for columns is simply defined as:
+
+.. productionlist::
+   column_name: `identifier`
+
 We also define the notion of statement options for use in the following 
section:
 
 .. productionlist::
@@ -164,15 +169,15 @@ Creating a new table uses the ``CREATE TABLE`` statement:
  : ( ',' `column_definition` )*
  : [ ',' PRIMARY KEY '(' `primary_key` ')' ]
  : ')' [ WITH `table_options` ]
-   column_definition: `identifier` `cql_type` [ STATIC ] [ PRIMARY KEY]
+   column_definition: `column_name` `cql_type` [ STATIC ] [ PRIMARY KEY]
primary_key: `partition_key` [ ',' `clustering_columns` ]
-   partition_key: `identifier`
-: | '(' `identifier` ( ',' `identifier` )* ')'
-   clustering_columns: `identifier` ( ',' `identifier` )*
+   partition_key: `column_name`
+: | '(' `column_name` ( ',' `column_name` )* ')'
+   clustering_columns: `column_name` ( ',' `column_name` )*
table_options: COMPACT STORAGE [ AND `table_options` ]
: | CLUSTERING ORDER BY '(' `clustering_order` ')' [ AND 
`table_options` ]
: | `options`
-   clustering_order: `identifier` (ASC | DESC) ( ',' `identifier` (ASC | DESC) 
)*
+   clustering_order: `column_name` (ASC | DESC) ( ',' `column_name` (ASC | 
DESC) )*
 
 For instance::
 
@@ -554,9 +559,9 @@ Altering an existing table uses the ``ALTER TABLE`` 
statement:
 
 .. productionlist::
alter_table_statement: ALTER TABLE `table_name` `alter_table_instruction`
-   alter_table_instruction: ALTER `identifier` TYPE `cql_type`
-  : | ADD `identifier` `cql_type` ( ',' `identifier` 
`cql_type` )*
-  : | DROP `identifier` ( `identifier` )*
+   alter_table_instruction: ALTER `column_name` TYPE `cql_type`
+  : | ADD `column_name` `cql_type` ( ',' `column_name` 
`cql_type` )*
+  : | DROP `column_name` ( `column_name` )*
   : | WITH `options`
 
 For instance::
@@ -631,15 +636,15 @@ CQL data types may be converted only as the following 
table.
 
 Clustering columns have stricter requirements, only the following conversions 
are allowed:
 
-++---+
-| Existing type  | Can be altered to |
-++===+
-| ascii, text, varchar   | blob  |
-++---+
-| ascii, varchar | text  |
-++---+
-| ascii, text| varchar   |
-++---+
+++--+
+| Existing type  | Can be altered to|
+++==+
+| ascii, text, varchar   | blob |
+++--+
+| ascii, varchar | text |
+++--+
+| ascii, text| varchar  |
+++--+
 
 .. _drop-table-statement:
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d26214/doc/source/cql/definitions.rst
--
diff --git 

[29/34] cassandra git commit: Finish fixing the CQL doc

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/source/cql/dml.rst
--
diff --git a/doc/source/cql/dml.rst b/doc/source/cql/dml.rst
index 4cf34eb..58fdb05 100644
--- a/doc/source/cql/dml.rst
+++ b/doc/source/cql/dml.rst
@@ -21,586 +21,478 @@
 Data Manipulation
 -
 
+This section describes the statements supported by CQL to insert, update, 
delete and query data.
+
+.. _select-statement:
+
 SELECT
 ^^
 
-*Syntax:*
+Querying data from data is done using a ``SELECT`` statement:
 
-| bc(syntax)..
-|  ::= SELECT ( JSON )? 
-|  FROM 
-|  ( WHERE )?
-|  ( ORDER BY )?
-|  ( PER PARTITION LIMIT )?
-|  ( LIMIT )?
-|  ( ALLOW FILTERING )?
+.. productionlist::
+   select_statement: SELECT [ JSON | DISTINCT ] ( `select_clause` | '*' )
+   : FROM `table_name`
+   : [ WHERE `where_clause` ]
+   : [ ORDER BY `ordering_clause` ]
+   : [ PER PARTITION LIMIT (`integer` | `bind_marker`) ]
+   : [ LIMIT (`integer` | `bind_marker`) ]
+   : [ ALLOW FILTERING ]
+   select_clause: `selector` [ AS `identifier` ] ( ',' `selector` [ AS 
`identifier` ] )
+   selector: `identifier`
+   : | `term`
+   : | CAST '(' `selector` AS `cql_type` ')'
+   : | `function_name` '(' [ `selector` ( ',' `selector` )* ] ')'
+   : | COUNT '(' '*' ')'
+   where_clause: `relation` ( AND `relation` )*
+   relation: `identifier` `operator` `term`
+   : '(' `identifier` ( ',' `identifier` )* ')' `operator` 
`tuple_literal`
+   : TOKEN '(' `identifier` ( ',' `identifier` )* ')' `operator` `term`
+   operator: '=' | '<' | '>' | '<=' | '>=' | '!=' | IN | CONTAINS | CONTAINS 
KEY
+   ordering_clause: `identifier` [ ASC | DESC ] ( ',' `identifier` [ ASC | 
DESC ] )*
 
-|  ::= DISTINCT? 
-|  \| COUNT ‘(’ ( ‘\*’ \| ‘1’ ) ‘)’ (AS )?
+For instance::
 
-|  ::= (AS )? ( ‘,’ (AS )? )\*
-|  \| ‘\*’
+SELECT name, occupation FROM users WHERE userid IN (199, 200, 207);
+SELECT JSON name, occupation FROM users WHERE userid = 199;
+SELECT name AS user_name, occupation AS user_occupation FROM users;
 
-|  ::= 
-|  \| WRITETIME ‘(’ ‘)’
-|  \| TTL ‘(’ ‘)’
-|  \| CAST ‘(’ AS ‘)’
-|  \| ‘(’ ( (‘,’ )\*)? ‘)’
+SELECT time, value
+FROM events
+WHERE event_type = 'myEvent'
+  AND time > '2011-02-03'
+  AND time <= '2012-01-01'
 
- ::= ( AND )\*
+SELECT COUNT (*) AS user_count FROM users;
 
-|  ::= 
-|  \| ‘(’ (‘,’ )\* ‘)’ 
-|  \| IN ‘(’ ( ( ‘,’ )\* )? ‘)’
-|  \| ‘(’ (‘,’ )\* ‘)’ IN ‘(’ ( ( ‘,’ )\* )? ‘)’
-|  \| TOKEN ‘(’ ( ‘,’ )\* ‘)’ 
+The ``SELECT`` statements reads one or more columns for one or more rows in a 
table. It returns a result-set of the rows
+matching the request, where each row contains the values for the selection 
corresponding to the query. Additionally,
+:ref:`functions ` including :ref:`aggregation 
` ones can be applied to the result.
 
-|  ::= ‘=’ \| ‘<’ \| ‘>’ \| ‘<=’ \| ‘>=’ \| CONTAINS \| 
CONTAINS KEY
-|  ::= ( ‘,’ )\*
-|  ::= ( ASC \| DESC )?
-|  ::= ‘(’ (‘,’ )\* ‘)’
-| p.
-| *Sample:*
+A ``SELECT`` statement contains at least a :ref:`selection clause 
` and the name of the table on which
+the selection is on (note that CQL does **not** joins or sub-queries and thus 
a select statement only apply to a single
+table). In most case, a select will also have a :ref:`where clause 
` and it can optionally have additional
+clauses to :ref:`order ` or :ref:`limit ` the 
results. Lastly, :ref:`queries that require
+filtering ` can be allowed if the ``ALLOW FILTERING`` flag is 
provided.
+
+.. _selection-clause:
 
-| bc(sample)..
-| SELECT name, occupation FROM users WHERE userid IN (199, 200, 207);
+Selection clause
+
 
-SELECT JSON name, occupation FROM users WHERE userid = 199;
+The :token:`select_clause` determines which columns needs to be queried and 
returned in the result-set, as well as any
+transformation to apply to this result before returning. It consists of a 
comma-separated list of *selectors* or,
+alternatively, of the wildcard character (``*``) to select all the columns 
defined in the table.
 
-SELECT name AS user\_name, occupation AS user\_occupation FROM users;
+Selectors
+`
 
-| SELECT time, value
-| FROM events
-| WHERE event\_type = ‘myEvent’
-|  AND time > ‘2011-02-03’
-|  AND time <= ‘2012-01-01’
+A :token:`selector` can be one of:
 
-SELECT COUNT (\*) FROM users;
+- A column name of the table selected, to retrieve the values for that column.
+- A term, which is usually used nested inside other selectors like functions 
(if a term is selected directly, then the
+  corresponding column of the result-set will simply have the value of this 
term for every row returned).
+- A 

[34/34] cassandra git commit: Merge branch 'doc_in_tree' into trunk

2016-06-27 Thread slebresne
Merge branch 'doc_in_tree' into trunk

* doc_in_tree:
  Modify build file to include html doc in artifacts
  Add 'report bug' section
  Fix minor errors in CQL doc
  Finish fixing the CQL doc
  Don't track auto-generated file
  Reorganize document
  Automatically generate docs for cassandra.yaml
  Fix CQL doc (incomplete)
  Add Metrics/Monitoring docs
  Add Change Data Capture documentation
  Docs for Memtable and SSTable architecture
  Add doc on compaction
  Add initial version of security section
  Fill in Replication, Tuneable Consistency sections
  Add docs for cqlsh
  Add snitch and range movements section on Operations
  Add initial in-tree documentation (very incomplete so far)


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

Branch: refs/heads/trunk
Commit: c7b9401bf81d1bca12a802306576805053c0212b
Parents: 48e4d5d 5cefe50
Author: Sylvain Lebresne 
Authored: Mon Jun 27 20:33:21 2016 +0200
Committer: Sylvain Lebresne 
Committed: Mon Jun 27 20:33:21 2016 +0200

--
 .gitignore  |   3 +
 build.xml   |  23 +-
 conf/cassandra.yaml | 222 +++---
 doc/Makefile| 256 +++
 doc/README.md   |  31 +
 doc/convert_yaml_to_rst.py  | 144 
 doc/cql3/CQL.textile|   4 +-
 doc/make.bat| 281 
 doc/source/_static/extra.css|  43 ++
 doc/source/_templates/indexcontent.html |  33 +
 doc/source/architecture/dynamo.rst  | 137 
 doc/source/architecture/guarantees.rst  |  20 +
 doc/source/architecture/index.rst   |  29 +
 doc/source/architecture/overview.rst|  20 +
 doc/source/architecture/storage_engine.rst  |  82 +++
 doc/source/bugs.rst |  31 +
 doc/source/conf.py  | 432 
 doc/source/configuration/index.rst  |  25 +
 doc/source/contactus.rst|  53 ++
 doc/source/cql/appendices.rst   | 308 +
 doc/source/cql/changes.rst  | 189 ++
 doc/source/cql/ddl.rst  | 677 +++
 doc/source/cql/definitions.rst  | 230 +++
 doc/source/cql/dml.rst  | 499 ++
 doc/source/cql/functions.rst| 553 +++
 doc/source/cql/index.rst|  47 ++
 doc/source/cql/indexes.rst  |  83 +++
 doc/source/cql/json.rst | 112 +++
 doc/source/cql/mvs.rst  | 166 +
 doc/source/cql/security.rst | 497 ++
 doc/source/cql/triggers.rst |  63 ++
 doc/source/cql/types.rst| 518 ++
 doc/source/data_modeling/index.rst  |  20 +
 doc/source/faq/index.rst|  20 +
 doc/source/getting_started/configuring.rst  |  67 ++
 doc/source/getting_started/drivers.rst  | 107 +++
 doc/source/getting_started/index.rst|  33 +
 doc/source/getting_started/installing.rst   |  99 +++
 doc/source/getting_started/querying.rst |  52 ++
 doc/source/index.rst|  40 ++
 doc/source/operating/backups.rst|  22 +
 doc/source/operating/bloom_filters.rst  |  65 ++
 doc/source/operating/cdc.rst|  89 +++
 doc/source/operating/compaction.rst | 432 
 doc/source/operating/compression.rst|  94 +++
 doc/source/operating/hardware.rst   |  87 +++
 doc/source/operating/hints.rst  |  22 +
 doc/source/operating/index.rst  |  38 ++
 doc/source/operating/metrics.rst| 619 +
 doc/source/operating/read_repair.rst|  22 +
 doc/source/operating/repair.rst |  22 +
 doc/source/operating/security.rst   | 410 +++
 doc/source/operating/snitch.rst |  78 +++
 doc/source/operating/topo_changes.rst   | 122 
 doc/source/tools/cqlsh.rst  | 455 +
 doc/source/tools/index.rst  |  26 +
 doc/source/tools/nodetool.rst   |  22 +
 doc/source/troubleshooting/index.rst|  20 +
 .../cql3/statements/CreateViewStatement.java|   7 +-
 59 files changed, 8816 insertions(+), 85 deletions(-)

[30/34] cassandra git commit: Finish fixing the CQL doc

2016-06-27 Thread slebresne
Finish fixing the CQL doc


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

Branch: refs/heads/trunk
Commit: 0e624238c15558155a57bcfa7ada9b3b84067658
Parents: 7dfb25e
Author: Sylvain Lebresne 
Authored: Fri Jun 24 17:01:37 2016 +0200
Committer: Sylvain Lebresne 
Committed: Fri Jun 24 17:01:37 2016 +0200

--
 .gitignore  |   2 +-
 doc/convert_yaml_to_rst.py  |   2 +-
 doc/source/cql/appendices.rst   |   2 -
 doc/source/cql/changes.rst  | 242 ++---
 doc/source/cql/ddl.rst  | 232 +++--
 doc/source/cql/definitions.rst  |  27 +-
 doc/source/cql/dml.rst  | 964 ---
 doc/source/cql/functions.rst| 890 -
 doc/source/cql/index.rst|   2 -
 doc/source/cql/indexes.rst  |  93 +-
 doc/source/cql/json.rst | 168 ++--
 doc/source/cql/mvs.rst  | 183 ++--
 doc/source/cql/security.rst | 768 ++-
 doc/source/cql/triggers.rst |  48 +-
 doc/source/cql/types.rst|   6 +-
 doc/source/operating/compaction.rst |   8 +-
 doc/source/operating/security.rst   |  10 +-
 .../cql3/statements/CreateViewStatement.java|   9 +-
 18 files changed, 1626 insertions(+), 2030 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 4f33eda..f5b1ce1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,4 +74,4 @@ lib/jsr223/scala/*.jar
 /.ant-targets-build.xml
 
 # Generated files from the documentation
-doc/source/cassandra_config_file.rst
+doc/source/configuration/cassandra_config_file.rst

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/convert_yaml_to_rst.py
--
diff --git a/doc/convert_yaml_to_rst.py b/doc/convert_yaml_to_rst.py
index 398295d..fee6d8c 100644
--- a/doc/convert_yaml_to_rst.py
+++ b/doc/convert_yaml_to_rst.py
@@ -59,7 +59,7 @@ def convert(yaml_file, dest_file):
 
 with open(dest_file, 'w') as outfile:
 outfile.write("Cassandra Configuration File\n")
-outfile.write("=\n")
+outfile.write("\n")
 
 # since comments preceed an option, this holds all of the comment
 # lines we've seen since the last option

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/source/cql/appendices.rst
--
diff --git a/doc/source/cql/appendices.rst b/doc/source/cql/appendices.rst
index 9788a56..c4bb839 100644
--- a/doc/source/cql/appendices.rst
+++ b/doc/source/cql/appendices.rst
@@ -300,8 +300,6 @@ names as their name.
 +-+
 | ``complex`` |
 +-+
-| ``date``|
-+-+
 | ``enum``|
 +-+
 | ``interval``|

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/source/cql/changes.rst
--
diff --git a/doc/source/cql/changes.rst b/doc/source/cql/changes.rst
index 9549f8f..263df13 100644
--- a/doc/source/cql/changes.rst
+++ b/doc/source/cql/changes.rst
@@ -24,234 +24,166 @@ The following describes the changes in each version of 
CQL.
 3.4.2
 ^
 
--  ```INSERT/UPDATE options`` <#updateOptions>`__ for tables having a
-   default\_time\_to\_live specifying a TTL of 0 will remove the TTL
-   from the inserted or updated values
--  ```ALTER TABLE`` <#alterTableStmt>`__ ``ADD`` and ``DROP`` now allow
-   mutiple columns to be added/removed
--  New ```PER PARTITION LIMIT`` <#selectLimit>`__ option (see
-   `CASSANDRA-7017 `__.
--  `User-defined functions <#udfs>`__ can now instantiate ``UDTValue``
-   and ``TupleValue`` instances via the new ``UDFContext`` interface
-   (see
-   `CASSANDRA-10818 
`__.
--  “User-defined types”#createTypeStmt may now be stored in a non-frozen
-   form, allowing individual fields to be updated and deleted in
-   ```UPDATE`` statements <#updateStmt>`__ and ```DELETE``
-   statements <#deleteStmt>`__, respectively.
-   (`CASSANDRA-7423 

[10/34] cassandra git commit: Docs for Memtable and SSTable architecture

2016-06-27 Thread slebresne
Docs for Memtable and SSTable architecture


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

Branch: refs/heads/trunk
Commit: 7bf837cae0a24f72428becb739102521042ed0ad
Parents: 8d2bd0d
Author: Tyler Hobbs 
Authored: Fri Jun 17 15:10:09 2016 -0500
Committer: Sylvain Lebresne 
Committed: Tue Jun 21 14:12:59 2016 +0200

--
 doc/source/architecture.rst | 53 ++--
 1 file changed, 51 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7bf837ca/doc/source/architecture.rst
--
diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst
index 3f8a8ca..cb52477 100644
--- a/doc/source/architecture.rst
+++ b/doc/source/architecture.rst
@@ -145,20 +145,69 @@ throughput, latency, and availability.
 Storage Engine
 --
 
+.. _commit-log:
+
 CommitLog
 ^
 
 .. todo:: todo
 
+.. _memtables:
+
 Memtables
 ^
 
-.. todo:: todo
+Memtables are in-memory structures where Cassandra buffers writes.  In 
general, there is one active memtable per table.
+Eventually, memtables are flushed onto disk and become immutable `SSTables`_.  
This can be triggered in several
+ways:
+
+- The memory usage of the memtables exceeds the configured threshold  (see 
``memtable_cleanup_threshold``)
+- The :ref:`commit-log` approaches its maximum size, and forces memtable 
flushes in order to allow commitlog segments to
+  be freed
+
+Memtables may be stored entirely on-heap or partially off-heap, depending on 
``memtable_allocation_type``.
 
 SSTables
 
 
-.. todo:: todo
+SSTables are the immutable data files that Cassandra uses for persisting data 
on disk.
+
+As SSTables are flushed to disk from :ref:`memtables` or are streamed from 
other nodes, Cassandra triggers compactions
+which combine multiple SSTables into one.  Once the new SSTable has been 
written, the old SSTables can be removed.
+
+Each SSTable is comprised of multiple components stored in separate files:
+
+``Data.db``
+  The actual data, i.e. the contents of rows.
+
+``Index.db``
+  An index from partition keys to positions in the ``Data.db`` file.  For wide 
partitions, this may also include an
+  index to rows within a partition.
+
+``Summary.db``
+  A sampling of (by default) every 128th entry in the ``Index.db`` file.
+
+``Filter.db``
+  A Bloom Filter of the partition keys in the SSTable.
+
+``CompressionInfo.db``
+  Metadata about the offsets and lengths of compression chunks in the 
``Data.db`` file.
+
+``Statistics.db``
+  Stores metadata about the SSTable, including information about timestamps, 
tombstones, clustering keys, compaction,
+  repair, compression, TTLs, and more.
+
+``Digest.crc32``
+  A CRC-32 digest of the ``Data.db`` file.
+
+``TOC.txt``
+  A plain text list of the component files for the SSTable.
+
+Within the ``Data.db`` file, rows are organized by partition.  These 
partitions are sorted in token order (i.e. by a
+hash of the partition key when the default partitioner, ``Murmur3Partition``, 
is used).  Within a partition, rows are
+stored in the order of their clustering keys.
+
+SSTables can be optionally compressed using block-based compression.
 
 Guarantees
 --



[22/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/cql/appendices.rst
--
diff --git a/doc/source/cql/appendices.rst b/doc/source/cql/appendices.rst
new file mode 100644
index 000..9788a56
--- /dev/null
+++ b/doc/source/cql/appendices.rst
@@ -0,0 +1,310 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+.. highlight:: sql
+
+Appendices
+--
+
+.. _appendix-A:
+
+Appendix A: CQL Keywords
+
+
+CQL distinguishes between *reserved* and *non-reserved* keywords.
+Reserved keywords cannot be used as identifier, they are truly reserved
+for the language (but one can enclose a reserved keyword by
+double-quotes to use it as an identifier). Non-reserved keywords however
+only have a specific meaning in certain context but can used as
+identifier otherwise. The only *raison d’être* of these non-reserved
+keywords is convenience: some keyword are non-reserved when it was
+always easy for the parser to decide whether they were used as keywords
+or not.
+
+++-+
+| Keyword| Reserved?   |
+++=+
+| ``ADD``| yes |
+++-+
+| ``AGGREGATE``  | no  |
+++-+
+| ``ALL``| no  |
+++-+
+| ``ALLOW``  | yes |
+++-+
+| ``ALTER``  | yes |
+++-+
+| ``AND``| yes |
+++-+
+| ``APPLY``  | yes |
+++-+
+| ``AS`` | no  |
+++-+
+| ``ASC``| yes |
+++-+
+| ``ASCII``  | no  |
+++-+
+| ``AUTHORIZE``  | yes |
+++-+
+| ``BATCH``  | yes |
+++-+
+| ``BEGIN``  | yes |
+++-+
+| ``BIGINT`` | no  |
+++-+
+| ``BLOB``   | no  |
+++-+
+| ``BOOLEAN``| no  |
+++-+
+| ``BY`` | yes |
+++-+
+| ``CALLED`` | no  |
+++-+
+| ``CLUSTERING`` | no  |
+++-+
+| ``COLUMNFAMILY``   | yes |
+++-+
+| ``COMPACT``| no  |
+++-+
+| ``CONTAINS``   | no  |
+++-+
+| ``COUNT``  | no  |
+++-+
+| ``COUNTER``| no  |
+++-+
+| ``CREATE`` | yes |
+++-+
+| ``CUSTOM`` | no  |
+++-+
+| ``DATE``   | no  |
+++-+
+| ``DECIMAL``| no  |
+++-+
+| ``DELETE`` | yes |
+++-+
+| ``DESC``   | yes |
+++-+
+| ``DESCRIBE``   | yes |
+++-+
+| ``DISTINCT``   | no  |
+++-+
+| ``DOUBLE`` | no  |
+++-+
+| ``DROP``   | yes |
+++-+
+| ``ENTRIES``| yes |
+++-+
+| ``EXECUTE``| yes |
+++-+
+| ``EXISTS`` | no  |
+++-+
+| ``FILTERING``  | no  |
+++-+
+| ``FINALFUNC``  | no  |
+++-+
+| ``FLOAT``  | no  |

[32/34] cassandra git commit: Add 'report bug' section

2016-06-27 Thread slebresne
Add 'report bug' section


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

Branch: refs/heads/trunk
Commit: 7988b3fcda4d7948f510b540a1c51fff3c910722
Parents: 02d2621
Author: Sylvain Lebresne 
Authored: Mon Jun 27 20:01:31 2016 +0200
Committer: Sylvain Lebresne 
Committed: Mon Jun 27 20:01:31 2016 +0200

--
 doc/source/bugs.rst | 17 ++---
 doc/source/contactus.rst|  4 
 doc/source/cql/index.rst|  2 ++
 doc/source/getting_started/drivers.rst  |  2 ++
 doc/source/getting_started/querying.rst | 22 ++
 5 files changed, 40 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7988b3fc/doc/source/bugs.rst
--
diff --git a/doc/source/bugs.rst b/doc/source/bugs.rst
index ef10aab..90efb14 100644
--- a/doc/source/bugs.rst
+++ b/doc/source/bugs.rst
@@ -14,7 +14,18 @@
 .. See the License for the specific language governing permissions and
 .. limitations under the License.
 
-Reporting bugs
---
+Reporting bugs and contributing
+===
 
-.. todo:: TODO
+If you encounter a problem with Cassandra, the first places to ask for help 
are the :ref:`user mailing list
+` and the ``#cassandra`` :ref:`IRC channel `.
+
+If, after having asked for help, you suspect that you have found a bug in 
Cassandra, you should report it by opening a
+ticket through the `Apache Cassandra JIRA 
`__. Please provide as much
+details as you can on your problem, and don't forget to indicate which version 
of Cassandra you are running and on which
+environment.
+
+If you would like to contribute, please check `the section on contributing
+`__ on the Cassandra wiki. 
Please note that the source of this
+documentation is part of the Cassandra git repository and hence contributions 
to the documentation should follow the
+same path.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7988b3fc/doc/source/contactus.rst
--
diff --git a/doc/source/contactus.rst b/doc/source/contactus.rst
index ffd9d60..8d0f5dd 100644
--- a/doc/source/contactus.rst
+++ b/doc/source/contactus.rst
@@ -19,6 +19,8 @@ Contact us
 
 You can get in touch with the Cassandra community either via the mailing lists 
or the freenode IRC channels.
 
+.. _mailing-lists:
+
 Mailing lists
 -
 
@@ -37,6 +39,8 @@ Subscribe by sending an email to the email address in the 
Subscribe links above.
 email to confirm your subscription. Make sure to keep the welcome email as it 
contains instructions on how to
 unsubscribe.
 
+.. _irc-channels:
+
 IRC
 ---
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7988b3fc/doc/source/cql/index.rst
--
diff --git a/doc/source/cql/index.rst b/doc/source/cql/index.rst
index 718959c..00d90e4 100644
--- a/doc/source/cql/index.rst
+++ b/doc/source/cql/index.rst
@@ -14,6 +14,8 @@
 .. See the License for the specific language governing permissions and
 .. limitations under the License.
 
+.. _cql:
+
 The Cassandra Query Language (CQL)
 ==
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7988b3fc/doc/source/getting_started/drivers.rst
--
diff --git a/doc/source/getting_started/drivers.rst 
b/doc/source/getting_started/drivers.rst
index d637a70..baec823 100644
--- a/doc/source/getting_started/drivers.rst
+++ b/doc/source/getting_started/drivers.rst
@@ -14,6 +14,8 @@
 .. See the License for the specific language governing permissions and
 .. limitations under the License.
 
+.. _client-drivers:
+
 Client drivers
 --
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7988b3fc/doc/source/getting_started/querying.rst
--
diff --git a/doc/source/getting_started/querying.rst 
b/doc/source/getting_started/querying.rst
index f73c106..55b162b 100644
--- a/doc/source/getting_started/querying.rst
+++ b/doc/source/getting_started/querying.rst
@@ -17,9 +17,18 @@
 Inserting and querying
 --
 
-cqlsh is a command line shell for interacting with Cassandra through CQL (the 
Cassandra Query Language). It is shipped
-with every Cassandra package, and can be found in the bin/ directory alongside 
the 

[26/34] cassandra git commit: Don't track auto-generated file

2016-06-27 Thread slebresne
Don't track auto-generated file


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

Branch: refs/heads/trunk
Commit: 7dfb25e3c29c46c5ba58c63613c8cc3b4ca28412
Parents: 54f7335
Author: Sylvain Lebresne 
Authored: Wed Jun 22 10:06:09 2016 +0200
Committer: Sylvain Lebresne 
Committed: Wed Jun 22 10:06:09 2016 +0200

--
 doc/Makefile|6 +-
 .../configuration/cassandra_config_file.rst | 1699 --
 2 files changed, 5 insertions(+), 1700 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7dfb25e3/doc/Makefile
--
diff --git a/doc/Makefile b/doc/Makefile
index 14e4c7a..9a736cc 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -14,7 +14,10 @@ ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees 
$(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
 
-MAKE_CASSANDRA_YAML = python convert_yaml_to_rst.py ../conf/cassandra.yaml 
source/configuration/cassandra_config_file.rst
+YAML_DOC_INPUT=../conf/cassandra.yaml
+YAML_DOC_OUTPUT=source/configuration/cassandra_config_file.rst
+
+MAKE_CASSANDRA_YAML = python convert_yaml_to_rst.py $(YAML_DOC_INPUT) 
$(YAML_DOC_OUTPUT)
 
 .PHONY: help
 help:
@@ -49,6 +52,7 @@ help:
 .PHONY: clean
 clean:
rm -rf $(BUILDDIR)/*
+   rm $(YAML_DOC_OUTPUT)
 
 .PHONY: html
 html:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7dfb25e3/doc/source/configuration/cassandra_config_file.rst
--
diff --git a/doc/source/configuration/cassandra_config_file.rst 
b/doc/source/configuration/cassandra_config_file.rst
deleted file mode 100644
index b7d1bbc..000
--- a/doc/source/configuration/cassandra_config_file.rst
+++ /dev/null
@@ -1,1699 +0,0 @@
-Cassandra Configuration File
-=
-
-``cluster_name``
-
-The name of the cluster. This is mainly used to prevent machines in
-one logical cluster from joining another.
-
-*Default Value:* 'Test Cluster'
-
-``num_tokens``
---
-
-This defines the number of tokens randomly assigned to this node on the ring
-The more tokens, relative to other nodes, the larger the proportion of data
-that this node will store. You probably want all nodes to have the same number
-of tokens assuming they have equal hardware capability.
-
-If you leave this unspecified, Cassandra will use the default of 1 token for 
legacy compatibility,
-and will use the initial_token as described below.
-
-Specifying initial_token will override this setting on the node's initial 
start,
-on subsequent starts, this setting will apply even if initial token is set.
-
-If you already have a cluster with 1 token per node, and wish to migrate to 
-multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
-
-*Default Value:* 256
-
-``allocate_tokens_for_keyspace``
-
-*This option is commented out by default.*
-
-Triggers automatic allocation of num_tokens tokens for this node. The 
allocation
-algorithm attempts to choose tokens in a way that optimizes replicated load 
over
-the nodes in the datacenter for the replication strategy used by the specified
-keyspace.
-
-The load assigned to each node will be close to proportional to its number of
-vnodes.
-
-Only supported with the Murmur3Partitioner.
-
-*Default Value:* KEYSPACE
-
-``initial_token``
--
-*This option is commented out by default.*
-
-initial_token allows you to specify tokens manually.  While you can use it with
-vnodes (num_tokens > 1, above) -- in which case you should provide a 
-comma-separated list -- it's primarily used when adding nodes to legacy 
clusters 
-that do not have vnodes enabled.
-
-``hinted_handoff_enabled``
---
-
-See http://wiki.apache.org/cassandra/HintedHandoff
-May either be "true" or "false" to enable globally
-
-*Default Value:* true
-
-``hinted_handoff_disabled_datacenters``

-*This option is commented out by default.*
-
-When hinted_handoff_enabled is true, a black list of data centers that will not
-perform hinted handoff
-
-*Default Value (complex option)*::
-
-#- DC1
-#- DC2
-
-``max_hint_window_in_ms``
--
-this defines the maximum amount of time a dead host will have hints
-generated.  After it has been dead this long, new hints for it will not be
-created until it 

[08/34] cassandra git commit: Add doc on compaction

2016-06-27 Thread slebresne
Add doc on compaction


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

Branch: refs/heads/trunk
Commit: 8d2bd0d9cecd2ced794a65642a74f1f422696614
Parents: 898b91a
Author: Marcus Eriksson 
Authored: Fri Jun 17 22:03:25 2016 +0200
Committer: Sylvain Lebresne 
Committed: Fri Jun 17 22:03:38 2016 +0200

--
 doc/source/operations.rst | 360 +++--
 1 file changed, 348 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8d2bd0d9/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 9e79700..9094766 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -205,26 +205,362 @@ Hints
 
 .. todo:: todo
 
+.. _compaction:
+
 Compaction
 --
 
-Size Tiered
-^^^
+Types of compaction
+^^^
 
-.. todo:: todo
+The concept of compaction is used for different kinds of operations in 
Cassandra, the common thing about these
+operations is that it takes one or more sstables and output new sstables. The 
types of compactions are;
+
+Minor compaction
+triggered automatically in Cassandra.
+Major compaction
+a user executes a compaction over all sstables on the node.
+User defined compaction
+a user triggers a compaction on a given set of sstables.
+Scrub
+try to fix any broken sstables. This can actually remove valid data if 
that data is corrupted, if that happens you
+will need to run a full repair on the node.
+Upgradesstables
+upgrade sstables to the latest version. Run this after upgrading to a new 
major version.
+Cleanup
+remove any ranges this node does not own anymore, typically triggered on 
neighbouring nodes after a node has been
+bootstrapped since that node will take ownership of some ranges from those 
nodes.
+Secondary index rebuild
+rebuild the secondary indexes on the node.
+Anticompaction
+after repair the ranges that were actually repaired are split out of the 
sstables that existed when repair started.
+
+When is a minor compaction triggered?
+^
+
+#  When an sstable is added to the node through flushing/streaming etc.
+#  When autocompaction is enabled after being disabled (``nodetool 
enableautocompaction``)
+#  When compaction adds new sstables.
+#  A check for new minor compactions every 5 minutes.
+
+Merging sstables
+
 
-Leveled
-^^^
+Compaction is about merging sstables, since partitions in sstables are sorted 
based on the hash of the partition key it
+is possible to efficiently merge separate sstables. Content of each partition 
is also sorted so each partition can be
+merged efficiently.
 
-.. todo:: todo
+Tombstones and gc_grace
+^^^
 
-TimeWindow
-^^
-.. todo:: todo
+When a delete is issued in Cassandra what happens is that a tombstone is 
written, this tombstone shadows the data it
+deletes. This means that the tombstone can live in one sstable and the data it 
covers is in another sstable. To be able
+to remove the actual data, a compaction where both the sstable containing the 
tombstone and the sstable containing the
+data is included the same compaction is needed.
+
+``gc_grace_seconds`` is the minimum time tombstones are kept around. If you 
generally run repair once a week, then
+``gc_grace_seconds`` needs to be at least 1 week (you probably want some 
margin as well), otherwise you might drop a
+tombstone that has not been propagated to all replicas and that could cause 
deleted data to become live again.
+
+To be able to drop an actual tombstone the following needs to be true;
+
+-  The tombstone must be older than ``gc_grace_seconds``
+-  If partition X contains the tombstone, the sstable containing the partition 
plus all sstables containing data older
+  than the tombstone containing X must be included in the same compaction. We 
don't need to care if the partition is in
+  an sstable if we can guarantee that all data in that sstable is newer than 
the tombstone. If the tombstone is older
+  than the data it cannot shadow that data.
+-  If the option ``only_purge_repaired_tombstones`` is enabled, tombstones are 
only removed if the data has also been
+  repaired.
+
+TTL
+^^^
+
+Data in Cassandra can have an additional property called time to live - this 
is used to automatically drop data that has
+expired once the time is reached. Once the TTL has expired the data is 
converted to a tombstone which stays around for
+at least 

[01/34] cassandra git commit: Add initial in-tree documentation (very incomplete so far)

2016-06-27 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/trunk 48e4d5dae -> c7b9401bf


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cad277be/doc/source/faq.rst
--
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
new file mode 100644
index 000..4ac0be4
--- /dev/null
+++ b/doc/source/faq.rst
@@ -0,0 +1,20 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+Frequently Asked Questions
+==
+
+.. TODO: todo

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cad277be/doc/source/getting_started.rst
--
diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst
new file mode 100644
index 000..c30fb1e
--- /dev/null
+++ b/doc/source/getting_started.rst
@@ -0,0 +1,252 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+.. highlight:: none
+
+Getting Started
+===
+
+Installing Cassandra
+
+
+Prerequisites
+^
+
+- The latest version of Java 8, either the `Oracle Java Standard Edition 8
+  `__ or 
`OpenJDK 8 `__. To
+  verify that you have the correct version of java installed, type ``java 
-version``.
+
+- For using cqlsh, the latest version of `Python 2.7 
`__. To verify that you have
+  the correct version of Python installed, type ``python --version``.
+
+Installation from binary tarball files
+^^
+
+- Download the latest stable release from the `Apache Cassandra downloads 
website `__.
+
+- Untar the file somewhere, for example:
+
+::
+
+tar -xvf apache-cassandra-3.6-bin.tar.gz cassandra
+
+The files will be extracted into ``apache-cassandra-3.6``, you need to 
substitute 3.6 with the release number that you
+have downloaded.
+
+- Optionally add ``apache-cassandra-3.6\bin`` to your path.
+- Start Cassandra in the foreground by invoking ``bin/cassandra -f`` from the 
command line. Press "Control-C" to stop
+  Cassandra. Start Cassandra in the background by invoking ``bin/cassandra`` 
from the command line. Invoke ``kill pid``
+  or ``pkill -f CassandraDaemon`` to stop Cassandra, where pid is the 
Cassandra process id, which you can find for
+  example by invoking ``pgrep -f CassandraDaemon``.
+- Verify that Cassandra is running by invoking ``bin/nodetool status`` from 
the command line.
+- Configuration files are located in the ``conf`` sub-directory.
+- Since Cassandra 2.1, log and data directories are located in the ``logs`` 
and ``data`` sub-directories respectively.
+  Older versions defaulted to ``/var/log/cassandra`` and 
``/var/lib/cassandra``. Due to this, it is necessary to either
+  start Cassandra with root privileges or change ``conf/cassandra.yaml`` to 
use directories owned by the current user,
+  as explained below in the section on changing the location of directories.
+
+Installation from Debian packages
+^
+
+- Add the Apache repository of Cassandra to 
``/etc/apt/sources.list.d/cassandra.sources.list``, for example for version
+  3.6:
+
+::
+
+echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee 
-a /etc/apt/sources.list.d/cassandra.sources.list
+
+- Update the repositories:
+
+::
+
+sudo 

[25/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
Reorganize document


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

Branch: refs/heads/trunk
Commit: 54f7335cd9bcf13f96d62191b64ea179a61c1763
Parents: f2f3071
Author: Sylvain Lebresne 
Authored: Tue Jun 21 19:52:52 2016 +0200
Committer: Sylvain Lebresne 
Committed: Wed Jun 22 09:30:46 2016 +0200

--
 .gitignore  |3 +
 doc/Makefile|2 +-
 doc/convert_yaml_to_rst.py  |2 +-
 doc/source/_static/extra.css|8 +
 doc/source/_templates/indexcontent.html |   33 +
 doc/source/architecture.rst |  217 -
 doc/source/architecture/dynamo.rst  |  137 +
 doc/source/architecture/guarantees.rst  |   20 +
 doc/source/architecture/index.rst   |   29 +
 doc/source/architecture/overview.rst|   20 +
 doc/source/architecture/storage_engine.rst  |   82 +
 doc/source/bugs.rst |   20 +
 doc/source/conf.py  |4 +-
 .../configuration/cassandra_config_file.rst | 1699 
 doc/source/configuration/index.rst  |   25 +
 doc/source/cql.rst  | 4114 --
 doc/source/cql/appendices.rst   |  310 ++
 doc/source/cql/changes.rst  |  257 ++
 doc/source/cql/ddl.rst  |  682 +++
 doc/source/cql/definitions.rst  |  225 +
 doc/source/cql/dml.rst  |  606 +++
 doc/source/cql/functions.rst|  661 +++
 doc/source/cql/index.rst|   47 +
 doc/source/cql/indexes.rst  |   84 +
 doc/source/cql/json.rst |  146 +
 doc/source/cql/mvs.rst  |   95 +
 doc/source/cql/security.rst |  637 +++
 doc/source/cql/triggers.rst |   61 +
 doc/source/cql/types.rst|  516 +++
 doc/source/cqlsh.rst|  447 --
 doc/source/data_modeling/index.rst  |   20 +
 doc/source/faq.rst  |   20 -
 doc/source/faq/index.rst|   20 +
 doc/source/getting_started.rst  |  269 --
 doc/source/getting_started/configuring.rst  |   67 +
 doc/source/getting_started/drivers.rst  |  105 +
 doc/source/getting_started/index.rst|   33 +
 doc/source/getting_started/installing.rst   |   99 +
 doc/source/getting_started/querying.rst |   38 +
 doc/source/index.rst|   19 +-
 doc/source/operating/backups.rst|   22 +
 doc/source/operating/bloom_filters.rst  |   65 +
 doc/source/operating/cdc.rst|   89 +
 doc/source/operating/compaction.rst |  426 ++
 doc/source/operating/compression.rst|   94 +
 doc/source/operating/hardware.rst   |   87 +
 doc/source/operating/hints.rst  |   22 +
 doc/source/operating/index.rst  |   38 +
 doc/source/operating/metrics.rst|  619 +++
 doc/source/operating/read_repair.rst|   22 +
 doc/source/operating/repair.rst |   22 +
 doc/source/operating/security.rst   |  410 ++
 doc/source/operating/snitch.rst |   78 +
 doc/source/operating/topo_changes.rst   |  122 +
 doc/source/operations.rst   | 1900 
 doc/source/tools/cqlsh.rst  |  455 ++
 doc/source/tools/index.rst  |   26 +
 doc/source/tools/nodetool.rst   |   22 +
 doc/source/troubleshooting.rst  |   20 -
 doc/source/troubleshooting/index.rst|   20 +
 60 files changed, 9440 insertions(+), 6998 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 9cb8614..4f33eda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,3 +72,6 @@ lib/jsr223/jython/cachedir
 lib/jsr223/scala/*.jar
 
 /.ant-targets-build.xml
+
+# Generated files from the documentation
+doc/source/cassandra_config_file.rst

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/Makefile
--
diff --git a/doc/Makefile b/doc/Makefile
index 778448a..14e4c7a 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -14,7 

[02/34] cassandra git commit: Add initial in-tree documentation (very incomplete so far)

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/cad277be/doc/source/cql.rst
--
diff --git a/doc/source/cql.rst b/doc/source/cql.rst
new file mode 100644
index 000..8d36258
--- /dev/null
+++ b/doc/source/cql.rst
@@ -0,0 +1,3916 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+.. highlight:: sql
+
+The Cassandra Query Language (CQL)
+==
+
+CQL Syntax
+--
+
+Preamble
+
+
+This document describes the Cassandra Query Language (CQL) [#]_. Note that 
this document describes the last version of
+the languages. However, the `changes <#changes>`_ section provides the diff 
between the different versions of CQL.
+
+CQL offers a model close to SQL in the sense that data is put in *tables* 
containing *rows* of *columns*. For
+that reason, when used in this document, these terms (tables, rows and 
columns) have the same definition than they have
+in SQL. But please note that as such, they do **not** refer to the concept of 
rows and columns found in the deprecated
+thrift API (and earlier version 1 and 2 of CQL).
+
+Conventions
+^^^
+
+To aid in specifying the CQL syntax, we will use the following conventions in 
this document:
+
+- Language rules will be given in an informal `BNF variant
+  `_ notation. 
In particular, we'll use square brakets
+  (``[ item ]``) for optional items, ``*`` and ``+`` for repeated items (where 
``+`` imply at least one).
+- The grammar is provided for documentation purposes and leave some minor 
details out (only conveniences that can be
+  ignored). For instance, the comma on the last column definition in a 
``CREATE TABLE`` statement is optional but
+  supported if present even though the grammar in this document suggests 
otherwise. Also, not everything accepted by the
+  grammar will be valid CQL.
+- References to keywords or pieces of CQL code in running text will be shown 
in a ``fixed-width font``.
+
+Identifiers and keywords
+
+
+The CQL language uses *identifiers* (or *names*) to identify tables, columns 
and other objects. An identifier is a token
+matching the regular expression ``[a-zA-Z][a-zA-Z0-9_]*``.
+
+A number of such identifiers, like ``SELECT`` or ``WITH``, are *keywords*. 
They have a fixed meaning for the language
+and most are reserved. The list of those keywords can be found in `Appendix A 
<#appendixA>`__.
+
+Identifiers and (unquoted) keywords are case insensitive. Thus ``SELECT`` is 
the same than ``select`` or ``sElEcT``, and
+``myId`` is the same than ``myid`` or ``MYID``. A convention often used (in 
particular by the samples of this
+documentation) is to use upper case for keywords and lower case for other 
identifiers.
+
+There is a second kind of identifiers called *quoted identifiers* defined by 
enclosing an arbitrary sequence of
+characters (non empty) in double-quotes(``"``). Quoted identifiers are never 
keywords. Thus ``"select"`` is not a
+reserved keyword and can be used to refer to a column (note that using this is 
particularly advised), while ``select``
+would raise a parsing error. Also, contrarily to unquoted identifiers and 
keywords, quoted identifiers are case
+sensitive (``"My Quoted Id"`` is *different* from ``"my quoted id"``). A fully 
lowercase quoted identifier that matches
+``[a-zA-Z][a-zA-Z0-9_]*`` is however *equivalent* to the unquoted identifier 
obtained by removing the double-quote (so
+``"myid"`` is equivalent to ``myid`` and to ``myId`` but different from 
``"myId"``).  Inside a quoted identifier, the
+double-quote character can be repeated to escape it, so ``"foo "" bar"`` is a 
valid identifier.
+
+**Warning**: *quoted identifiers* allows to declare columns with arbitrary 
names, and those can sometime clash with
+specific names used by the server. For instance, when using conditional 
update, the server will respond with a
+result-set containing a special result named ``"[applied]"``. If you’ve 
declared a column with such a name, this could
+potentially confuse some tools and should be avoided. In general, unquoted 
identifiers should be 

[12/34] cassandra git commit: Fix CQL doc (incomplete)

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d65542b/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 31ecc35..cf8812f 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -19,11 +19,6 @@
 Operating Cassandra
 ===
 
-Replication Strategies
---
-
-.. todo:: todo
-
 Snitch
 --
 
@@ -264,12 +259,12 @@ tombstone that has not been propagated to all replicas 
and that could cause dele
 
 To be able to drop an actual tombstone the following needs to be true;
 
--  The tombstone must be older than ``gc_grace_seconds``
--  If partition X contains the tombstone, the sstable containing the partition 
plus all sstables containing data older
+- The tombstone must be older than ``gc_grace_seconds``
+- If partition X contains the tombstone, the sstable containing the partition 
plus all sstables containing data older
   than the tombstone containing X must be included in the same compaction. We 
don't need to care if the partition is in
   an sstable if we can guarantee that all data in that sstable is newer than 
the tombstone. If the tombstone is older
   than the data it cannot shadow that data.
--  If the option ``only_purge_repaired_tombstones`` is enabled, tombstones are 
only removed if the data has also been
+- If the option ``only_purge_repaired_tombstones`` is enabled, tombstones are 
only removed if the data has also been
   repaired.
 
 TTL
@@ -538,9 +533,9 @@ The primary motivation for TWCS is to separate data on disk 
by timestamp and to
 more efficiently. One potential way this optimal behavior can be subverted is 
if data is written to SSTables out of
 order, with new data and old data in the same SSTable. Out of order data can 
appear in two ways:
 
--  If the user mixes old data and new data in the traditional write path, the 
data will be comingled in the memtables
+- If the user mixes old data and new data in the traditional write path, the 
data will be comingled in the memtables
   and flushed into the same SSTable, where it will remain comingled.
--  If the user's read requests for old data cause read repairs that pull old 
data into the current memtable, that data
+- If the user's read requests for old data cause read repairs that pull old 
data into the current memtable, that data
   will be comingled and flushed into the same SSTable.
 
 While TWCS tries to minimize the impact of comingled data, users should 
attempt to avoid this behavior.  Specifically,



[07/34] cassandra git commit: Add initial version of security section

2016-06-27 Thread slebresne
Add initial version of security section


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

Branch: refs/heads/trunk
Commit: 898b91a029ff942b09221dea32d138ea988bd2ed
Parents: b1edbd1
Author: Sam Tunnicliffe 
Authored: Thu Jun 16 17:52:51 2016 +0100
Committer: Sylvain Lebresne 
Committed: Fri Jun 17 21:28:11 2016 +0200

--
 doc/source/operations.rst | 386 -
 1 file changed, 384 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/898b91a0/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 40b3e09..9e79700 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -437,15 +437,397 @@ Metric Reporters
 Security
 
 
+There are three main components to the security features provided by Cassandra:
+
+- TLS/SSL encryption for client and inter-node communication
+- Client authentication
+- Authorization
+
+TLS/SSL Encryption
+^^
+Cassandra provides secure communication between a client machine and a 
database cluster and between nodes within a
+cluster. Enabling encryption ensures that data in flight is not compromised 
and is transferred securely. The options for
+client-to-node and node-to-node encryption are managed separately and may be 
configured independently.
+
+In both cases, the JVM defaults for supported protocols and cipher suites are 
used when encryption is enabled. These can
+be overidden using the settings in ``cassandra.yaml``, but this is not 
recommended unless there are policies in place
+which dictate certain settings or a need to disable vulnerable ciphers or 
protocols in cases where the JVM cannot be
+updated.
+
+FIPS compliant settings can be configured at the JVM level and should not 
involve changing encryption settings in
+cassandra.yaml. See `the java document on FIPS 
`__
+for more details.
+
+For information on generating the keystore and truststore files used in SSL 
communications, see the
+`java documentation on creating keystores 
`__
+
+Inter-node Encryption
+~
+
+The settings for managing inter-node encryption are found in 
``cassandra.yaml`` in the ``server_encryption_options``
+section. To enable inter-node encryption, change the ``internode_encryption`` 
setting from its default value of ``none``
+to one value from: ``rack``, ``dc`` or ``all``.
+
+Client to Node Encryption
+~
+
+The settings for managing client to node encryption are found in 
``cassandra.yaml`` in the ``client_encryption_options``
+section. There are two primary toggles here for enabling encryption, 
``enabled`` and ``optional``.
+
+- If neither is set to ``true``, client connections are entirely unencrypted.
+- If ``enabled`` is set to ``true`` and ``optional`` is set to ``false``, all 
client connections must be secured.
+- If both options are set to ``true``, both encrypted and unencrypted 
connections are supported using the same port.
+  Client connections using encryption with this configuration will be 
automatically detected and handled by the server.
+
+As an alternative to the ``optional`` setting, separate ports can also be 
configured for secure and unsecure connections
+where operational requirements demand it. To do so, set ``optional`` to false 
and use the ``native_transport_port_ssl``
+setting in ``cassandra.yaml`` to specify the port to be used for secure client 
communication.
+
+.. _operation-roles:
+
 Roles
 ^
 
-.. todo:: todo
+Cassandra uses database roles, which may represent either a single user or a 
group of users, in both authentication and
+permissions management. Role management is an extension point in Cassandra and 
may be configured using the
+``role_manager`` setting in ``cassandra.yaml``. The default setting uses 
``CassandraRoleManager``, an implementation
+which stores role information in the tables of the ``system_auth`` keyspace.
+
+See also the :ref:`CQL documentation on roles `.
+
+Authentication
+^^
+
+Authentication is pluggable in Cassandra and is configured using the 
``authenticator`` setting in ``cassandra.yaml``.
+Cassandra ships with two options included in the default distribution.
+
+By default, Cassandra is configured with ``AllowAllAuthenticator`` which 
performs no authentication checks and 

[16/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/tools/cqlsh.rst
--
diff --git a/doc/source/tools/cqlsh.rst b/doc/source/tools/cqlsh.rst
new file mode 100644
index 000..45e2db8
--- /dev/null
+++ b/doc/source/tools/cqlsh.rst
@@ -0,0 +1,455 @@
+.. highlight:: none
+
+.. _cqlsh:
+
+cqlsh: the CQL shell
+
+
+cqlsh is a command line shell for interacting with Cassandra through CQL (the 
Cassandra Query Language).  It is shipped
+with every Cassandra package, and can be found in the bin/ directory alongside 
the cassandra executable.  cqlsh utilizes
+the Python native protocol driver, and connects to the single node specified 
on the command line.
+
+
+Compatibility
+^
+
+cqlsh is compatible with Python 2.7.
+
+In general, a given version of cqlsh is only guaranteed to work with the 
version of Cassandra that it was released with.
+In some cases, cqlsh make work with older or newer versions of Cassandra, but 
this is not officially supported.
+
+
+Optional Dependencies
+^
+
+cqlsh ships with all essential dependencies.  However, there are some optional 
dependencies that can be installed to
+improve the capabilities of cqlsh.
+
+pytz
+
+
+By default, cqlsh displays all timestamps with a UTC timezone.  To support 
display of timestamps with another timezone,
+the `pytz `__ library must be installed.  See 
the ``timezone`` option in cqlshrc_ for
+specifying a timezone to use.
+
+cython
+~~
+
+The performance of cqlsh's ``COPY`` operations can be improved by installing 
`cython `__.  This will
+compile the python modules that are central to the performance of ``COPY``.
+
+cqlshrc
+^^^
+
+The ``cqlshrc`` file holds configuration options for cqlsh.  By default this 
is in the user's home directory at
+``~/.cassandra/cqlsh``, but a custom location can be specified with the 
``--cqlshrc`` option.
+
+Example config values and documentation can be found in the 
``conf/cqlshrc.sample`` file of a tarball installation.  You
+can also view the latest version of `cqlshrc online 
`__.
+
+
+Command Line Options
+
+
+Usage:
+
+``cqlsh [options] [host [port]]``
+
+Options:
+
+``-C`` ``--color``
+  Force color output
+
+``--no-color``
+  Disable color output
+
+``--browser``
+  Specify the browser to use for displaying cqlsh help.  This can be one of 
the `supported browser names
+  `__ (e.g. ``firefox``) or 
a browser path followed by ``%s`` (e.g.
+  ``/usr/bin/google-chrome-stable %s``).
+
+``--ssl``
+  Use SSL when connecting to Cassandra
+
+``-u`` ``--user``
+  Username to authenticate against Cassandra with
+
+``-p`` ``--password``
+  Password to authenticate against Cassandra with, should
+  be used in conjunction with ``--user``
+
+``-k`` ``--keyspace``
+  Keyspace to authenticate to, should be used in conjunction
+  with ``--user``
+
+``-f`` ``--file``
+  Execute commands from the given file, then exit
+
+``--debug``
+  Print additional debugging information
+
+``--encoding``
+  Specify a non-default encoding for output (defaults to UTF-8)
+
+``--cqlshrc``
+  Specify a non-default location for the ``cqlshrc`` file
+
+``-e`` ``--execute``
+  Execute the given statement, then exit
+
+``--connect-timeout``
+  Specify the connection timeout in seconds (defaults to 2s)
+
+``--request-timeout``
+  Specify the request timeout in seconds (defaults to 10s)
+
+``-t`` ``--tty``
+  Force tty mode (command prompt)
+
+
+Special Commands
+
+
+In addition to supporting regular CQL statements, cqlsh also supports a number 
of special commands that are not part of
+CQL.  These are detailed below.
+
+``CONSISTENCY``
+~~~
+
+`Usage`: ``CONSISTENCY ``
+
+Sets the consistency level for operations to follow.  Valid arguments include:
+
+- ``ANY``
+- ``ONE``
+- ``TWO``
+- ``THREE``
+- ``QUORUM``
+- ``ALL``
+- ``LOCAL_QUORUM``
+- ``LOCAL_ONE``
+- ``SERIAL``
+- ``LOCAL_SERIAL``
+
+``SERIAL CONSISTENCY``
+~~
+
+`Usage`: ``SERIAL CONSISTENCY ``
+
+Sets the serial consistency level for operations to follow.  Valid arguments 
include:
+
+- ``SERIAL``
+- ``LOCAL_SERIAL``
+
+The serial consistency level is only used by conditional updates (``INSERT``, 
``UPDATE`` and ``DELETE`` with an ``IF``
+condition). For those, the serial consistency level defines the consistency 
level of the serial phase (or “paxos” phase)
+while the normal consistency level defines the consistency for the “learn” 
phase, i.e. what type of reads will be
+guaranteed to see the update right away. For example, if a conditional write 
has a consistency level of ``QUORUM`` (and
+is successful), then a ``QUORUM`` read is guaranteed to see that write. But if 
the regular consistency level 

[24/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/configuration/cassandra_config_file.rst
--
diff --git a/doc/source/configuration/cassandra_config_file.rst 
b/doc/source/configuration/cassandra_config_file.rst
new file mode 100644
index 000..b7d1bbc
--- /dev/null
+++ b/doc/source/configuration/cassandra_config_file.rst
@@ -0,0 +1,1699 @@
+Cassandra Configuration File
+=
+
+``cluster_name``
+
+The name of the cluster. This is mainly used to prevent machines in
+one logical cluster from joining another.
+
+*Default Value:* 'Test Cluster'
+
+``num_tokens``
+--
+
+This defines the number of tokens randomly assigned to this node on the ring
+The more tokens, relative to other nodes, the larger the proportion of data
+that this node will store. You probably want all nodes to have the same number
+of tokens assuming they have equal hardware capability.
+
+If you leave this unspecified, Cassandra will use the default of 1 token for 
legacy compatibility,
+and will use the initial_token as described below.
+
+Specifying initial_token will override this setting on the node's initial 
start,
+on subsequent starts, this setting will apply even if initial token is set.
+
+If you already have a cluster with 1 token per node, and wish to migrate to 
+multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
+
+*Default Value:* 256
+
+``allocate_tokens_for_keyspace``
+
+*This option is commented out by default.*
+
+Triggers automatic allocation of num_tokens tokens for this node. The 
allocation
+algorithm attempts to choose tokens in a way that optimizes replicated load 
over
+the nodes in the datacenter for the replication strategy used by the specified
+keyspace.
+
+The load assigned to each node will be close to proportional to its number of
+vnodes.
+
+Only supported with the Murmur3Partitioner.
+
+*Default Value:* KEYSPACE
+
+``initial_token``
+-
+*This option is commented out by default.*
+
+initial_token allows you to specify tokens manually.  While you can use it with
+vnodes (num_tokens > 1, above) -- in which case you should provide a 
+comma-separated list -- it's primarily used when adding nodes to legacy 
clusters 
+that do not have vnodes enabled.
+
+``hinted_handoff_enabled``
+--
+
+See http://wiki.apache.org/cassandra/HintedHandoff
+May either be "true" or "false" to enable globally
+
+*Default Value:* true
+
+``hinted_handoff_disabled_datacenters``
+---
+*This option is commented out by default.*
+
+When hinted_handoff_enabled is true, a black list of data centers that will not
+perform hinted handoff
+
+*Default Value (complex option)*::
+
+#- DC1
+#- DC2
+
+``max_hint_window_in_ms``
+-
+this defines the maximum amount of time a dead host will have hints
+generated.  After it has been dead this long, new hints for it will not be
+created until it has been seen alive and gone down again.
+
+*Default Value:* 1080 # 3 hours
+
+``hinted_handoff_throttle_in_kb``
+-
+
+Maximum throttle in KBs per second, per delivery thread.  This will be
+reduced proportionally to the number of nodes in the cluster.  (If there
+are two nodes in the cluster, each delivery thread will use the maximum
+rate; if there are three, each will throttle to half of the maximum,
+since we expect two nodes to be delivering hints simultaneously.)
+
+*Default Value:* 1024
+
+``max_hints_delivery_threads``
+--
+
+Number of threads with which to deliver hints;
+Consider increasing this number when you have multi-dc deployments, since
+cross-dc handoff tends to be slower
+
+*Default Value:* 2
+
+``hints_directory``
+---
+*This option is commented out by default.*
+
+Directory where Cassandra should store hints.
+If not set, the default directory is $CASSANDRA_HOME/data/hints.
+
+*Default Value:*  /var/lib/cassandra/hints
+
+``hints_flush_period_in_ms``
+
+
+How often hints should be flushed from the internal buffers to disk.
+Will *not* trigger fsync.
+
+*Default Value:* 1
+
+``max_hints_file_size_in_mb``
+-
+
+Maximum size for a single hints file, in megabytes.
+
+*Default Value:* 128
+
+``hints_compression``
+-
+*This option is commented out by default.*
+
+Compression to apply to the hint files. If omitted, hints files
+will be written uncompressed. LZ4, Snappy, and Deflate compressors
+are supported.
+
+*Default Value (complex option)*::
+
+#   - class_name: LZ4Compressor
+# parameters:
+# -
+
+``batchlog_replay_throttle_in_kb``
+--
+Maximum throttle in KBs per second, total. This will be
+reduced proportionally to the 

[20/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/cql/security.rst
--
diff --git a/doc/source/cql/security.rst b/doc/source/cql/security.rst
new file mode 100644
index 000..f119c22
--- /dev/null
+++ b/doc/source/cql/security.rst
@@ -0,0 +1,637 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+.. highlight:: sql
+
+.. _cql-security:
+
+Security
+
+
+.. _roles:
+
+Database Roles
+^^
+
+CREATE ROLE
+~~~
+
+*Syntax:*
+
+| bc(syntax)..
+|  ::= CREATE ROLE ( IF NOT EXISTS )? ( WITH ( AND )\* )?
+
+|  ::= PASSWORD = 
+|  \| LOGIN = 
+|  \| SUPERUSER = 
+|  \| OPTIONS = 
+| p.
+
+*Sample:*
+
+| bc(sample).
+| CREATE ROLE new\_role;
+| CREATE ROLE alice WITH PASSWORD = ‘password\_a’ AND LOGIN = true;
+| CREATE ROLE bob WITH PASSWORD = ‘password\_b’ AND LOGIN = true AND
+  SUPERUSER = true;
+| CREATE ROLE carlos WITH OPTIONS = { ‘custom\_option1’ :
+  ‘option1\_value’, ‘custom\_option2’ : 99 };
+
+By default roles do not possess ``LOGIN`` privileges or ``SUPERUSER``
+status.
+
+`Permissions <#permissions>`__ on database resources are granted to
+roles; types of resources include keyspaces, tables, functions and roles
+themselves. Roles may be granted to other roles to create hierarchical
+permissions structures; in these hierarchies, permissions and
+``SUPERUSER`` status are inherited, but the ``LOGIN`` privilege is not.
+
+If a role has the ``LOGIN`` privilege, clients may identify as that role
+when connecting. For the duration of that connection, the client will
+acquire any roles and privileges granted to that role.
+
+Only a client with with the ``CREATE`` permission on the database roles
+resource may issue ``CREATE ROLE`` requests (see the `relevant
+section <#permissions>`__ below), unless the client is a ``SUPERUSER``.
+Role management in Cassandra is pluggable and custom implementations may
+support only a subset of the listed options.
+
+Role names should be quoted if they contain non-alphanumeric characters.
+
+.. _setting-credentials-for-internal-authentication:
+
+Setting credentials for internal authentication
+```
+
+| Use the ``WITH PASSWORD`` clause to set a password for internal
+  authentication, enclosing the password in single quotation marks.
+| If internal authentication has not been set up or the role does not
+  have ``LOGIN`` privileges, the ``WITH PASSWORD`` clause is not
+  necessary.
+
+Creating a role conditionally
+`
+
+Attempting to create an existing role results in an invalid query
+condition unless the ``IF NOT EXISTS`` option is used. If the option is
+used and the role exists, the statement is a no-op.
+
+| bc(sample).
+| CREATE ROLE other\_role;
+| CREATE ROLE IF NOT EXISTS other\_role;
+
+ALTER ROLE
+~~
+
+*Syntax:*
+
+| bc(syntax)..
+|  ::= ALTER ROLE ( WITH ( AND )\* )?
+
+|  ::= PASSWORD = 
+|  \| LOGIN = 
+|  \| SUPERUSER = 
+|  \| OPTIONS = 
+| p.
+
+*Sample:*
+
+| bc(sample).
+| ALTER ROLE bob WITH PASSWORD = ‘PASSWORD\_B’ AND SUPERUSER = false;
+
+Conditions on executing ``ALTER ROLE`` statements:
+
+-  A client must have ``SUPERUSER`` status to alter the ``SUPERUSER``
+   status of another role
+-  A client cannot alter the ``SUPERUSER`` status of any role it
+   currently holds
+-  A client can only modify certain properties of the role with which it
+   identified at login (e.g. ``PASSWORD``)
+-  To modify properties of a role, the client must be granted ``ALTER``
+   `permission <#permissions>`__ on that role
+
+DROP ROLE
+~
+
+*Syntax:*
+
+| bc(syntax)..
+|  ::= DROP ROLE ( IF EXISTS )? 
+| p.
+
+*Sample:*
+
+| bc(sample).
+| DROP ROLE alice;
+| DROP ROLE IF EXISTS bob;
+
+| ``DROP ROLE`` requires the client to have ``DROP``
+  `permission <#permissions>`__ on the role in question. In addition,
+  client may not ``DROP`` the role with which it identified at login.
+  Finaly, only a client with ``SUPERUSER`` status may ``DROP`` another
+  ``SUPERUSER`` role.
+| Attempting to drop a role which does not exist results in an invalid
+  query condition unless the ``IF EXISTS`` option 

[27/34] cassandra git commit: Finish fixing the CQL doc

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e624238/doc/source/cql/security.rst
--
diff --git a/doc/source/cql/security.rst b/doc/source/cql/security.rst
index f119c22..aa65383 100644
--- a/doc/source/cql/security.rst
+++ b/doc/source/cql/security.rst
@@ -21,53 +21,47 @@
 Security
 
 
-.. _roles:
+.. _cql-roles:
 
 Database Roles
 ^^
 
+.. _create-role-statement:
+
 CREATE ROLE
 ~~~
 
-*Syntax:*
-
-| bc(syntax)..
-|  ::= CREATE ROLE ( IF NOT EXISTS )? ( WITH ( AND )\* )?
+Creating a role uses the ``CREATE ROLE`` statement:
 
-|  ::= PASSWORD = 
-|  \| LOGIN = 
-|  \| SUPERUSER = 
-|  \| OPTIONS = 
-| p.
+.. productionlist::
+   create_role_statement: CREATE ROLE [ IF NOT EXISTS ] `role_name`
+: [ WITH `role_options` ]
+   role_options: `role_option` ( AND `role_option` )*
+   role_option: PASSWORD '=' `string`
+  :| LOGIN '=' `boolean`
+  :| SUPERUSER '=' `boolean`
+  :| OPTIONS '=' `map_literal`
 
-*Sample:*
+For instance::
 
-| bc(sample).
-| CREATE ROLE new\_role;
-| CREATE ROLE alice WITH PASSWORD = ‘password\_a’ AND LOGIN = true;
-| CREATE ROLE bob WITH PASSWORD = ‘password\_b’ AND LOGIN = true AND
-  SUPERUSER = true;
-| CREATE ROLE carlos WITH OPTIONS = { ‘custom\_option1’ :
-  ‘option1\_value’, ‘custom\_option2’ : 99 };
+CREATE ROLE new_role;
+CREATE ROLE alice WITH PASSWORD = 'password_a' AND LOGIN = true;
+CREATE ROLE bob WITH PASSWORD = 'password_b' AND LOGIN = true AND 
SUPERUSER = true;
+CREATE ROLE carlos WITH OPTIONS = { 'custom_option1' : 'option1_value', 
'custom_option2' : 99 };
 
-By default roles do not possess ``LOGIN`` privileges or ``SUPERUSER``
-status.
+By default roles do not possess ``LOGIN`` privileges or ``SUPERUSER`` status.
 
-`Permissions <#permissions>`__ on database resources are granted to
-roles; types of resources include keyspaces, tables, functions and roles
-themselves. Roles may be granted to other roles to create hierarchical
-permissions structures; in these hierarchies, permissions and
-``SUPERUSER`` status are inherited, but the ``LOGIN`` privilege is not.
+:ref:`Permissions ` on database resources are granted to 
roles; types of resources include keyspaces,
+tables, functions and roles themselves. Roles may be granted to other roles to 
create hierarchical permissions
+structures; in these hierarchies, permissions and ``SUPERUSER`` status are 
inherited, but the ``LOGIN`` privilege is
+not.
 
-If a role has the ``LOGIN`` privilege, clients may identify as that role
-when connecting. For the duration of that connection, the client will
-acquire any roles and privileges granted to that role.
+If a role has the ``LOGIN`` privilege, clients may identify as that role when 
connecting. For the duration of that
+connection, the client will acquire any roles and privileges granted to that 
role.
 
-Only a client with with the ``CREATE`` permission on the database roles
-resource may issue ``CREATE ROLE`` requests (see the `relevant
-section <#permissions>`__ below), unless the client is a ``SUPERUSER``.
-Role management in Cassandra is pluggable and custom implementations may
-support only a subset of the listed options.
+Only a client with with the ``CREATE`` permission on the database roles 
resource may issue ``CREATE ROLE`` requests (see
+the :ref:`relevant section ` below), unless the client is a 
``SUPERUSER``. Role management in Cassandra
+is pluggable and custom implementations may support only a subset of the 
listed options.
 
 Role names should be quoted if they contain non-alphanumeric characters.
 
@@ -76,562 +70,428 @@ Role names should be quoted if they contain 
non-alphanumeric characters.
 Setting credentials for internal authentication
 ```
 
-| Use the ``WITH PASSWORD`` clause to set a password for internal
-  authentication, enclosing the password in single quotation marks.
-| If internal authentication has not been set up or the role does not
-  have ``LOGIN`` privileges, the ``WITH PASSWORD`` clause is not
-  necessary.
+Use the ``WITH PASSWORD`` clause to set a password for internal 
authentication, enclosing the password in single
+quotation marks.
+
+If internal authentication has not been set up or the role does not have 
``LOGIN`` privileges, the ``WITH PASSWORD``
+clause is not necessary.
 
 Creating a role conditionally
 `
 
-Attempting to create an existing role results in an invalid query
-condition unless the ``IF NOT EXISTS`` option is used. If the option is
-used and the role exists, the statement is a no-op.
+Attempting to create an existing role results in an invalid query condition 
unless the ``IF NOT EXISTS`` option is used.
+If the option is used and the role exists, the statement is a no-op::
+
+CREATE ROLE other_role;
+CREATE ROLE IF NOT EXISTS 

[23/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/cql.rst
--
diff --git a/doc/source/cql.rst b/doc/source/cql.rst
deleted file mode 100644
index 8d185a2..000
--- a/doc/source/cql.rst
+++ /dev/null
@@ -1,4114 +0,0 @@
-.. Licensed to the Apache Software Foundation (ASF) under one
-.. or more contributor license agreements.  See the NOTICE file
-.. distributed with this work for additional information
-.. regarding copyright ownership.  The ASF licenses this file
-.. to you under the Apache License, Version 2.0 (the
-.. "License"); you may not use this file except in compliance
-.. with the License.  You may obtain a copy of the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS,
-.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-.. See the License for the specific language governing permissions and
-.. limitations under the License.
-
-.. highlight:: sql
-
-.. _UUID: https://en.wikipedia.org/wiki/Universally_unique_identifier
-
-The Cassandra Query Language (CQL)
-==
-
-This document describes the Cassandra Query Language (CQL) [#]_. Note that 
this document describes the last version of
-the languages. However, the `changes <#changes>`_ section provides the diff 
between the different versions of CQL.
-
-CQL offers a model close to SQL in the sense that data is put in *tables* 
containing *rows* of *columns*. For
-that reason, when used in this document, these terms (tables, rows and 
columns) have the same definition than they have
-in SQL. But please note that as such, they do **not** refer to the concept of 
rows and columns found in the deprecated
-thrift API (and earlier version 1 and 2 of CQL).
-
-.. _definitions:
-
-Definitions

-
-.. _conventions:
-
-Conventions
-^^^
-
-To aid in specifying the CQL syntax, we will use the following conventions in 
this document:
-
-- Language rules will be given in an informal `BNF variant
-  `_ notation. 
In particular, we'll use square brakets
-  (``[ item ]``) for optional items, ``*`` and ``+`` for repeated items (where 
``+`` imply at least one).
-- The grammar will also use the following convention for convenience: 
non-terminal term will be lowercase (and link to
-  their definition) while terminal keywords will be provided "all caps". Note 
however that keywords are
-  :ref:`identifiers` and are thus case insensitive in practice. We will also 
define some early construction using
-  regexp, which we'll indicate with ``re()``.
-- The grammar is provided for documentation purposes and leave some minor 
details out.  For instance, the comma on the
-  last column definition in a ``CREATE TABLE`` statement is optional but 
supported if present even though the grammar in
-  this document suggests otherwise. Also, not everything accepted by the 
grammar is necessarily valid CQL.
-- References to keywords or pieces of CQL code in running text will be shown 
in a ``fixed-width font``.
-
-
-.. _identifiers:
-
-Identifiers and keywords
-
-
-The CQL language uses *identifiers* (or *names*) to identify tables, columns 
and other objects. An identifier is a token
-matching the regular expression ``[a-zA-Z][a-zA-Z0-9_]*``.
-
-A number of such identifiers, like ``SELECT`` or ``WITH``, are *keywords*. 
They have a fixed meaning for the language
-and most are reserved. The list of those keywords can be found in 
:ref:`appendix-A`.
-
-Identifiers and (unquoted) keywords are case insensitive. Thus ``SELECT`` is 
the same than ``select`` or ``sElEcT``, and
-``myId`` is the same than ``myid`` or ``MYID``. A convention often used (in 
particular by the samples of this
-documentation) is to use upper case for keywords and lower case for other 
identifiers.
-
-There is a second kind of identifiers called *quoted identifiers* defined by 
enclosing an arbitrary sequence of
-characters (non empty) in double-quotes(``"``). Quoted identifiers are never 
keywords. Thus ``"select"`` is not a
-reserved keyword and can be used to refer to a column (note that using this is 
particularly advised), while ``select``
-would raise a parsing error. Also, contrarily to unquoted identifiers and 
keywords, quoted identifiers are case
-sensitive (``"My Quoted Id"`` is *different* from ``"my quoted id"``). A fully 
lowercase quoted identifier that matches
-``[a-zA-Z][a-zA-Z0-9_]*`` is however *equivalent* to the unquoted identifier 
obtained by removing the double-quote (so
-``"myid"`` is equivalent to ``myid`` and to ``myId`` but different from 
``"myId"``).  Inside a quoted identifier, the
-double-quote character can be repeated to escape it, so ``"foo "" bar"`` is a 
valid identifier.

[04/34] cassandra git commit: Add snitch and range movements section on Operations

2016-06-27 Thread slebresne
Add snitch and range movements section on Operations


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

Branch: refs/heads/trunk
Commit: 4d444022c3ace5928a15b2a54af0f95f4191c0d7
Parents: cad277b
Author: Paulo Motta 
Authored: Tue Jun 14 17:54:38 2016 -0300
Committer: Sylvain Lebresne 
Committed: Wed Jun 15 10:31:17 2016 +0200

--
 doc/source/operations.rst | 164 -
 1 file changed, 160 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d444022/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 8228746..40b3e09 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -24,15 +24,171 @@ Replication Strategies
 
 .. todo:: todo
 
-Snitches
-
+Snitch
+--
 
-.. todo:: todo
+In cassandra, the snitch has two functions:
+
+- it teaches Cassandra enough about your network topology to route requests 
efficiently.
+- it allows Cassandra to spread replicas around your cluster to avoid 
correlated failures. It does this by grouping
+  machines into "datacenters" and "racks."  Cassandra will do its best not to 
have more than one replica on the same
+  "rack" (which may not actually be a physical location).
+
+Dynamic snitching
+^
+
+The dynamic snitch monitor read latencies to avoid reading from hosts that 
have slowed down. The dynamic snitch is
+configured with the following properties on ``cassandra.yaml``:
+
+- ``dynamic_snitch``: whether the dynamic snitch should be enabled or disabled.
+- ``dynamic_snitch_update_interval_in_ms``: controls how often to perform the 
more expensive part of host score
+  calculation.
+- ``dynamic_snitch_reset_interval_in_ms``: if set greater than zero and 
read_repair_chance is < 1.0, this will allow
+  'pinning' of replicas to hosts in order to increase cache capacity.
+- ``dynamic_snitch_badness_threshold:``: The badness threshold will control 
how much worse the pinned host has to be
+  before the dynamic snitch will prefer other replicas over it.  This is 
expressed as a double which represents a
+  percentage.  Thus, a value of 0.2 means Cassandra would continue to prefer 
the static snitch values until the pinned
+  host was 20% worse than the fastest.
+
+Snitch classes
+^^
+
+The ``endpoint_snitch`` parameter in ``cassandra.yaml`` should be set to the 
class the class that implements
+``IEndPointSnitch`` which will be wrapped by the dynamic snitch and decide if 
two endpoints are in the same data center
+or on the same rack. Out of the box, Cassandra provides the snitch 
implementations:
+
+GossipingPropertyFileSnitch
+This should be your go-to snitch for production use. The rack and 
datacenter for the local node are defined in
+cassandra-rackdc.properties and propagated to other nodes via gossip. If 
``cassandra-topology.properties`` exists,
+it is used as a fallback, allowing migration from the PropertyFileSnitch.
+
+SimpleSnitch
+Treats Strategy order as proximity. This can improve cache locality when 
disabling read repair. Only appropriate for
+single-datacenter deployments.
+
+PropertyFileSnitch
+Proximity is determined by rack and data center, which are explicitly 
configured in
+``cassandra-topology.properties``.
+
+Ec2Snitch
+Appropriate for EC2 deployments in a single Region. Loads Region and 
Availability Zone information from the EC2 API.
+The Region is treated as the datacenter, and the Availability Zone as the 
rack. Only private IPs are used, so this
+will not work across multiple regions.
+
+Ec2MultiRegionSnitch
+Uses public IPs as broadcast_address to allow cross-region connectivity 
(thus, you should set seed addresses to the
+public IP as well). You will need to open the ``storage_port`` or 
``ssl_storage_port`` on the public IP firewall
+(For intra-Region traffic, Cassandra will switch to the private IP after 
establishing a connection).
+
+RackInferringSnitch
+Proximity is determined by rack and data center, which are assumed to 
correspond to the 3rd and 2nd octet of each
+node's IP address, respectively.  Unless this happens to match your 
deployment conventions, this is best used as an
+example of writing a custom Snitch class and is provided in that spirit.
 
 Adding, replacing, moving and removing nodes
 
 
-.. todo:: todo
+Bootstrap
+^
+
+Adding new nodes is called "bootstrapping". 

[15/34] cassandra git commit: Automatically generate docs for cassandra.yaml

2016-06-27 Thread slebresne
Automatically generate docs for cassandra.yaml


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

Branch: refs/heads/trunk
Commit: f2f30714436457dcb175b6365bf85d116f3763d9
Parents: 5d65542
Author: Tyler Hobbs 
Authored: Tue Jun 21 12:40:40 2016 -0500
Committer: Sylvain Lebresne 
Committed: Tue Jun 21 19:53:48 2016 +0200

--
 conf/cassandra.yaml| 222 +---
 doc/Makefile   |  27 +
 doc/convert_yaml_to_rst.py | 144 ++
 doc/source/index.rst   |   1 +
 4 files changed, 314 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f2f30714/conf/cassandra.yaml
--
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index dcd5278..c43820e 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -35,20 +35,22 @@ num_tokens: 256
 # Only supported with the Murmur3Partitioner.
 # allocate_tokens_for_keyspace: KEYSPACE
 
-# initial_token allows you to specify tokens manually.  While you can use # it 
with
+# initial_token allows you to specify tokens manually.  While you can use it 
with
 # vnodes (num_tokens > 1, above) -- in which case you should provide a 
-# comma-separated list -- it's primarily used when adding nodes # to legacy 
clusters 
+# comma-separated list -- it's primarily used when adding nodes to legacy 
clusters 
 # that do not have vnodes enabled.
 # initial_token:
 
 # See http://wiki.apache.org/cassandra/HintedHandoff
 # May either be "true" or "false" to enable globally
 hinted_handoff_enabled: true
+
 # When hinted_handoff_enabled is true, a black list of data centers that will 
not
 # perform hinted handoff
-#hinted_handoff_disabled_datacenters:
+# hinted_handoff_disabled_datacenters:
 #- DC1
 #- DC2
+
 # this defines the maximum amount of time a dead host will have hints
 # generated.  After it has been dead this long, new hints for it will not be
 # created until it has been seen alive and gone down again.
@@ -193,26 +195,44 @@ partitioner: org.apache.cassandra.dht.Murmur3Partitioner
 # If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
 # commitlog_directory: /var/lib/cassandra/commitlog
 
-# policy for data disk failures:
-# die: shut down gossip and client transports and kill the JVM for any fs 
errors or
-#  single-sstable errors, so the node can be replaced.
-# stop_paranoid: shut down gossip and client transports even for 
single-sstable errors,
-#kill the JVM for errors during startup.
-# stop: shut down gossip and client transports, leaving the node effectively 
dead, but
-#   can still be inspected via JMX, kill the JVM for errors during startup.
-# best_effort: stop using the failed disk and respond to requests based on
-#  remaining available sstables.  This means you WILL see obsolete
-#  data at CL.ONE!
-# ignore: ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
+# Policy for data disk failures:
+#
+# die
+#   shut down gossip and client transports and kill the JVM for any fs errors 
or
+#   single-sstable errors, so the node can be replaced.
+#
+# stop_paranoid
+#   shut down gossip and client transports even for single-sstable errors,
+#   kill the JVM for errors during startup.
+#
+# stop
+#   shut down gossip and client transports, leaving the node effectively dead, 
but
+#   can still be inspected via JMX, kill the JVM for errors during startup.
+#
+# best_effort
+#stop using the failed disk and respond to requests based on
+#remaining available sstables.  This means you WILL see obsolete
+#data at CL.ONE!
+#
+# ignore
+#ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
 disk_failure_policy: stop
 
-# policy for commit disk failures:
-# die: shut down gossip and Thrift and kill the JVM, so the node can be 
replaced.
-# stop: shut down gossip and Thrift, leaving the node effectively dead, but
-#   can still be inspected via JMX.
-# stop_commit: shutdown the commit log, letting writes collect but
-#  continuing to service reads, as in pre-2.0.5 Cassandra
-# ignore: ignore fatal errors and let the batches fail
+# Policy for commit disk failures:
+#
+# die
+#   shut down gossip and Thrift and kill the JVM, so the node can be replaced.
+#
+# stop
+#   shut down gossip and Thrift, leaving the node effectively dead, but
+#   can still be inspected via JMX.
+#
+# stop_commit
+#   shutdown the commit log, letting writes collect but
+#   continuing to 

[17/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
deleted file mode 100644
index cf8812f..000
--- a/doc/source/operations.rst
+++ /dev/null
@@ -1,1900 +0,0 @@
-.. Licensed to the Apache Software Foundation (ASF) under one
-.. or more contributor license agreements.  See the NOTICE file
-.. distributed with this work for additional information
-.. regarding copyright ownership.  The ASF licenses this file
-.. to you under the Apache License, Version 2.0 (the
-.. "License"); you may not use this file except in compliance
-.. with the License.  You may obtain a copy of the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS,
-.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-.. See the License for the specific language governing permissions and
-.. limitations under the License.
-
-.. highlight:: none
-
-Operating Cassandra
-===
-
-Snitch
---
-
-In cassandra, the snitch has two functions:
-
-- it teaches Cassandra enough about your network topology to route requests 
efficiently.
-- it allows Cassandra to spread replicas around your cluster to avoid 
correlated failures. It does this by grouping
-  machines into "datacenters" and "racks."  Cassandra will do its best not to 
have more than one replica on the same
-  "rack" (which may not actually be a physical location).
-
-Dynamic snitching
-^
-
-The dynamic snitch monitor read latencies to avoid reading from hosts that 
have slowed down. The dynamic snitch is
-configured with the following properties on ``cassandra.yaml``:
-
-- ``dynamic_snitch``: whether the dynamic snitch should be enabled or disabled.
-- ``dynamic_snitch_update_interval_in_ms``: controls how often to perform the 
more expensive part of host score
-  calculation.
-- ``dynamic_snitch_reset_interval_in_ms``: if set greater than zero and 
read_repair_chance is < 1.0, this will allow
-  'pinning' of replicas to hosts in order to increase cache capacity.
-- ``dynamic_snitch_badness_threshold:``: The badness threshold will control 
how much worse the pinned host has to be
-  before the dynamic snitch will prefer other replicas over it.  This is 
expressed as a double which represents a
-  percentage.  Thus, a value of 0.2 means Cassandra would continue to prefer 
the static snitch values until the pinned
-  host was 20% worse than the fastest.
-
-Snitch classes
-^^
-
-The ``endpoint_snitch`` parameter in ``cassandra.yaml`` should be set to the 
class the class that implements
-``IEndPointSnitch`` which will be wrapped by the dynamic snitch and decide if 
two endpoints are in the same data center
-or on the same rack. Out of the box, Cassandra provides the snitch 
implementations:
-
-GossipingPropertyFileSnitch
-This should be your go-to snitch for production use. The rack and 
datacenter for the local node are defined in
-cassandra-rackdc.properties and propagated to other nodes via gossip. If 
``cassandra-topology.properties`` exists,
-it is used as a fallback, allowing migration from the PropertyFileSnitch.
-
-SimpleSnitch
-Treats Strategy order as proximity. This can improve cache locality when 
disabling read repair. Only appropriate for
-single-datacenter deployments.
-
-PropertyFileSnitch
-Proximity is determined by rack and data center, which are explicitly 
configured in
-``cassandra-topology.properties``.
-
-Ec2Snitch
-Appropriate for EC2 deployments in a single Region. Loads Region and 
Availability Zone information from the EC2 API.
-The Region is treated as the datacenter, and the Availability Zone as the 
rack. Only private IPs are used, so this
-will not work across multiple regions.
-
-Ec2MultiRegionSnitch
-Uses public IPs as broadcast_address to allow cross-region connectivity 
(thus, you should set seed addresses to the
-public IP as well). You will need to open the ``storage_port`` or 
``ssl_storage_port`` on the public IP firewall
-(For intra-Region traffic, Cassandra will switch to the private IP after 
establishing a connection).
-
-RackInferringSnitch
-Proximity is determined by rack and data center, which are assumed to 
correspond to the 3rd and 2nd octet of each
-node's IP address, respectively.  Unless this happens to match your 
deployment conventions, this is best used as an
-example of writing a custom Snitch class and is provided in that spirit.
-
-Adding, replacing, moving and removing nodes
-
-
-Bootstrap
-^
-
-Adding new nodes is called "bootstrapping". The ``num_tokens`` parameter will 
define the amount of virtual nodes
-(tokens) the 

[14/34] cassandra git commit: Fix CQL doc (incomplete)

2016-06-27 Thread slebresne
Fix CQL doc (incomplete)


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

Branch: refs/heads/trunk
Commit: 5d65542bd3b5cbdfe8ebed7892fce7e06e7779f0
Parents: 0ae8485
Author: Sylvain Lebresne 
Authored: Wed Jun 15 09:29:22 2016 +0200
Committer: Sylvain Lebresne 
Committed: Tue Jun 21 16:38:24 2016 +0200

--
 doc/cql3/CQL.textile |4 +-
 doc/source/_static/extra.css |4 +
 doc/source/architecture.rst  |2 +
 doc/source/cql.rst   | 3708 +++--
 doc/source/operations.rst|   15 +-
 5 files changed, 1967 insertions(+), 1766 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d65542b/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 275717c..e354524 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -1678,7 +1678,9 @@ Show any permissions granted to @carlos@ or any of 
@carlos@'s roles, limited to
 
 h2(#types). Data Types
 
-CQL supports a rich set of data types for columns defined in a table, 
including collection types. On top of those native and collection types, users 
can also provide custom types (through a JAVA class extending @AbstractType@ 
loadable by Cassandra). The syntax of types is thus:
+CQL supports a rich set of data types for columns defined in a table, 
including collection types. On top of those native
+and collection types, users can also provide custom types (through a JAVA 
class extending @AbstractType@ loadable by
+Cassandra). The syntax of types is thus:
 
 bc(syntax).. 
  ::= 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d65542b/doc/source/_static/extra.css
--
diff --git a/doc/source/_static/extra.css b/doc/source/_static/extra.css
index ff9f1d1..1b65a86 100644
--- a/doc/source/_static/extra.css
+++ b/doc/source/_static/extra.css
@@ -12,10 +12,14 @@ a.reference.internal code.literal {
 border: none;
 font-size: 12px;
 color: #2980B9;
+padding: 0;
+background: none;
 }
 
 a.reference.internal:visited code.literal {
 color: #9B59B6;
+padding: 0;
+background: none;
 }
 
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d65542b/doc/source/architecture.rst
--
diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst
index cb52477..9209414 100644
--- a/doc/source/architecture.rst
+++ b/doc/source/architecture.rst
@@ -40,6 +40,8 @@ Token Ring/Ranges
 
 .. todo:: todo
 
+.. _replication-strategy:
+
 Replication
 ^^^
 



[11/34] cassandra git commit: Add Change Data Capture documentation

2016-06-27 Thread slebresne
Add Change Data Capture documentation


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

Branch: refs/heads/trunk
Commit: 51b939c91db5d1a7664d76c8f57160f2570ee1dd
Parents: 7bf837c
Author: Josh McKenzie 
Authored: Mon Jun 20 13:38:00 2016 -0400
Committer: Sylvain Lebresne 
Committed: Tue Jun 21 14:12:59 2016 +0200

--
 doc/source/operations.rst | 75 --
 1 file changed, 73 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51b939c9/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 9094766..d7fcafb 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -338,7 +338,6 @@ There is a number of common options for all the compaction 
strategies;
 ``enabled`` (default: true)
 Whether minor compactions should run. Note that you can have 'enabled': 
true as a compaction option and then do
 'nodetool enableautocompaction' to start running compactions.
-Default true.
 ``tombstone_threshold`` (default: 0.2)
 How much of the sstable should be tombstones for us to consider doing a 
single sstable compaction of that sstable.
 ``tombstone_compaction_interval`` (default: 86400s (1 day))
@@ -738,7 +737,7 @@ similar text columns (such as repeated JSON blobs) often 
compress very well.
 Operational Impact
 ^^
 
-- Compression metadata is stored offheap and scales with data on disk.  This 
often requires 1-3GB of offheap RAM per
+- Compression metadata is stored off-heap and scales with data on disk.  This 
often requires 1-3GB of off-heap RAM per
   terabyte of data on disk, though the exact usage varies with 
``chunk_length_in_kb`` and compression ratios.
 
 - Streaming operations involve compressing and decompressing data on 
compressed tables - in some code paths (such as
@@ -754,6 +753,78 @@ Advanced Use
 Advanced users can provide their own compression class by implementing the 
interface at
 ``org.apache.cassandra.io.compress.ICompressor``.
 
+Change Data Capture
+---
+
+Overview
+
+
+Change data capture (CDC) provides a mechanism to flag specific tables for 
archival as well as rejecting writes to those
+tables once a configurable size-on-disk for the combined flushed and unflushed 
CDC-log is reached. An operator can
+enable CDC on a table by setting the table property ``cdc=true`` (either when 
:ref:`creating the table
+` or :ref:`altering it `), 
after which any CommitLogSegments containing
+data for a CDC-enabled table are moved to the directory specified in 
``cassandra.yaml`` on segment discard. A threshold
+of total disk space allowed is specified in the yaml at which time newly 
allocated CommitLogSegments will not allow CDC
+data until a consumer parses and removes data from the destination archival 
directory.
+
+Configuration
+^
+
+Enabling or disable CDC on a table
+~~
+
+CDC is enable or disable through the `cdc` table property, for instance::
+
+CREATE TABLE foo (a int, b text, PRIMARY KEY(a)) WITH cdc=true;
+
+ALTER TABLE foo WITH cdc=true;
+
+ALTER TABLE foo WITH cdc=false;
+
+cassandra.yaml parameters
+~
+
+The following `cassandra.yaml` are available for CDC:
+
+``cdc_enabled`` (default: false)
+   Enable or disable CDC operations node-wide.
+``cdc_raw_directory`` (default: ``$CASSANDRA_HOME/data/cdc_raw``)
+   Destination for CommitLogSegments to be moved after all corresponding 
memtables are flushed.
+``cdc_free_space_in_mb``: (default: min of 4096 and 1/8th volume space)
+   Calculated as sum of all active CommitLogSegments that permit CDC + all 
flushed CDC segments in
+   ``cdc_raw_directory``.
+``cdc_free_space_check_interval_ms`` (default: 250)
+   When at capacity, we limit the frequency with which we re-calculate the 
space taken up by ``cdc_raw_directory`` to
+   prevent burning CPU cycles unnecessarily. Default is to check 4 times per 
second.
+
+.. _reading-commitlogsegments:
+
+Reading CommitLogSegments
+^
+This implementation included a refactor of CommitLogReplayer into 
`CommitLogReader.java
+`__.
+Usage is `fairly straightforward

[05/34] cassandra git commit: Fill in Replication, Tuneable Consistency sections

2016-06-27 Thread slebresne
Fill in Replication, Tuneable Consistency sections


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

Branch: refs/heads/trunk
Commit: b1edbd12146b483516eaf3a90745ac664f46d609
Parents: 62e3d7d
Author: Tyler Hobbs 
Authored: Wed Jun 15 17:23:11 2016 -0500
Committer: Sylvain Lebresne 
Committed: Thu Jun 16 12:23:52 2016 +0200

--
 doc/source/architecture.rst | 96 +++-
 1 file changed, 94 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1edbd12/doc/source/architecture.rst
--
diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst
index 37a0027..3f8a8ca 100644
--- a/doc/source/architecture.rst
+++ b/doc/source/architecture.rst
@@ -43,12 +43,104 @@ Token Ring/Ranges
 Replication
 ^^^
 
-.. todo:: todo
+The replication strategy of a keyspace determines which nodes are replicas for 
a given token range. The two main
+replication strategies are :ref:`simple-strategy` and 
:ref:`network-topology-strategy`.
+
+.. _simple-strategy:
+
+SimpleStrategy
+~~
+
+SimpleStrategy allows a single integer ``replication_factor`` to be defined. 
This determines the number of nodes that
+should contain a copy of each row.  For example, if ``replication_factor`` is 
3, then three different nodes should store
+a copy of each row.
+
+SimpleStrategy treats all nodes identically, ignoring any configured 
datacenters or racks.  To determine the replicas
+for a token range, Cassandra iterates through the tokens in the ring, starting 
with the token range of interest.  For
+each token, it checks whether the owning node has been added to the set of 
replicas, and if it has not, it is added to
+the set.  This process continues until ``replication_factor`` distinct nodes 
have been added to the set of replicas.
+
+.. _network-topology-strategy:
+
+NetworkTopologyStrategy
+~~~
+
+NetworkTopologyStrategy allows a replication factor to be specified for each 
datacenter in the cluster.  Even if your
+cluster only uses a single datacenter, NetworkTopologyStrategy should be 
prefered over SimpleStrategy to make it easier
+to add new physical or virtual datacenters to the cluster later.
+
+In addition to allowing the replication factor to be specified per-DC, 
NetworkTopologyStrategy also attempts to choose
+replicas within a datacenter from different racks.  If the number of racks is 
greater than or equal to the replication
+factor for the DC, each replica will be chosen from a different rack.  
Otherwise, each rack will hold at least one
+replica, but some racks may hold more than one. Note that this rack-aware 
behavior has some potentially `surprising
+implications `_.  For 
example, if there are not an even number of
+nodes in each rack, the data load on the smallest rack may be much higher.  
Similarly, if a single node is bootstrapped
+into a new rack, it will be considered a replica for the entire ring.  For 
this reason, many operators choose to
+configure all nodes on a single "rack".
 
 Tunable Consistency
 ^^^
 
-.. todo:: todo
+Cassandra supports a per-operation tradeoff between consistency and 
availability through *Consistency Levels*.
+Essentially, an operation's consistency level specifies how many of the 
replicas need to respond to the coordinator in
+order to consider the operation a success.
+
+The following consistency levels are available:
+
+``ONE``
+  Only a single replica must respond.
+
+``TWO``
+  Two replicas must respond.
+
+``THREE``
+  Three replicas must respond.
+
+``QUORUM``
+  A majority (n/2 + 1) of the replicas must respond.
+
+``ALL``
+  All of the replicas must respond.
+
+``LOCAL_QUORUM``
+  A majority of the replicas in the local datacenter (whichever datacenter the 
coordinator is in) must respond.
+
+``EACH_QUORUM``
+  A majority of the replicas in each datacenter must respond.
+
+``LOCAL_ONE``
+  Only a single replica must respond.  In a multi-datacenter cluster, this 
also gaurantees that read requests are not
+  sent to replicas in a remote datacenter.
+
+``ANY``
+  A single replica may respond, or the coordinator may store a hint. If a hint 
is stored, the coordinator will later
+  attempt to replay the hint and deliver the mutation to the replicas.  This 
consistency level is only accepted for
+  write operations.
+
+Write operations are always sent to all replicas, regardless of consistency 
level. The consistency level simply

[18/34] cassandra git commit: Reorganize document

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/54f7335c/doc/source/operating/metrics.rst
--
diff --git a/doc/source/operating/metrics.rst b/doc/source/operating/metrics.rst
new file mode 100644
index 000..5884cad
--- /dev/null
+++ b/doc/source/operating/metrics.rst
@@ -0,0 +1,619 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+..
+.. http://www.apache.org/licenses/LICENSE-2.0
+..
+.. Unless required by applicable law or agreed to in writing, software
+.. distributed under the License is distributed on an "AS IS" BASIS,
+.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.. See the License for the specific language governing permissions and
+.. limitations under the License.
+
+.. highlight:: none
+
+Monitoring
+--
+
+Metrics in Cassandra are managed using the `Dropwizard Metrics 
`__ library. These metrics
+can be queried via JMX or pushed to external monitoring systems using a number 
of `built in
+`__ and 
`third party
+`__ reporter plugins.
+
+Metrics are collected for a single node. It's up to the operator to use an 
external monitoring system to aggregate them.
+
+Metric Types
+
+All metrics reported by cassandra fit into one of the following types.
+
+``Gauge``
+An instantaneous measurement of a value.
+
+``Counter``
+A gauge for an ``AtomicLong`` instance. Typically this is consumed by 
monitoring the change since the last call to
+see if there is a large increase compared to the norm.
+
+``Histogram``
+Measures the statistical distribution of values in a stream of data.
+
+In addition to minimum, maximum, mean, etc., it also measures median, 
75th, 90th, 95th, 98th, 99th, and 99.9th
+percentiles.
+
+``Timer``
+Measures both the rate that a particular piece of code is called and the 
histogram of its duration.
+
+``Latency``
+Special type that tracks latency (in microseconds) with a ``Timer`` plus a 
``Counter`` that tracks the total latency
+accrued since starting. The former is useful if you track the change in 
total latency since the last check. Each
+metric name of this type will have 'Latency' and 'TotalLatency' appended 
to it.
+
+``Meter``
+A meter metric which measures mean throughput and one-, five-, and 
fifteen-minute exponentially-weighted moving
+average throughputs.
+
+Table Metrics
+^
+
+Each table in Cassandra has metrics responsible for tracking its state and 
performance.
+
+The metric names are all appended with the specific ``Keyspace`` and ``Table`` 
name.
+
+Reported name format:
+
+**Metric Name**
+
``org.apache.cassandra.metrics.Table.{{MetricName}}.{{Keyspace}}.{{Table}}``
+
+**JMX MBean**
+``org.apache.cassandra.metrics:type=Table keyspace={{Keyspace} 
scope={{Table}} name={{MetricName}}``
+
+.. NOTE::
+There is a special table called '``all``' without a keyspace. This 
represents the aggregation of metrics across
+**all** tables and keyspaces on the node.
+
+
+=== == ===
+NameType   Description
+=== == ===
+MemtableOnHeapSize  GaugeTotal amount of data 
stored in the memtable that resides **on**-heap, including column related 
overhead and partitions overwritten.
+MemtableOffHeapSize GaugeTotal amount of data 
stored in the memtable that resides **off**-heap, including column related 
overhead and partitions overwritten.
+MemtableLiveDataSizeGaugeTotal amount of live 
data stored in the memtable, excluding any data structure overhead.
+AllMemtablesOnHeapSize  GaugeTotal amount of data 
stored in the memtables (2i and pending flush memtables included) that resides 
**on**-heap.
+AllMemtablesOffHeapSize GaugeTotal amount of data 
stored in the memtables (2i and pending flush memtables included) that resides 
**off**-heap.
+AllMemtablesLiveDataSizeGaugeTotal amount of live 
data stored in the memtables (2i and pending flush memtables included) that 
resides off-heap, excluding any data structure overhead.
+MemtableColumnsCountGaugeTotal number of columns 
present in the memtable.
+MemtableSwitchCount Counter

[09/34] cassandra git commit: Add Metrics/Monitoring docs

2016-06-27 Thread slebresne
Add Metrics/Monitoring docs


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

Branch: refs/heads/trunk
Commit: 0ae84853f84d915f5206f9d2abbeab1f66923ccb
Parents: 51b939c
Author: T Jake Luciani 
Authored: Mon Jun 20 14:09:57 2016 -0400
Committer: Sylvain Lebresne 
Committed: Tue Jun 21 14:12:59 2016 +0200

--
 doc/source/_static/extra.css |  12 +
 doc/source/operations.rst| 595 +-
 2 files changed, 605 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ae84853/doc/source/_static/extra.css
--
diff --git a/doc/source/_static/extra.css b/doc/source/_static/extra.css
index ec6aa3f..ff9f1d1 100644
--- a/doc/source/_static/extra.css
+++ b/doc/source/_static/extra.css
@@ -17,3 +17,15 @@ a.reference.internal code.literal {
 a.reference.internal:visited code.literal {
 color: #9B59B6;
 }
+
+
+/* override table width restrictions */
+.wy-table-responsive table td, .wy-table-responsive table th {
+white-space: normal;
+}
+
+.wy-table-responsive {
+margin-bottom: 24px;
+max-width: 100%;
+overflow: visible;
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ae84853/doc/source/operations.rst
--
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index d7fcafb..31ecc35 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -833,13 +833,604 @@ Backups
 Monitoring
 --
 
+Metrics in Cassandra are managed using the `Dropwizard Metrics 
`__ library. These metrics
+can be queried via JMX or pushed to external monitoring systems using a number 
of `built in
+`__ and 
`third party
+`__ reporter plugins.
+
+Metrics are collected for a single node. It's up to the operator to use an 
external monitoring system to aggregate them.
+
+Metric Types
+
+All metrics reported by cassandra fit into one of the following types.
+
+``Gauge``
+An instantaneous measurement of a value.
+
+``Counter``
+A gauge for an ``AtomicLong`` instance. Typically this is consumed by 
monitoring the change since the last call to
+see if there is a large increase compared to the norm.
+
+``Histogram``
+Measures the statistical distribution of values in a stream of data.
+
+In addition to minimum, maximum, mean, etc., it also measures median, 
75th, 90th, 95th, 98th, 99th, and 99.9th
+percentiles.
+
+``Timer``
+Measures both the rate that a particular piece of code is called and the 
histogram of its duration.
+
+``Latency``
+Special type that tracks latency (in microseconds) with a ``Timer`` plus a 
``Counter`` that tracks the total latency
+accrued since starting. The former is useful if you track the change in 
total latency since the last check. Each
+metric name of this type will have 'Latency' and 'TotalLatency' appended 
to it.
+
+``Meter``
+A meter metric which measures mean throughput and one-, five-, and 
fifteen-minute exponentially-weighted moving
+average throughputs.
+
+Table Metrics
+^
+
+Each table in Cassandra has metrics responsible for tracking its state and 
performance.
+
+The metric names are all appended with the specific ``Keyspace`` and ``Table`` 
name.
+
+Reported name format:
+
+**Metric Name**
+
``org.apache.cassandra.metrics.Table.{{MetricName}}.{{Keyspace}}.{{Table}}``
+
+**JMX MBean**
+``org.apache.cassandra.metrics:type=Table keyspace={{Keyspace} 
scope={{Table}} name={{MetricName}}``
+
+.. NOTE::
+There is a special table called '``all``' without a keyspace. This 
represents the aggregation of metrics across
+**all** tables and keyspaces on the node.
+
+
+=== == ===
+NameType   Description
+=== == ===
+MemtableOnHeapSize  GaugeTotal amount of data 
stored in the memtable that resides **on**-heap, including column related 
overhead and partitions overwritten.
+MemtableOffHeapSize GaugeTotal amount of data 
stored in the memtable that resides **off**-heap, including column related 
overhead and partitions overwritten.
+MemtableLiveDataSizeGaugeTotal amount of live 
data stored in the memtable, 

[13/34] cassandra git commit: Fix CQL doc (incomplete)

2016-06-27 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d65542b/doc/source/cql.rst
--
diff --git a/doc/source/cql.rst b/doc/source/cql.rst
index 8d36258..8d185a2 100644
--- a/doc/source/cql.rst
+++ b/doc/source/cql.rst
@@ -16,15 +16,11 @@
 
 .. highlight:: sql
 
+.. _UUID: https://en.wikipedia.org/wiki/Universally_unique_identifier
+
 The Cassandra Query Language (CQL)
 ==
 
-CQL Syntax
---
-
-Preamble
-
-
 This document describes the Cassandra Query Language (CQL) [#]_. Note that 
this document describes the last version of
 the languages. However, the `changes <#changes>`_ section provides the diff 
between the different versions of CQL.
 
@@ -33,6 +29,13 @@ that reason, when used in this document, these terms 
(tables, rows and columns)
 in SQL. But please note that as such, they do **not** refer to the concept of 
rows and columns found in the deprecated
 thrift API (and earlier version 1 and 2 of CQL).
 
+.. _definitions:
+
+Definitions
+---
+
+.. _conventions:
+
 Conventions
 ^^^
 
@@ -41,12 +44,18 @@ To aid in specifying the CQL syntax, we will use the 
following conventions in th
 - Language rules will be given in an informal `BNF variant
   `_ notation. 
In particular, we'll use square brakets
   (``[ item ]``) for optional items, ``*`` and ``+`` for repeated items (where 
``+`` imply at least one).
-- The grammar is provided for documentation purposes and leave some minor 
details out (only conveniences that can be
-  ignored). For instance, the comma on the last column definition in a 
``CREATE TABLE`` statement is optional but
-  supported if present even though the grammar in this document suggests 
otherwise. Also, not everything accepted by the
-  grammar will be valid CQL.
+- The grammar will also use the following convention for convenience: 
non-terminal term will be lowercase (and link to
+  their definition) while terminal keywords will be provided "all caps". Note 
however that keywords are
+  :ref:`identifiers` and are thus case insensitive in practice. We will also 
define some early construction using
+  regexp, which we'll indicate with ``re()``.
+- The grammar is provided for documentation purposes and leave some minor 
details out.  For instance, the comma on the
+  last column definition in a ``CREATE TABLE`` statement is optional but 
supported if present even though the grammar in
+  this document suggests otherwise. Also, not everything accepted by the 
grammar is necessarily valid CQL.
 - References to keywords or pieces of CQL code in running text will be shown 
in a ``fixed-width font``.
 
+
+.. _identifiers:
+
 Identifiers and keywords
 
 
@@ -54,7 +63,7 @@ The CQL language uses *identifiers* (or *names*) to identify 
tables, columns and
 matching the regular expression ``[a-zA-Z][a-zA-Z0-9_]*``.
 
 A number of such identifiers, like ``SELECT`` or ``WITH``, are *keywords*. 
They have a fixed meaning for the language
-and most are reserved. The list of those keywords can be found in `Appendix A 
<#appendixA>`__.
+and most are reserved. The list of those keywords can be found in 
:ref:`appendix-A`.
 
 Identifiers and (unquoted) keywords are case insensitive. Thus ``SELECT`` is 
the same than ``select`` or ``sElEcT``, and
 ``myId`` is the same than ``myid`` or ``MYID``. A convention often used (in 
particular by the samples of this
@@ -69,1203 +78,1611 @@ sensitive (``"My Quoted Id"`` is *different* from ``"my 
quoted id"``). A fully l
 ``"myid"`` is equivalent to ``myid`` and to ``myId`` but different from 
``"myId"``).  Inside a quoted identifier, the
 double-quote character can be repeated to escape it, so ``"foo "" bar"`` is a 
valid identifier.
 
-**Warning**: *quoted identifiers* allows to declare columns with arbitrary 
names, and those can sometime clash with
-specific names used by the server. For instance, when using conditional 
update, the server will respond with a
-result-set containing a special result named ``"[applied]"``. If you’ve 
declared a column with such a name, this could
-potentially confuse some tools and should be avoided. In general, unquoted 
identifiers should be preferred but if you
-use quoted identifiers, it is strongly advised to avoid any name enclosed by 
squared brackets (like ``"[applied]"``) and
-any name that looks like a function call (like ``"f(x)"``).
+.. note:: *quoted identifiers* allows to declare columns with arbitrary names, 
and those can sometime clash with
+   specific names used by the server. For instance, when using conditional 
update, the server will respond with a
+   result-set containing a special result named ``"[applied]"``. If you’ve 
declared a column with such a name, this
+   could potentially confuse some tools and should be avoided. In general, 
unquoted identifiers should be preferred 

[06/34] cassandra git commit: Add docs for cqlsh

2016-06-27 Thread slebresne
Add docs for cqlsh


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

Branch: refs/heads/trunk
Commit: 62e3d7dd2cfebc18029900983272b3ef076d81b3
Parents: 4d44402
Author: Tyler Hobbs 
Authored: Wed Jun 15 14:48:27 2016 -0500
Committer: Sylvain Lebresne 
Committed: Thu Jun 16 12:23:52 2016 +0200

--
 doc/source/cqlsh.rst   | 447 
 doc/source/getting_started.rst |  19 +-
 doc/source/index.rst   |   1 +
 3 files changed, 466 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/62e3d7dd/doc/source/cqlsh.rst
--
diff --git a/doc/source/cqlsh.rst b/doc/source/cqlsh.rst
new file mode 100644
index 000..4a1b716
--- /dev/null
+++ b/doc/source/cqlsh.rst
@@ -0,0 +1,447 @@
+.. highlight:: none
+
+.. _cqlsh:
+
+cqlsh
+=
+
+cqlsh is a command line shell for interacting with Cassandra through CQL (the 
Cassandra Query Language).  It is shipped
+with every Cassandra package, and can be found in the bin/ directory alongside 
the cassandra executable.  cqlsh utilizes
+the Python native protocol driver, and connects to the single node specified 
on the command line.
+
+
+Compatibility
+-
+
+cqlsh is compatible with Python 2.7.
+
+In general, a given version of cqlsh is only guaranteed to work with the 
version of Cassandra that it was released with.
+In some cases, cqlsh make work with older or newer versions of Cassandra, but 
this is not officially supported.
+
+
+Optional Dependencies
+-
+
+cqlsh ships with all essential dependencies.  However, there are some optional 
dependencies that can be installed to
+improve the capabilities of cqlsh.
+
+pytz
+
+By default, cqlsh displays all timestamps with a UTC timezone.  To support 
display of timestamps with another timezone,
+the `pytz `__ library must be installed.  See 
the ``timezone`` option in cqlshrc_ for
+specifying a timezone to use.
+
+cython
+^^
+The performance of cqlsh's ``COPY`` operations can be improved by installing 
`cython `__.  This will
+compile the python modules that are central to the performance of ``COPY``.
+
+cqlshrc
+---
+
+The ``cqlshrc`` file holds configuration options for cqlsh.  By default this 
is in the user's home directory at
+``~/.cassandra/cqlsh``, but a custom location can be specified with the 
``--cqlshrc`` option.
+
+Example config values and documentation can be found in the 
``conf/cqlshrc.sample`` file of a tarball installation.  You
+can also view the latest version of `cqlshrc online 
`__.
+
+
+Command Line Options
+
+Usage:
+
+``cqlsh [options] [host [port]]``
+
+Options:
+
+``-C`` ``--color``
+  Force color output
+
+``--no-color``
+  Disable color output
+
+``--browser``
+  Specify the browser to use for displaying cqlsh help.  This can be one of 
the `supported browser names
+  `__ (e.g. ``firefox``) or 
a browser path followed by ``%s`` (e.g.
+  ``/usr/bin/google-chrome-stable %s``).
+
+``--ssl``
+  Use SSL when connecting to Cassandra
+
+``-u`` ``--user``
+  Username to authenticate against Cassandra with
+
+``-p`` ``--password``
+  Password to authenticate against Cassandra with, should
+  be used in conjunction with ``--user``
+
+``-k`` ``--keyspace``
+  Keyspace to authenticate to, should be used in conjunction
+  with ``--user``
+
+``-f`` ``--file``
+  Execute commands from the given file, then exit
+
+``--debug``
+  Print additional debugging information
+
+``--encoding``
+  Specify a non-default encoding for output (defaults to UTF-8)
+
+``--cqlshrc``
+  Specify a non-default location for the ``cqlshrc`` file
+
+``-e`` ``--execute``
+  Execute the given statement, then exit
+
+``--connect-timeout``
+  Specify the connection timeout in seconds (defaults to 2s)
+
+``--request-timeout``
+  Specify the request timeout in seconds (defaults to 10s)
+
+``-t`` ``--tty``
+  Force tty mode (command prompt)
+
+
+Special Commands
+
+
+In addition to supporting regular CQL statements, cqlsh also supports a number 
of special commands that are not part of
+CQL.  These are detailed below.
+
+``CONSISTENCY``
+^^^
+
+`Usage`: ``CONSISTENCY ``
+
+Sets the consistency level for operations to follow.  Valid arguments include:
+
+- ``ANY``
+- ``ONE``
+- ``TWO``
+- ``THREE``
+- ``QUORUM``
+- ``ALL``
+- ``LOCAL_QUORUM``
+- 

[03/34] cassandra git commit: Add initial in-tree documentation (very incomplete so far)

2016-06-27 Thread slebresne
Add initial in-tree documentation (very incomplete so far)

patch by Stefania, jjirsa, rspitzer & slebresne; reviewed by slebresne for 
CASSANDRA-8700


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

Branch: refs/heads/trunk
Commit: cad277be41ad4d5488cb96c5ef3f2fcb1cc8d3d9
Parents: 719e7d6
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Tue Jun 14 14:45:16 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Tue Jun 14 18:16:42 2016 +0200

--
 build.xml  |   13 +
 doc/Makefile   |  225 ++
 doc/README.md  |   31 +
 doc/make.bat   |  281 +++
 doc/source/_static/extra.css   |   19 +
 doc/source/architecture.rst|   74 +
 doc/source/conf.py |  430 
 doc/source/contactus.rst   |   49 +
 doc/source/cql.rst | 3916 +++
 doc/source/faq.rst |   20 +
 doc/source/getting_started.rst |  252 +++
 doc/source/index.rst   |   35 +
 doc/source/operations.rst  |  369 
 doc/source/troubleshooting.rst |   20 +
 14 files changed, 5734 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cad277be/build.xml
--
diff --git a/build.xml b/build.xml
index aa55809..51f7252 100644
--- a/build.xml
+++ b/build.xml
@@ -67,6 +67,8 @@
 
 
 
+
+

 
 
@@ -249,6 +251,17 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
 

[1/3] cassandra git commit: Add a metrics timer to MemtablePool and use it to track time spent blocked on memory in MemtableAllocator.

2016-06-23 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 0d7eb1878 -> 458b36b5a
  refs/heads/trunk 465702399 -> 5c84fe4f9


Add a metrics timer to MemtablePool and use it to track time spent blocked on 
memory in MemtableAllocator.

patch by aweisberg; reviewed by cnlwsu for CASSANDRA-11327


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

Branch: refs/heads/cassandra-3.0
Commit: 458b36b5a5390a2dd6ddc24af3a85179e95faebf
Parents: 0d7eb18
Author: Ariel Weisberg 
Authored: Mon Jun 13 21:58:38 2016 -0400
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:16:09 2016 +0200

--
 CHANGES.txt |  1 +
 .../cassandra/utils/memory/MemtableAllocator.java   |  2 +-
 .../org/apache/cassandra/utils/memory/MemtablePool.java | 12 
 3 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index ddbac69..ee2f6d3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.8
+ * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)
  * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
  * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 Merged from 2.2:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
--
diff --git a/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java 
b/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
index 588b433..5a64c3c 100644
--- a/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
+++ b/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
@@ -183,7 +183,7 @@ public abstract class MemtableAllocator
 acquired(size);
 return;
 }
-WaitQueue.Signal signal = 
opGroup.isBlockingSignal(parent.hasRoom().register());
+WaitQueue.Signal signal = 
opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext()));
 boolean allocated = parent.tryAllocate(size);
 if (allocated || opGroup.isBlocking())
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
--
diff --git a/src/java/org/apache/cassandra/utils/memory/MemtablePool.java 
b/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
index bb85884..e792944 100644
--- a/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
+++ b/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
@@ -20,6 +20,9 @@ package org.apache.cassandra.utils.memory;
 
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 
+import com.codahale.metrics.Timer;
+import org.apache.cassandra.metrics.CassandraMetricsRegistry;
+import org.apache.cassandra.metrics.DefaultNameFactory;
 import org.apache.cassandra.utils.concurrent.WaitQueue;
 
 
@@ -35,6 +38,8 @@ public abstract class MemtablePool
 public final SubPool onHeap;
 public final SubPool offHeap;
 
+public final Timer blockedOnAllocating;
+
 final WaitQueue hasRoom = new WaitQueue();
 
 MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float 
cleanThreshold, Runnable cleaner)
@@ -42,6 +47,8 @@ public abstract class MemtablePool
 this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold);
 this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold);
 this.cleaner = getCleaner(cleaner);
+blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new 
DefaultNameFactory("MemtablePool")
+ 
.createMetricName("BlockedOnAllocation"));
 if (this.cleaner != null)
 this.cleaner.start();
 }
@@ -209,6 +216,11 @@ public abstract class MemtablePool
 {
 return hasRoom;
 }
+
+public Timer.Context blockedTimerContext()
+{
+return blockedOnAllocating.time();
+}
 }
 
 private static final AtomicLongFieldUpdater reclaimingUpdater = 
AtomicLongFieldUpdater.newUpdater(SubPool.class, "reclaiming");



[3/3] cassandra git commit: Merge branch 'cassandra-3.0' into trunk

2016-06-23 Thread slebresne
Merge branch 'cassandra-3.0' into trunk

* cassandra-3.0:
  Add a metrics timer to MemtablePool and use it to track time spent blocked on 
memory in MemtableAllocator.


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

Branch: refs/heads/trunk
Commit: 5c84fe4f9deb0a8c889543dfb36ac1b55fecfc10
Parents: 4657023 458b36b
Author: Sylvain Lebresne 
Authored: Thu Jun 23 11:18:19 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:18:19 2016 +0200

--
 CHANGES.txt |  1 +
 .../cassandra/utils/memory/MemtableAllocator.java   |  2 +-
 .../org/apache/cassandra/utils/memory/MemtablePool.java | 12 
 3 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c84fe4f/CHANGES.txt
--
diff --cc CHANGES.txt
index 59ae769,ee2f6d3..5c03f93
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,22 -1,5 +1,23 @@@
 -3.0.8
 +3.8
 + * Support seek() in EncryptedFileSegmentInputStream (CASSANDRA-11957)
 + * SSTable tools mishandling LocalPartitioner (CASSANDRA-12002)
 + * When SEPWorker assigned work, set thread name to match pool 
(CASSANDRA-11966)
 + * Add cross-DC latency metrics (CASSANDRA-11596)
 + * Allow terms in selection clause (CASSANDRA-10783)
 + * Add bind variables to trace (CASSANDRA-11719)
 + * Switch counter shards' clock to timestamps (CASSANDRA-9811)
 + * Introduce HdrHistogram and response/service/wait separation to stress tool 
(CASSANDRA-11853)
 + * entry-weighers in QueryProcessor should respect partitionKeyBindIndexes 
field (CASSANDRA-11718)
 + * Support older ant versions (CASSANDRA-11807)
 + * Estimate compressed on disk size when deciding if sstable size limit 
reached (CASSANDRA-11623)
 + * cassandra-stress profiles should support case sensitive schemas 
(CASSANDRA-11546)
 + * Remove DatabaseDescriptor dependency from FileUtils (CASSANDRA-11578)
 + * Faster streaming (CASSANDRA-9766)
 + * Add prepared query parameter to trace for "Execute CQL3 prepared query" 
session (CASSANDRA-11425)
 + * Add repaired percentage metric (CASSANDRA-11503)
 + * Add Change-Data-Capture (CASSANDRA-8844)
 +Merged from 3.0:
+  * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)
   * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
   * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
  Merged from 2.2:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c84fe4f/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c84fe4f/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
--



[2/3] cassandra git commit: Add a metrics timer to MemtablePool and use it to track time spent blocked on memory in MemtableAllocator.

2016-06-23 Thread slebresne
Add a metrics timer to MemtablePool and use it to track time spent blocked on 
memory in MemtableAllocator.

patch by aweisberg; reviewed by cnlwsu for CASSANDRA-11327


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

Branch: refs/heads/trunk
Commit: 458b36b5a5390a2dd6ddc24af3a85179e95faebf
Parents: 0d7eb18
Author: Ariel Weisberg 
Authored: Mon Jun 13 21:58:38 2016 -0400
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:16:09 2016 +0200

--
 CHANGES.txt |  1 +
 .../cassandra/utils/memory/MemtableAllocator.java   |  2 +-
 .../org/apache/cassandra/utils/memory/MemtablePool.java | 12 
 3 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index ddbac69..ee2f6d3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.8
+ * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)
  * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
  * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 Merged from 2.2:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
--
diff --git a/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java 
b/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
index 588b433..5a64c3c 100644
--- a/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
+++ b/src/java/org/apache/cassandra/utils/memory/MemtableAllocator.java
@@ -183,7 +183,7 @@ public abstract class MemtableAllocator
 acquired(size);
 return;
 }
-WaitQueue.Signal signal = 
opGroup.isBlockingSignal(parent.hasRoom().register());
+WaitQueue.Signal signal = 
opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext()));
 boolean allocated = parent.tryAllocate(size);
 if (allocated || opGroup.isBlocking())
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/458b36b5/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
--
diff --git a/src/java/org/apache/cassandra/utils/memory/MemtablePool.java 
b/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
index bb85884..e792944 100644
--- a/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
+++ b/src/java/org/apache/cassandra/utils/memory/MemtablePool.java
@@ -20,6 +20,9 @@ package org.apache.cassandra.utils.memory;
 
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 
+import com.codahale.metrics.Timer;
+import org.apache.cassandra.metrics.CassandraMetricsRegistry;
+import org.apache.cassandra.metrics.DefaultNameFactory;
 import org.apache.cassandra.utils.concurrent.WaitQueue;
 
 
@@ -35,6 +38,8 @@ public abstract class MemtablePool
 public final SubPool onHeap;
 public final SubPool offHeap;
 
+public final Timer blockedOnAllocating;
+
 final WaitQueue hasRoom = new WaitQueue();
 
 MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float 
cleanThreshold, Runnable cleaner)
@@ -42,6 +47,8 @@ public abstract class MemtablePool
 this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold);
 this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold);
 this.cleaner = getCleaner(cleaner);
+blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new 
DefaultNameFactory("MemtablePool")
+ 
.createMetricName("BlockedOnAllocation"));
 if (this.cleaner != null)
 this.cleaner.start();
 }
@@ -209,6 +216,11 @@ public abstract class MemtablePool
 {
 return hasRoom;
 }
+
+public Timer.Context blockedTimerContext()
+{
+return blockedOnAllocating.time();
+}
 }
 
 private static final AtomicLongFieldUpdater reclaimingUpdater = 
AtomicLongFieldUpdater.newUpdater(SubPool.class, "reclaiming");



[3/6] cassandra git commit: Allow nodetool info to run with readonly JMX access

2016-06-23 Thread slebresne
Allow nodetool info to run with readonly JMX access

Patch by Jérôme Mainaud; Reviewed by Paulo Motta for CASSANDRA-11755


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

Branch: refs/heads/trunk
Commit: 774e59dc3d1e51b700413642416c202376bcb061
Parents: 0171259
Author: Jérôme Mainaud 
Authored: Tue Jun 21 10:25:53 2016 -0300
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:12:21 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 59a9794..0be1043 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.7
+ * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
  * Validate bloom_filter_fp_chance against lowest supported
value when the table is created (CASSANDRA-11920)
  * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
index c2f88bb..bbfabb6 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
@@ -25,6 +25,7 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class EndpointSnitchInfo implements EndpointSnitchInfoMBean
 {
@@ -51,6 +52,16 @@ public class EndpointSnitchInfo implements 
EndpointSnitchInfoMBean
 return 
DatabaseDescriptor.getEndpointSnitch().getRack(InetAddress.getByName(host));
 }
 
+public String getDatacenter()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress());
+}
+
+public String getRack()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress());
+}
+
 public String getSnitchName()
 {
 return DatabaseDescriptor.getEndpointSnitch().getClass().getName();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
index 84d2499..6de5022 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
@@ -38,6 +38,15 @@ public interface EndpointSnitchInfoMBean
  */
 public String getDatacenter(String host) throws UnknownHostException;
 
+/**
+ * Provides the Rack name depending on the respective snitch used for this 
node
+ */
+public String getRack();
+
+/**
+ * Provides the Datacenter name depending on the respective snitch used 
for this node
+ */
+public String getDatacenter();
 
 /**
  * Provides the snitch name of the cluster

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/tools/NodeProbe.java
--
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java 
b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 2f27cea..24c5874 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -780,26 +780,12 @@ public class NodeProbe implements AutoCloseable
 
 public String getDataCenter()
 {
-try
-{
-return getEndpointSnitchInfoProxy().getDatacenter(getEndpoint());
-}
-catch (UnknownHostException e)
-{
-return "Unknown";
-}
+return getEndpointSnitchInfoProxy().getDatacenter();
 }
 
 public String getRack()
 {
-try
-  

[5/6] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2016-06-23 Thread slebresne
Merge branch 'cassandra-2.2' into cassandra-3.0

* cassandra-2.2:
  Allow nodetool info to run with readonly JMX access


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

Branch: refs/heads/cassandra-3.0
Commit: 0d7eb18786a1e589ec803a07ac9ae9e77f481edb
Parents: 40ab631 774e59d
Author: Sylvain Lebresne 
Authored: Thu Jun 23 11:12:51 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:12:51 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0d7eb187/CHANGES.txt
--
diff --cc CHANGES.txt
index d57fb7d,0be1043..ddbac69
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,38 -1,10 +1,39 @@@
 -2.2.7
 +3.0.8
 + * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
 + * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 +Merged from 2.2:
+  * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
 + * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0d7eb187/src/java/org/apache/cassandra/tools/NodeProbe.java
--



[2/6] cassandra git commit: Allow nodetool info to run with readonly JMX access

2016-06-23 Thread slebresne
Allow nodetool info to run with readonly JMX access

Patch by Jérôme Mainaud; Reviewed by Paulo Motta for CASSANDRA-11755


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

Branch: refs/heads/cassandra-3.0
Commit: 774e59dc3d1e51b700413642416c202376bcb061
Parents: 0171259
Author: Jérôme Mainaud 
Authored: Tue Jun 21 10:25:53 2016 -0300
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:12:21 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 59a9794..0be1043 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.7
+ * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
  * Validate bloom_filter_fp_chance against lowest supported
value when the table is created (CASSANDRA-11920)
  * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
index c2f88bb..bbfabb6 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
@@ -25,6 +25,7 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class EndpointSnitchInfo implements EndpointSnitchInfoMBean
 {
@@ -51,6 +52,16 @@ public class EndpointSnitchInfo implements 
EndpointSnitchInfoMBean
 return 
DatabaseDescriptor.getEndpointSnitch().getRack(InetAddress.getByName(host));
 }
 
+public String getDatacenter()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress());
+}
+
+public String getRack()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress());
+}
+
 public String getSnitchName()
 {
 return DatabaseDescriptor.getEndpointSnitch().getClass().getName();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
index 84d2499..6de5022 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
@@ -38,6 +38,15 @@ public interface EndpointSnitchInfoMBean
  */
 public String getDatacenter(String host) throws UnknownHostException;
 
+/**
+ * Provides the Rack name depending on the respective snitch used for this 
node
+ */
+public String getRack();
+
+/**
+ * Provides the Datacenter name depending on the respective snitch used 
for this node
+ */
+public String getDatacenter();
 
 /**
  * Provides the snitch name of the cluster

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/tools/NodeProbe.java
--
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java 
b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 2f27cea..24c5874 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -780,26 +780,12 @@ public class NodeProbe implements AutoCloseable
 
 public String getDataCenter()
 {
-try
-{
-return getEndpointSnitchInfoProxy().getDatacenter(getEndpoint());
-}
-catch (UnknownHostException e)
-{
-return "Unknown";
-}
+return getEndpointSnitchInfoProxy().getDatacenter();
 }
 
 public String getRack()
 {
-   

[4/6] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2016-06-23 Thread slebresne
Merge branch 'cassandra-2.2' into cassandra-3.0

* cassandra-2.2:
  Allow nodetool info to run with readonly JMX access


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

Branch: refs/heads/trunk
Commit: 0d7eb18786a1e589ec803a07ac9ae9e77f481edb
Parents: 40ab631 774e59d
Author: Sylvain Lebresne 
Authored: Thu Jun 23 11:12:51 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:12:51 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0d7eb187/CHANGES.txt
--
diff --cc CHANGES.txt
index d57fb7d,0be1043..ddbac69
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,38 -1,10 +1,39 @@@
 -2.2.7
 +3.0.8
 + * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
 + * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 +Merged from 2.2:
+  * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
 + * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0d7eb187/src/java/org/apache/cassandra/tools/NodeProbe.java
--



[1/6] cassandra git commit: Allow nodetool info to run with readonly JMX access

2016-06-23 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 0171259d0 -> 774e59dc3
  refs/heads/cassandra-3.0 40ab6312d -> 0d7eb1878
  refs/heads/trunk c310adde0 -> 465702399


Allow nodetool info to run with readonly JMX access

Patch by Jérôme Mainaud; Reviewed by Paulo Motta for CASSANDRA-11755


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

Branch: refs/heads/cassandra-2.2
Commit: 774e59dc3d1e51b700413642416c202376bcb061
Parents: 0171259
Author: Jérôme Mainaud 
Authored: Tue Jun 21 10:25:53 2016 -0300
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:12:21 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 59a9794..0be1043 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.7
+ * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
  * Validate bloom_filter_fp_chance against lowest supported
value when the table is created (CASSANDRA-11920)
  * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
index c2f88bb..bbfabb6 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfo.java
@@ -25,6 +25,7 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class EndpointSnitchInfo implements EndpointSnitchInfoMBean
 {
@@ -51,6 +52,16 @@ public class EndpointSnitchInfo implements 
EndpointSnitchInfoMBean
 return 
DatabaseDescriptor.getEndpointSnitch().getRack(InetAddress.getByName(host));
 }
 
+public String getDatacenter()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress());
+}
+
+public String getRack()
+{
+return 
DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress());
+}
+
 public String getSnitchName()
 {
 return DatabaseDescriptor.getEndpointSnitch().getClass().getName();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
--
diff --git a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java 
b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
index 84d2499..6de5022 100644
--- a/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
+++ b/src/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java
@@ -38,6 +38,15 @@ public interface EndpointSnitchInfoMBean
  */
 public String getDatacenter(String host) throws UnknownHostException;
 
+/**
+ * Provides the Rack name depending on the respective snitch used for this 
node
+ */
+public String getRack();
+
+/**
+ * Provides the Datacenter name depending on the respective snitch used 
for this node
+ */
+public String getDatacenter();
 
 /**
  * Provides the snitch name of the cluster

http://git-wip-us.apache.org/repos/asf/cassandra/blob/774e59dc/src/java/org/apache/cassandra/tools/NodeProbe.java
--
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java 
b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 2f27cea..24c5874 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -780,26 +780,12 @@ public class NodeProbe implements AutoCloseable
 
 public String getDataCenter()
 {
-try
-{
-return getEndpointSnitchInfoProxy().getDatacenter(getEndpoint());
-}
-catch 

[6/6] cassandra git commit: Merge branch 'cassandra-3.0' into trunk

2016-06-23 Thread slebresne
Merge branch 'cassandra-3.0' into trunk

* cassandra-3.0:
  Allow nodetool info to run with readonly JMX access


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

Branch: refs/heads/trunk
Commit: 465702399c064ede65e42a08be5f29103cb16b57
Parents: c310add 0d7eb18
Author: Sylvain Lebresne 
Authored: Thu Jun 23 11:13:03 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:13:03 2016 +0200

--
 CHANGES.txt   |  1 +
 .../cassandra/locator/EndpointSnitchInfo.java | 11 +++
 .../locator/EndpointSnitchInfoMBean.java  |  9 +
 .../org/apache/cassandra/tools/NodeProbe.java | 18 ++
 4 files changed, 23 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/46570239/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/46570239/src/java/org/apache/cassandra/tools/NodeProbe.java
--



[03/13] cassandra git commit: Fix handling of clustering key > 64K

2016-06-23 Thread slebresne
Fix handling of clustering key > 64K

Prevent select statements with clustering key > 64k,
nicer error message when writing a value larger than unsigned short,
catch Throwable for OutboundTCPConnection.

Patch by Lerh Chuan Low; reviewed by Branimir Lambov for CASSANDRA-11882


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

Branch: refs/heads/cassandra-3.0
Commit: 452d626a7a6b03917b7bd72a5dfe9da8a27e0903
Parents: 720870b
Author: Lerh Chuan Low 
Authored: Tue May 31 18:01:58 2016 +1000
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:52:14 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/SelectStatement.java|  7 ++-
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  8 +++-
 .../org/apache/cassandra/cql3/CQLTester.java|  2 +
 .../cql3/validation/operations/InsertTest.java  | 45 
 .../cql3/validation/operations/SelectTest.java  | 29 +
 7 files changed, 91 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 7474045..9a3779c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
  * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
  * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
  * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 8a6d704..1e142e0 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1081,7 +1081,12 @@ public class SelectStatement implements CQLStatement
 private List getRequestedBound(Bound b, QueryOptions options) 
throws InvalidRequestException
 {
 assert isColumnRange();
-return buildBound(b, cfm.clusteringColumns(), columnRestrictions, 
isReversed, cfm.comparator, options);
+List bound = buildBound(b, cfm.clusteringColumns(), 
columnRestrictions, isReversed, cfm.comparator, options);
+for (Composite c : bound) {
+if (!c.isEmpty())
+QueryProcessor.validateComposite(c, cfm.comparator);
+}
+return bound;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 0d588c8..1a88220 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -285,8 +285,9 @@ public class OutboundTcpConnection extends Thread
 if (flush)
 out.flush();
 }
-catch (Exception e)
+catch (Throwable e)
 {
+JVMStabilityInspector.inspectThrowable(e);
 disconnect();
 if (e instanceof IOException)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
--
diff --git a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java 
b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
index e41069f..b78b8eb 100644
--- a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
+++ b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
@@ -287,7 +287,9 @@ public class ByteBufferUtil
 public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus 
out) throws IOException
 {
 int length = buffer.remaining();
-assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT : 
length;
+assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT :
+String.format("Attempted serializing to buffer exceeded maximum of 
%s bytes: %s", 

[13/13] cassandra git commit: Merge branch 'cassandra-3.0' into trunk

2016-06-23 Thread slebresne
Merge branch 'cassandra-3.0' into trunk

* cassandra-3.0:
  Fix handling of clustering key > 64K


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

Branch: refs/heads/trunk
Commit: c310adde0ea1f53c46fec5529ecf18efe3af9429
Parents: 233c030 40ab631
Author: Sylvain Lebresne 
Authored: Thu Jun 23 11:06:53 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:06:53 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/ModificationStatement.java  | 10 ++
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  2 ++
 .../cql3/validation/operations/InsertTest.java  | 37 +++-
 .../cql3/validation/operations/SelectTest.java  | 21 +--
 7 files changed, 66 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/test/unit/org/apache/cassandra/cql3/CQLTester.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c310adde/test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
index 5314d6a,a030613..9adcb62
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
@@@ -22,8 -21,7 +22,9 @@@ import org.junit.Assert
  import org.junit.Test;
  
  import org.apache.cassandra.cql3.CQLTester;
 +import org.apache.cassandra.cql3.UntypedResultSet;
 +import org.apache.cassandra.cql3.UntypedResultSet.Row;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
  
  public class InsertTest extends CQLTester
  {
@@@ -287,31 -285,27 +288,49 @@@
   "INSERT INTO %s (partitionKey, clustering_2, 
staticValue) VALUES (0, 0, 'A')");
  }
  
 -private void flush(boolean forceFlush)
 +@Test
 +public void testInsertWithDefaultTtl() throws Throwable
  {
 -if (forceFlush)
 -flush();
 +final int secondsPerMinute = 60;
 +createTable("CREATE TABLE %s (a int PRIMARY KEY, b int) WITH 
default_time_to_live = " + (10 * secondsPerMinute));
 +
 +execute("INSERT INTO %s (a, b) VALUES (1, 1)");
 +UntypedResultSet resultSet = execute("SELECT ttl(b) FROM %s WHERE a = 
1");
 +Assert.assertEquals(1, resultSet.size());
 +Row row = resultSet.one();
 +Assert.assertTrue(row.getInt("ttl(b)") >= (9 * secondsPerMinute));
 +
 +execute("INSERT INTO %s (a, b) VALUES (2, 2) USING TTL ?", (5 * 
secondsPerMinute));
 +resultSet = execute("SELECT ttl(b) FROM %s WHERE a = 2");
 +Assert.assertEquals(1, resultSet.size());
 +row = resultSet.one();
 +Assert.assertTrue(row.getInt("ttl(b)") <= (5 * secondsPerMinute));
 +
 +execute("INSERT INTO %s (a, b) VALUES (3, 3) USING TTL ?", 0);
 +assertRows(execute("SELECT ttl(b) FROM %s WHERE a = 3"), row(new 
Object[]{null}));
 +
 +execute("INSERT INTO %s (a, b) VALUES (4, 4) USING TTL ?", unset());
 +resultSet = execute("SELECT ttl(b) FROM %s WHERE a = 4");
 +Assert.assertEquals(1, resultSet.size());
 +row = resultSet.one();
 +Assert.assertTrue(row.getInt("ttl(b)") >= (9 * secondsPerMinute));
  }
+ 
+ @Test
+ public void testPKInsertWithValueOver64K() throws Throwable
+ {
+ createTable("CREATE TABLE %s (a text, b text, PRIMARY KEY (a, b))");
+ 
+ assertInvalidThrow(InvalidRequestException.class,
+"INSERT INTO %s (a, b) VALUES (?, 'foo')", new 

[12/13] cassandra git commit: Merge commit '0171259d05a2dd5ec901ccadda016361312b59a9' into cassandra-3.0

2016-06-23 Thread slebresne
Merge commit '0171259d05a2dd5ec901ccadda016361312b59a9' into cassandra-3.0

* commit '0171259d05a2dd5ec901ccadda016361312b59a9':
  Fix handling of clustering key > 64K


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

Branch: refs/heads/trunk
Commit: 40ab6312d014524908d064d022cc63f1a3adf149
Parents: d354ddc 0171259
Author: Sylvain Lebresne 
Authored: Thu Jun 23 10:58:14 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:03:16 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/ModificationStatement.java  | 10 ++
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  2 ++
 .../cql3/validation/operations/InsertTest.java  | 37 +++-
 .../cql3/validation/operations/SelectTest.java  | 21 +--
 7 files changed, 66 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/40ab6312/CHANGES.txt
--
diff --cc CHANGES.txt
index 26f24b0,59a9794..d57fb7d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,37 -1,9 +1,38 @@@
 -2.2.7
 +3.0.8
 + * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
 + * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 +Merged from 2.2:
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
++ * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/40ab6312/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 12bade5,5ffcc8a..01c2ad1
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@@ -606,137 -726,49 +606,147 @@@ public abstract class ModificationState
   * @param now the current timestamp in microseconds to use if no 
timestamp is user provided.
   *
   * @return list of the mutations
 - * @throws InvalidRequestException on invalid requests
   */
  private Collection 

[10/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

* commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903':
  Fix handling of clustering key > 64K


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

Branch: refs/heads/trunk
Commit: 0171259d05a2dd5ec901ccadda016361312b59a9
Parents: 8d5b7b6 452d626
Author: Sylvain Lebresne 
Authored: Thu Jun 23 10:55:27 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:57:32 2016 +0200

--
 CHANGES.txt |  2 +-
 .../restrictions/StatementRestrictions.java |  7 -
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  1 +
 .../cql3/validation/operations/InsertTest.java  | 19 +
 .../cql3/validation/operations/SelectTest.java  | 30 +++-
 7 files changed, 62 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/CHANGES.txt
--
diff --cc CHANGES.txt
index 5106fad,9a3779c..59a9794
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,35 @@@
 -2.1.15
 +2.2.7
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
- 2.1.15
+  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
   * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
   * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
   * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
index 5b7c58d,000..6f03c40
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
@@@ -1,608 -1,0 +1,613 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + 

[09/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 97fdf6a,6acab6f..9b10d0e
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -23,10 -23,12 +23,11 @@@ import java.util.UUID
  import org.junit.Test;
  
  import junit.framework.Assert;
 -import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.cql3.UntypedResultSet;
 -import org.apache.cassandra.cql3.CQLTester;
 -import org.apache.cassandra.dht.Murmur3Partitioner;
 +import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
 +import org.apache.cassandra.utils.ByteBufferUtil;
 +import org.apache.cassandra.cql3.CQLTester;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertTrue;
@@@ -36,7 -38,11 +37,6 @@@
   */
  public class SelectTest extends CQLTester
  {
- private static final ByteBuffer TOO_BIG = ByteBuffer.allocate(1024 * 65);
 -@BeforeClass
 -public static void setUp()
 -{
 -DatabaseDescriptor.setPartitioner(new Murmur3Partitioner());
 -}
  
  @Test
  public void testSingleClustering() throws Throwable
@@@ -1367,887 -1238,30 +1367,915 @@@
  }
  
  @Test
 +public void testAlias() throws Throwable
 +{
 +createTable("CREATE TABLE %s (id int PRIMARY KEY, name text)");
 +
 +for (int i = 0; i < 5; i++)
 +execute("INSERT INTO %s (id, name) VALUES (?, ?) USING TTL 10 AND 
TIMESTAMP 0", i, Integer.toString(i));
 +
 +assertInvalidMessage("Aliases aren't allowed in the where clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE user_id = 0");
 +
 +// test that select throws a meaningful exception for aliases in 
order by clause
 +assertInvalidMessage("Aliases are not allowed in order by clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE id IN (0) ORDER BY user_name");
 +
 +}
 +
 +@Test
 +public void testFilteringWithoutIndices() throws Throwable
 +{
 +createTable("CREATE TABLE %s (a int, b int, c int, d int, e map, PRIMARY KEY (a, b))");
 +
 +// Checks filtering
 +assertInvalidMessage("Predicates on non-primary-key columns (c, d) 
are not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = 1 AND d = 2 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE a = 1 AND b = 1 AND c = 
2 ALLOW FILTERING");
 +assertInvalidMessage("IN predicates on non-primary-key columns (c) is 
not yet supported",
 + "SELECT * FROM %s WHERE a IN (1, 2) AND c IN (2, 
3) ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > 2 ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS 1 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY 1 ALLOW 
FILTERING");
 +
 +// Checks filtering with null
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY null 
ALLOW FILTERING");
 +
 +// Checks filtering with unset
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 +  

[08/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

* commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903':
  Fix handling of clustering key > 64K


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

Branch: refs/heads/cassandra-2.2
Commit: 0171259d05a2dd5ec901ccadda016361312b59a9
Parents: 8d5b7b6 452d626
Author: Sylvain Lebresne 
Authored: Thu Jun 23 10:55:27 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:57:32 2016 +0200

--
 CHANGES.txt |  2 +-
 .../restrictions/StatementRestrictions.java |  7 -
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  1 +
 .../cql3/validation/operations/InsertTest.java  | 19 +
 .../cql3/validation/operations/SelectTest.java  | 30 +++-
 7 files changed, 62 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/CHANGES.txt
--
diff --cc CHANGES.txt
index 5106fad,9a3779c..59a9794
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,35 @@@
 -2.1.15
 +2.2.7
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
- 2.1.15
+  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
   * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
   * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
   * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
index 5b7c58d,000..6f03c40
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
@@@ -1,608 -1,0 +1,613 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this 

[05/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 97fdf6a,6acab6f..9b10d0e
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -23,10 -23,12 +23,11 @@@ import java.util.UUID
  import org.junit.Test;
  
  import junit.framework.Assert;
 -import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.cql3.UntypedResultSet;
 -import org.apache.cassandra.cql3.CQLTester;
 -import org.apache.cassandra.dht.Murmur3Partitioner;
 +import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
 +import org.apache.cassandra.utils.ByteBufferUtil;
 +import org.apache.cassandra.cql3.CQLTester;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertTrue;
@@@ -36,7 -38,11 +37,6 @@@
   */
  public class SelectTest extends CQLTester
  {
- private static final ByteBuffer TOO_BIG = ByteBuffer.allocate(1024 * 65);
 -@BeforeClass
 -public static void setUp()
 -{
 -DatabaseDescriptor.setPartitioner(new Murmur3Partitioner());
 -}
  
  @Test
  public void testSingleClustering() throws Throwable
@@@ -1367,887 -1238,30 +1367,915 @@@
  }
  
  @Test
 +public void testAlias() throws Throwable
 +{
 +createTable("CREATE TABLE %s (id int PRIMARY KEY, name text)");
 +
 +for (int i = 0; i < 5; i++)
 +execute("INSERT INTO %s (id, name) VALUES (?, ?) USING TTL 10 AND 
TIMESTAMP 0", i, Integer.toString(i));
 +
 +assertInvalidMessage("Aliases aren't allowed in the where clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE user_id = 0");
 +
 +// test that select throws a meaningful exception for aliases in 
order by clause
 +assertInvalidMessage("Aliases are not allowed in order by clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE id IN (0) ORDER BY user_name");
 +
 +}
 +
 +@Test
 +public void testFilteringWithoutIndices() throws Throwable
 +{
 +createTable("CREATE TABLE %s (a int, b int, c int, d int, e map, PRIMARY KEY (a, b))");
 +
 +// Checks filtering
 +assertInvalidMessage("Predicates on non-primary-key columns (c, d) 
are not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = 1 AND d = 2 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE a = 1 AND b = 1 AND c = 
2 ALLOW FILTERING");
 +assertInvalidMessage("IN predicates on non-primary-key columns (c) is 
not yet supported",
 + "SELECT * FROM %s WHERE a IN (1, 2) AND c IN (2, 
3) ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > 2 ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS 1 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY 1 ALLOW 
FILTERING");
 +
 +// Checks filtering with null
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY null 
ALLOW FILTERING");
 +
 +// Checks filtering with unset
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 +  

[01/13] cassandra git commit: Fix handling of clustering key > 64K

2016-06-23 Thread slebresne
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 720870bd7 -> 452d626a7
  refs/heads/cassandra-2.2 8d5b7b628 -> 0171259d0
  refs/heads/cassandra-3.0 d354ddcfb -> 40ab6312d
  refs/heads/trunk 233c03066 -> c310adde0


Fix handling of clustering key > 64K

Prevent select statements with clustering key > 64k,
nicer error message when writing a value larger than unsigned short,
catch Throwable for OutboundTCPConnection.

Patch by Lerh Chuan Low; reviewed by Branimir Lambov for CASSANDRA-11882


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

Branch: refs/heads/cassandra-2.1
Commit: 452d626a7a6b03917b7bd72a5dfe9da8a27e0903
Parents: 720870b
Author: Lerh Chuan Low 
Authored: Tue May 31 18:01:58 2016 +1000
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:52:14 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/SelectStatement.java|  7 ++-
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  8 +++-
 .../org/apache/cassandra/cql3/CQLTester.java|  2 +
 .../cql3/validation/operations/InsertTest.java  | 45 
 .../cql3/validation/operations/SelectTest.java  | 29 +
 7 files changed, 91 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 7474045..9a3779c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
  * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
  * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
  * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 8a6d704..1e142e0 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1081,7 +1081,12 @@ public class SelectStatement implements CQLStatement
 private List getRequestedBound(Bound b, QueryOptions options) 
throws InvalidRequestException
 {
 assert isColumnRange();
-return buildBound(b, cfm.clusteringColumns(), columnRestrictions, 
isReversed, cfm.comparator, options);
+List bound = buildBound(b, cfm.clusteringColumns(), 
columnRestrictions, isReversed, cfm.comparator, options);
+for (Composite c : bound) {
+if (!c.isEmpty())
+QueryProcessor.validateComposite(c, cfm.comparator);
+}
+return bound;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 0d588c8..1a88220 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -285,8 +285,9 @@ public class OutboundTcpConnection extends Thread
 if (flush)
 out.flush();
 }
-catch (Exception e)
+catch (Throwable e)
 {
+JVMStabilityInspector.inspectThrowable(e);
 disconnect();
 if (e instanceof IOException)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
--
diff --git a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java 
b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
index e41069f..b78b8eb 100644
--- a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
+++ b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
@@ -287,7 +287,9 @@ public class ByteBufferUtil
 public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus 
out) throws IOException
 {
 int length = buffer.remaining();
-assert 0 <= length && length 

[07/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 97fdf6a,6acab6f..9b10d0e
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -23,10 -23,12 +23,11 @@@ import java.util.UUID
  import org.junit.Test;
  
  import junit.framework.Assert;
 -import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.cql3.UntypedResultSet;
 -import org.apache.cassandra.cql3.CQLTester;
 -import org.apache.cassandra.dht.Murmur3Partitioner;
 +import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
 +import org.apache.cassandra.utils.ByteBufferUtil;
 +import org.apache.cassandra.cql3.CQLTester;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertTrue;
@@@ -36,7 -38,11 +37,6 @@@
   */
  public class SelectTest extends CQLTester
  {
- private static final ByteBuffer TOO_BIG = ByteBuffer.allocate(1024 * 65);
 -@BeforeClass
 -public static void setUp()
 -{
 -DatabaseDescriptor.setPartitioner(new Murmur3Partitioner());
 -}
  
  @Test
  public void testSingleClustering() throws Throwable
@@@ -1367,887 -1238,30 +1367,915 @@@
  }
  
  @Test
 +public void testAlias() throws Throwable
 +{
 +createTable("CREATE TABLE %s (id int PRIMARY KEY, name text)");
 +
 +for (int i = 0; i < 5; i++)
 +execute("INSERT INTO %s (id, name) VALUES (?, ?) USING TTL 10 AND 
TIMESTAMP 0", i, Integer.toString(i));
 +
 +assertInvalidMessage("Aliases aren't allowed in the where clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE user_id = 0");
 +
 +// test that select throws a meaningful exception for aliases in 
order by clause
 +assertInvalidMessage("Aliases are not allowed in order by clause",
 + "SELECT id AS user_id, name AS user_name FROM %s 
WHERE id IN (0) ORDER BY user_name");
 +
 +}
 +
 +@Test
 +public void testFilteringWithoutIndices() throws Throwable
 +{
 +createTable("CREATE TABLE %s (a int, b int, c int, d int, e map, PRIMARY KEY (a, b))");
 +
 +// Checks filtering
 +assertInvalidMessage("Predicates on non-primary-key columns (c, d) 
are not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = 1 AND d = 2 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE a = 1 AND b = 1 AND c = 
2 ALLOW FILTERING");
 +assertInvalidMessage("IN predicates on non-primary-key columns (c) is 
not yet supported",
 + "SELECT * FROM %s WHERE a IN (1, 2) AND c IN (2, 
3) ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > 2 ALLOW FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS 1 ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY 1 ALLOW 
FILTERING");
 +
 +// Checks filtering with null
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c = null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE c > null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS null ALLOW 
FILTERING");
 +assertInvalidMessage("Predicates on non-primary-key columns (e) are 
not yet supported for non secondary index queries",
 + "SELECT * FROM %s WHERE e CONTAINS KEY null 
ALLOW FILTERING");
 +
 +// Checks filtering with unset
 +assertInvalidMessage("Predicates on non-primary-key columns (c) are 
not yet supported for non secondary index queries",
 +  

[11/13] cassandra git commit: Merge commit '0171259d05a2dd5ec901ccadda016361312b59a9' into cassandra-3.0

2016-06-23 Thread slebresne
Merge commit '0171259d05a2dd5ec901ccadda016361312b59a9' into cassandra-3.0

* commit '0171259d05a2dd5ec901ccadda016361312b59a9':
  Fix handling of clustering key > 64K


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

Branch: refs/heads/cassandra-3.0
Commit: 40ab6312d014524908d064d022cc63f1a3adf149
Parents: d354ddc 0171259
Author: Sylvain Lebresne 
Authored: Thu Jun 23 10:58:14 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 11:03:16 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/ModificationStatement.java  | 10 ++
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  2 ++
 .../cql3/validation/operations/InsertTest.java  | 37 +++-
 .../cql3/validation/operations/SelectTest.java  | 21 +--
 7 files changed, 66 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/40ab6312/CHANGES.txt
--
diff --cc CHANGES.txt
index 26f24b0,59a9794..d57fb7d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,37 -1,9 +1,38 @@@
 -2.2.7
 +3.0.8
 + * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
 + * Add TimeWindowCompactionStrategy (CASSANDRA-9666)
 +Merged from 2.2:
   * Validate bloom_filter_fp_chance against lowest supported
 value when the table is created (CASSANDRA-11920)
 - * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
   * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
   * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 +Merged from 2.1:
++ * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
 + * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
 + * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
 + * Cache local ranges when calculating repair neighbors (CASSANDRA-11934)
 + * Allow LWT operation on static column with only partition keys 
(CASSANDRA-10532)
 + * Create interval tree over canonical sstables to avoid missing sstables 
during streaming (CASSANDRA-11886)
 + * cqlsh COPY FROM: shutdown parent cluster after forking, to avoid 
corrupting SSL connections (CASSANDRA-11749)
 +
 +
 +3.0.7
 + * Fix legacy serialization of Thrift-generated non-compound range tombstones
 +   when communicating with 2.x nodes (CASSANDRA-11930)
 + * Fix Directories instantiations where CFS.initialDirectories should be used 
(CASSANDRA-11849)
 + * Avoid referencing DatabaseDescriptor in AbstractType (CASSANDRA-11912)
 + * Fix sstables not being protected from removal during index build 
(CASSANDRA-11905)
 + * cqlsh: Suppress stack trace from Read/WriteFailures (CASSANDRA-11032)
 + * Remove unneeded code to repair index summaries that have
 +   been improperly down-sampled (CASSANDRA-11127)
 + * Avoid WriteTimeoutExceptions during commit log replay due to materialized
 +   view lock contention (CASSANDRA-11891)
 + * Prevent OOM failures on SSTable corruption, improve tests for corruption 
detection (CASSANDRA-9530)
 + * Use CFS.initialDirectories when clearing snapshots (CASSANDRA-11705)
 + * Allow compaction strategies to disable early open (CASSANDRA-11754)
 + * Refactor Materialized View code (CASSANDRA-11475)
 + * Update Java Driver (CASSANDRA-11615)
 +Merged from 2.2:
   * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
   * Run CommitLog tests with different compression settings (CASSANDRA-9039)
   * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/40ab6312/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 12bade5,5ffcc8a..01c2ad1
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@@ -606,137 -726,49 +606,147 @@@ public abstract class ModificationState
   * @param now the current timestamp in microseconds to use if no 
timestamp is user provided.
   *
   * @return list of the mutations
 - * @throws InvalidRequestException on invalid requests
   */
  private Collection 

[04/13] cassandra git commit: Fix handling of clustering key > 64K

2016-06-23 Thread slebresne
Fix handling of clustering key > 64K

Prevent select statements with clustering key > 64k,
nicer error message when writing a value larger than unsigned short,
catch Throwable for OutboundTCPConnection.

Patch by Lerh Chuan Low; reviewed by Branimir Lambov for CASSANDRA-11882


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

Branch: refs/heads/trunk
Commit: 452d626a7a6b03917b7bd72a5dfe9da8a27e0903
Parents: 720870b
Author: Lerh Chuan Low 
Authored: Tue May 31 18:01:58 2016 +1000
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:52:14 2016 +0200

--
 CHANGES.txt |  1 +
 .../cql3/statements/SelectStatement.java|  7 ++-
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  8 +++-
 .../org/apache/cassandra/cql3/CQLTester.java|  2 +
 .../cql3/validation/operations/InsertTest.java  | 45 
 .../cql3/validation/operations/SelectTest.java  | 29 +
 7 files changed, 91 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 7474045..9a3779c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
  * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
  * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
  * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 8a6d704..1e142e0 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1081,7 +1081,12 @@ public class SelectStatement implements CQLStatement
 private List getRequestedBound(Bound b, QueryOptions options) 
throws InvalidRequestException
 {
 assert isColumnRange();
-return buildBound(b, cfm.clusteringColumns(), columnRestrictions, 
isReversed, cfm.comparator, options);
+List bound = buildBound(b, cfm.clusteringColumns(), 
columnRestrictions, isReversed, cfm.comparator, options);
+for (Composite c : bound) {
+if (!c.isEmpty())
+QueryProcessor.validateComposite(c, cfm.comparator);
+}
+return bound;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 0d588c8..1a88220 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -285,8 +285,9 @@ public class OutboundTcpConnection extends Thread
 if (flush)
 out.flush();
 }
-catch (Exception e)
+catch (Throwable e)
 {
+JVMStabilityInspector.inspectThrowable(e);
 disconnect();
 if (e instanceof IOException)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/452d626a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
--
diff --git a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java 
b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
index e41069f..b78b8eb 100644
--- a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
+++ b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
@@ -287,7 +287,9 @@ public class ByteBufferUtil
 public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus 
out) throws IOException
 {
 int length = buffer.remaining();
-assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT : 
length;
+assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT :
+String.format("Attempted serializing to buffer exceeded maximum of 
%s bytes: %s", 

[06/13] cassandra git commit: Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

2016-06-23 Thread slebresne
Merge commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903' into cassandra-2.2

* commit '452d626a7a6b03917b7bd72a5dfe9da8a27e0903':
  Fix handling of clustering key > 64K


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

Branch: refs/heads/cassandra-3.0
Commit: 0171259d05a2dd5ec901ccadda016361312b59a9
Parents: 8d5b7b6 452d626
Author: Sylvain Lebresne 
Authored: Thu Jun 23 10:55:27 2016 +0200
Committer: Sylvain Lebresne 
Committed: Thu Jun 23 10:57:32 2016 +0200

--
 CHANGES.txt |  2 +-
 .../restrictions/StatementRestrictions.java |  7 -
 .../cassandra/net/OutboundTcpConnection.java|  3 +-
 .../apache/cassandra/utils/ByteBufferUtil.java  |  6 ++--
 .../org/apache/cassandra/cql3/CQLTester.java|  1 +
 .../cql3/validation/operations/InsertTest.java  | 19 +
 .../cql3/validation/operations/SelectTest.java  | 30 +++-
 7 files changed, 62 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/CHANGES.txt
--
diff --cc CHANGES.txt
index 5106fad,9a3779c..59a9794
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,5 +1,35 @@@
 -2.1.15
 +2.2.7
 + * Validate bloom_filter_fp_chance against lowest supported
 +   value when the table is created (CASSANDRA-11920)
 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read 
operation (CASSANDRA-12013)
 + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038)
 + * StorageService shutdown hook should use a volatile variable 
(CASSANDRA-11984)
 + * Persist local metadata earlier in startup sequence (CASSANDRA-11742)
 + * Run CommitLog tests with different compression settings (CASSANDRA-9039)
 + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664)
 + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
 + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
 + * Enable client encryption in sstableloader with cli options 
(CASSANDRA-11708)
 + * Possible memory leak in NIODataInputStream (CASSANDRA-11867)
 + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669)
 + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753)
 + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395)
 + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626)
 + * Exit JVM if JMX server fails to startup (CASSANDRA-11540)
 + * Produce a heap dump when exiting on OOM (CASSANDRA-9861)
 + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427)
 + * Restore ability to filter on clustering columns when using a 2i 
(CASSANDRA-11510)
 + * JSON datetime formatting needs timezone (CASSANDRA-11137)
 + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502)
 + * Remove unnescessary file existence check during anticompaction 
(CASSANDRA-11660)
 + * Add missing files to debian packages (CASSANDRA-11642)
 + * Avoid calling Iterables::concat in loops during 
ModificationStatement::getFunctions (CASSANDRA-11621)
 + * cqlsh: COPY FROM should use regular inserts for single statement batches 
and
 +   report errors correctly if workers processes crash on initialization 
(CASSANDRA-11474)
 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553)
 + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988)
 +Merged from 2.1:
- 2.1.15
+  * Prevent select statements with clustering key > 64k (CASSANDRA-11882)
   * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991)
   * Remove distinction between non-existing static columns and existing but 
null in LWTs (CASSANDRA-9842)
   * Support mlockall on IBM POWER arch (CASSANDRA-11576)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0171259d/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
index 5b7c58d,000..6f03c40
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
@@@ -1,608 -1,0 +1,613 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this 

<    1   2   3   4   5   6   7   8   9   10   >