[jira] [Updated] (CASSANDRA-7816) Duplicate DOWN/UP Events Pushed with Native Protocol

2015-03-05 Thread Stefania (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefania updated CASSANDRA-7816:

Attachment: (was: 7816-v2.0.txt)

> Duplicate DOWN/UP Events Pushed with Native Protocol
> 
>
> Key: CASSANDRA-7816
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7816
> Project: Cassandra
>  Issue Type: Bug
>  Components: API
>Reporter: Michael Penick
>Assignee: Stefania
>Priority: Minor
> Fix For: 2.0.13, 2.1.4
>
> Attachments: 7816-v2.0.txt, tcpdump_repeating_status_change.txt, 
> trunk-7816.txt
>
>
> Added "MOVED_NODE" as a possible type of topology change and also specified 
> that it is possible to receive the same event multiple times.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7816) Duplicate DOWN/UP Events Pushed with Native Protocol

2015-03-05 Thread Stefania (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefania updated CASSANDRA-7816:

Attachment: 7816-v2.0.txt

Fixed training spaces in patch.

> Duplicate DOWN/UP Events Pushed with Native Protocol
> 
>
> Key: CASSANDRA-7816
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7816
> Project: Cassandra
>  Issue Type: Bug
>  Components: API
>Reporter: Michael Penick
>Assignee: Stefania
>Priority: Minor
> Fix For: 2.0.13, 2.1.4
>
> Attachments: 7816-v2.0.txt, 7816-v2.0.txt, 
> tcpdump_repeating_status_change.txt, trunk-7816.txt
>
>
> Added "MOVED_NODE" as a possible type of topology change and also specified 
> that it is possible to receive the same event multiple times.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8722) Auth MBean needs to be registered

2015-03-05 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14350010#comment-14350010
 ] 

Aleksey Yeschenko commented on CASSANDRA-8722:
--

v3 LGTM, though I haven't verified if it actually works. A small test would be 
nice to have, too.

[~philipthompson] May I ask you to verify that the mbean does what it's 
supposed to do? I don't know if we do/can test JMX directly in dtests, but if 
not, a manual test would do, too.

> Auth MBean needs to be registered
> -
>
> Key: CASSANDRA-8722
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8722
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Brandon Williams
>Assignee: Brandon Williams
>Priority: Minor
> Fix For: 2.1.4
>
> Attachments: 8722-v2.txt, 8722-v3.txt, 8722.txt
>
>
> In CASSANDRA-7968 we created this bean but forgot to register it :(  This 
> also makes CASSANDRA-7977 unusable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


cassandra git commit: Make custom role options accessible from IRoleManager

2015-03-05 Thread aleksey
Repository: cassandra
Updated Branches:
  refs/heads/trunk c610b3123 -> a1b574e52


Make custom role options accessible from IRoleManager

patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-8761


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

Branch: refs/heads/trunk
Commit: a1b574e52e363e1f9cf46496d4acc5bcd3436d96
Parents: c610b31
Author: Sam Tunnicliffe 
Authored: Thu Mar 5 21:52:51 2015 -0800
Committer: Aleksey Yeschenko 
Committed: Thu Mar 5 21:52:51 2015 -0800

--
 CHANGES.txt  |  4 ++--
 .../org/apache/cassandra/auth/CassandraRoleManager.java  |  5 +
 src/java/org/apache/cassandra/auth/IRoleManager.java | 11 +++
 .../cassandra/cql3/statements/ListRolesStatement.java| 10 +++---
 4 files changed, 25 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1b574e5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index e7bc034..e1efa3b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,6 @@
 3.0
- * use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
- * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849)
+ * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
+ * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 8761)
  * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
  * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
  * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1b574e5/src/java/org/apache/cassandra/auth/CassandraRoleManager.java
--
diff --git a/src/java/org/apache/cassandra/auth/CassandraRoleManager.java 
b/src/java/org/apache/cassandra/auth/CassandraRoleManager.java
index 6139e5d..36c57d4 100644
--- a/src/java/org/apache/cassandra/auth/CassandraRoleManager.java
+++ b/src/java/org/apache/cassandra/auth/CassandraRoleManager.java
@@ -292,6 +292,11 @@ public class CassandraRoleManager implements IRoleManager
 return getRole(role.getRoleName()).canLogin;
 }
 
+public Map getCustomOptions(RoleResource role)
+{
+return Collections.emptyMap();
+}
+
 public boolean isExistingRole(RoleResource role)
 {
 return getRole(role.getRoleName()) != NULL_ROLE;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1b574e5/src/java/org/apache/cassandra/auth/IRoleManager.java
--
diff --git a/src/java/org/apache/cassandra/auth/IRoleManager.java 
b/src/java/org/apache/cassandra/auth/IRoleManager.java
index 3295a3d..5205dad 100644
--- a/src/java/org/apache/cassandra/auth/IRoleManager.java
+++ b/src/java/org/apache/cassandra/auth/IRoleManager.java
@@ -169,6 +169,17 @@ public interface IRoleManager
 boolean canLogin(RoleResource role);
 
 /**
+ * Where an implementation supports OPTIONS in CREATE and ALTER operations
+ * this method should return the Map representing the 
custom
+ * options associated with the role, as supplied to CREATE or ALTER.
+ * It should never return null; if the implementation does not support
+ * OPTIONS or if none were supplied then it should return an empty map.
+ * @param role Role whose custom options are required
+ * @return Key/Value pairs representing the custom options for the Role
+ */
+Map getCustomOptions(RoleResource role);
+
+/**
  * Return true is a Role with the given name exists in the system.
  *
  * @param role Role whose existence to verify

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1b574e5/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java
index 24071b0..477aedc 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java
@@ -28,6 +28,7 @@ import org.apache.cassandra.auth.*;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.db.marshal.BooleanType;
+import org.apache.cassandra.db.marshal.MapType;
 import org.apache.cassandra.db.marshal.UTF8Type;
 import org.apache.cassandra.exceptions.*;
 import org.apache.

[jira] [Updated] (CASSANDRA-8544) Cassandra could not start with NPE in ColumnFamilyStore.removeUnfinishedCompactionLeftovers

2015-03-05 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko updated CASSANDRA-8544:
-
Reviewer: Aleksey Yeschenko  (was: Sam Tunnicliffe)

+1

> Cassandra could not start with NPE in 
> ColumnFamilyStore.removeUnfinishedCompactionLeftovers
> ---
>
> Key: CASSANDRA-8544
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8544
> Project: Cassandra
>  Issue Type: Bug
> Environment: Windows
>Reporter: Leonid Shalupov
>Assignee: Joshua McKenzie
>Priority: Minor
>  Labels: windows
> Fix For: 2.1.4
>
> Attachments: 8544_show_npe.txt, 8544_v1.txt
>
>
> It happens sometimes after restarts caused by undeletable files under Windows.
> {quote}
> Caused by: java.lang.NullPointerException
> at 
> org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:579)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:232)
> at 
> org.apache.cassandra.service.CassandraDaemon.init(CassandraDaemon.java:377)
> at 
> com.jetbrains.cassandra.service.CassandraServiceMain.start(CassandraServiceMain.java:81)
> ... 6 more
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8061) tmplink files are not removed

2015-03-05 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349879#comment-14349879
 ] 

graham sanderson commented on CASSANDRA-8061:
-

Thanks that is good news esp. w.r.t. 2.1.4 as there are a few patches there 
we'd like but are pretty much impossible to rebase onto 2.1.3

Note just FYI we are getting the assertion above on 
system.compactions_in_progress, and whilst I haven't studied its use, I imagine 
the inputs must thus be large, and that might be a good indicator that we are 
indeed also seeing CASSANDRA-8860 occasionally (something we suspect and are 
going to patch anyway since it restores 2.0.x behavior)

> tmplink files are not removed
> -
>
> Key: CASSANDRA-8061
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8061
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Linux
>Reporter: Gianluca Borello
>Assignee: Joshua McKenzie
> Fix For: 2.1.4
>
> Attachments: 8061_v1.txt, 8248-thread_dump.txt
>
>
> After installing 2.1.0, I'm experiencing a bunch of tmplink files that are 
> filling my disk. I found https://issues.apache.org/jira/browse/CASSANDRA-7803 
> and that is very similar, and I confirm it happens both on 2.1.0 as well as 
> from the latest commit on the cassandra-2.1 branch 
> (https://github.com/apache/cassandra/commit/aca80da38c3d86a40cc63d9a122f7d45258e4685
>  from the cassandra-2.1)
> Even starting with a clean keyspace, after a few hours I get:
> {noformat}
> $ sudo find /raid0 | grep tmplink | xargs du -hs
> 2.7G  
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Data.db
> 13M   
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Index.db
> 1.8G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Data.db
> 12M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Index.db
> 5.2M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Index.db
> 822M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Data.db
> 7.3M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Index.db
> 1.2G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Data.db
> 6.7M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Index.db
> 1.1G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Data.db
> 11M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Index.db
> 1.7G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Data.db
> 812K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Index.db
> 122M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-208-Data.db
> 744K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-739-Index.db
> 660K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-193-Index.db
> 796K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Index.db
> 137M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Data.db
> 161M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Data.db
> 139M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Data.db
> 940K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-786-Index.db
> 936K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Index.db
> 161M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounte

[jira] [Commented] (CASSANDRA-8739) Don't check for overlap with sstables that have had their start positions moved in LCS

2015-03-05 Thread Carl Yeksigian (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349862#comment-14349862
 ] 

Carl Yeksigian commented on CASSANDRA-8739:
---

I missed that before.

Makes sense; +1 on the patch.

> Don't check for overlap with sstables that have had their start positions 
> moved in LCS
> --
>
> Key: CASSANDRA-8739
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8739
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Marcus Eriksson
>Assignee: Marcus Eriksson
> Fix For: 2.1.4
>
> Attachments: 0001-8739.patch
>
>
> When picking compaction candidates in LCS, we check that we won't cause any 
> overlap in the higher level. Problem is that we compare the files that have 
> had their start positions moved meaning we can cause overlap. We need to also 
> include the tmplink files when checking this.
> Note that in 2.1 overlap is not as big problem as earlier, if adding an 
> sstable would cause overlap, we send it back to L0 instead, meaning we do a 
> bit more compaction but we never actually have overlap.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8236) Delay "node up" and "node added" notifications until native protocol server is started

2015-03-05 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349795#comment-14349795
 ] 

Stefania commented on CASSANDRA-8236:
-

{quote}
Let me explain the risk in padding values. Padding used to only have 5 values, 
and in 1.1 we almost exceeded them which would break everything since the enum 
lookup wouldn't resolve for some states, and that's catastrophic. That's why we 
have the X_11_PADDING value from that near miss, and that's why I increased the 
padding to 10 values. As long as the padding values aren't actually used, it's 
better to have them than not. And that's why, I actually didn't remove one 
{quote}

That's clear now, thanks.

{quote}
I think that could work, but probably not by sending Event.TopologyChange 
itself, since we can only send a VersionedValue. That's an implementation 
detail though and shouldn't be hard to solve
{quote}

Yes I meant sending a String that can be converted into a TopologyChange event. 
Before we go down this route however, could you check patch 8516-v2.1b.txt for 
CASSANDRA-8516, where I added a new {{ApplicationState.STATUS}} called "MOVED" 
to fix the mix-up between NEW_NODE and MOVED_NODE. I think originally you 
wanted to do this for {{RPC_READY}} too but then settled for a new 
{{ApplicationState}} flag. Why?

One more thing, this patch only delays "node added", not "node up", I assume 
you are aware of this and it is OK.

> Delay "node up" and "node added" notifications until native protocol server 
> is started
> --
>
> Key: CASSANDRA-8236
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8236
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Tyler Hobbs
>Assignee: Brandon Williams
> Fix For: 3.0
>
> Attachments: 8236.txt
>
>
> As discussed in CASSANDRA-7510, there is still a gap between when a "node up" 
> or "node added" notification may be sent to native protocol clients (in 
> response to a gossip event) and when the native protocol server is ready to 
> serve requests.
> Everything in between the call to {{StorageService.instance.initServer()}} 
> and creation of the native server in {{CassandraDaemon.setup()}} contributes 
> to this delay, but waiting for Gossip to settle introduces the biggest delay.
> We may need to introduce a "STARTING" gossip state for the period inbetween, 
> which is why this is scheduled for 3.0.  If there's a better option, though, 
> it may make sense to put this in 2.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8544) Cassandra could not start with NPE in ColumnFamilyStore.removeUnfinishedCompactionLeftovers

2015-03-05 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko updated CASSANDRA-8544:
-
Reviewer: Sam Tunnicliffe  (was: Aleksey Yeschenko)

> Cassandra could not start with NPE in 
> ColumnFamilyStore.removeUnfinishedCompactionLeftovers
> ---
>
> Key: CASSANDRA-8544
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8544
> Project: Cassandra
>  Issue Type: Bug
> Environment: Windows
>Reporter: Leonid Shalupov
>Assignee: Joshua McKenzie
>Priority: Minor
>  Labels: windows
> Fix For: 2.1.4
>
> Attachments: 8544_show_npe.txt, 8544_v1.txt
>
>
> It happens sometimes after restarts caused by undeletable files under Windows.
> {quote}
> Caused by: java.lang.NullPointerException
> at 
> org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:579)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:232)
> at 
> org.apache.cassandra.service.CassandraDaemon.init(CassandraDaemon.java:377)
> at 
> com.jetbrains.cassandra.service.CassandraServiceMain.start(CassandraServiceMain.java:81)
> ... 6 more
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8909) Replication Strategy creation errors are lost in try/catch

2015-03-05 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko updated CASSANDRA-8909:
-
Reviewer: Sam Tunnicliffe  (was: Aleksey Yeschenko)

> Replication Strategy creation errors are lost in try/catch
> --
>
> Key: CASSANDRA-8909
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8909
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Alan Boudreault
>Assignee: Alan Boudreault
>Priority: Trivial
> Fix For: 2.0.13
>
> Attachments: replication-strategy-exception-2.0.patch
>
>
> I was initially executing a bad cassandra-stress command  and was getting 
> this error:
> {code}
> Unable to create stress keyspace: Error constructing replication strategy 
> class
> {code}
> with the following command:
> {code}
> cassandra-stress -o insert --replication-strategy NetworkTopologyStrategy 
> --strategy-properties dc1:1,dc2:1 --replication-factor 1
> {code}
> After digging in the code, I noticed that the error displayed was not the one 
> thrown by the replication strategy code and that the try/catch block could be 
> improved. Basically, the Constructor.newInstance can throw an 
> InvocationTargetException, which provide a better error report.
> I think this improvement can also be done in 2.1 (not tested yet). If my 
> attached patch is acceptable, I will test and provide the right version for 
> 2.1 and trunk.
> With the patch, I can see the proper error when executing my bad command:
> {code}
> Unable to create stress keyspace: replication_factor is an option for 
> SimpleStrategy, not NetworkTopologyStrategy
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8838) Resumable bootstrap streaming

2015-03-05 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349709#comment-14349709
 ] 

Stefania edited comment on CASSANDRA-8838 at 3/6/15 1:48 AM:
-

Hi [~yukim]], really nice code, here are my comments (mostly questions for my 
own benefit really):
\\
\\
* {{StreamStateStore.isDataAvailable()}} doesn't seem to be used

* In {{SystemKeyspace.getAvailableRanges()}} why do we need to copy the result 
into an {{ImmutableSet}}, just to make sure the caller cannot modify the result 
or is there more to it I should understand?

* Do we ever reset the available ranges? If not, is this not going to cause 
issues if the node is down for a very long time, like a few days or do we just 
rely on deleting the whole node data in these cases?


was (Author: stefania):
Hi Yuki, really nice code, here are my comments (mostly questions for my own 
benefit really):
\\
\\
* {{StreamStateStore.isDataAvailable()}} doesn't seem to be used

* In {{SystemKeyspace.getAvailableRanges()}} why do we need to copy the result 
into an {{ImmutableSet}}, just to make sure the caller cannot modify the result 
or is there more to it I should understand?

* Do we ever reset the available ranges? If not, is this not going to cause 
issues if the node is down for a very long time, like a few days or do we just 
rely on deleting the whole node data in these cases?

> Resumable bootstrap streaming
> -
>
> Key: CASSANDRA-8838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8838
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Yuki Morishita
>Assignee: Yuki Morishita
>Priority: Minor
>  Labels: dense-storage
> Fix For: 3.0
>
>
> This allows the bootstrapping node not to be streamed already received data.
> The bootstrapping node records received keyspace/ranges as one stream session 
> completes. When some sessions with other nodes fail, bootstrapping fails 
> also, though next time it re-bootstraps, already received keyspace/ranges are 
> skipped to be streamed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8838) Resumable bootstrap streaming

2015-03-05 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349709#comment-14349709
 ] 

Stefania edited comment on CASSANDRA-8838 at 3/6/15 1:49 AM:
-

Hi [~yukim], really nice code, here are my comments (mostly questions for my 
own benefit really):
\\
\\
* {{StreamStateStore.isDataAvailable()}} doesn't seem to be used

* In {{SystemKeyspace.getAvailableRanges()}} why do we need to copy the result 
into an {{ImmutableSet}}, just to make sure the caller cannot modify the result 
or is there more to it I should understand?

* Do we ever reset the available ranges? If not, is this not going to cause 
issues if the node is down for a very long time, like a few days or do we just 
rely on deleting the whole node data in these cases?


was (Author: stefania):
Hi [~yukim]], really nice code, here are my comments (mostly questions for my 
own benefit really):
\\
\\
* {{StreamStateStore.isDataAvailable()}} doesn't seem to be used

* In {{SystemKeyspace.getAvailableRanges()}} why do we need to copy the result 
into an {{ImmutableSet}}, just to make sure the caller cannot modify the result 
or is there more to it I should understand?

* Do we ever reset the available ranges? If not, is this not going to cause 
issues if the node is down for a very long time, like a few days or do we just 
rely on deleting the whole node data in these cases?

> Resumable bootstrap streaming
> -
>
> Key: CASSANDRA-8838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8838
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Yuki Morishita
>Assignee: Yuki Morishita
>Priority: Minor
>  Labels: dense-storage
> Fix For: 3.0
>
>
> This allows the bootstrapping node not to be streamed already received data.
> The bootstrapping node records received keyspace/ranges as one stream session 
> completes. When some sessions with other nodes fail, bootstrapping fails 
> also, though next time it re-bootstraps, already received keyspace/ranges are 
> skipped to be streamed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8838) Resumable bootstrap streaming

2015-03-05 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349709#comment-14349709
 ] 

Stefania commented on CASSANDRA-8838:
-

Hi Yuki, really nice code, here are my comments (mostly questions for my own 
benefit really):
\\
\\
* {{StreamStateStore.isDataAvailable()}} doesn't seem to be used

* In {{SystemKeyspace.getAvailableRanges()}} why do we need to copy the result 
into an {{ImmutableSet}}, just to make sure the caller cannot modify the result 
or is there more to it I should understand?

* Do we ever reset the available ranges? If not, is this not going to cause 
issues if the node is down for a very long time, like a few days or do we just 
rely on deleting the whole node data in these cases?

> Resumable bootstrap streaming
> -
>
> Key: CASSANDRA-8838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8838
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Yuki Morishita
>Assignee: Yuki Morishita
>Priority: Minor
>  Labels: dense-storage
> Fix For: 3.0
>
>
> This allows the bootstrapping node not to be streamed already received data.
> The bootstrapping node records received keyspace/ranges as one stream session 
> completes. When some sessions with other nodes fail, bootstrapping fails 
> also, though next time it re-bootstraps, already received keyspace/ranges are 
> skipped to be streamed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8539) Tests Errors: Latest Cassandra trunk

2015-03-05 Thread Mengyu Zhang (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14337795#comment-14337795
 ] 

Mengyu Zhang edited comment on CASSANDRA-8539 at 3/6/15 12:20 AM:
--

I also encountered similar problems when exec 

{code}
ant cql-test
{code}

Firstly, I want to clear that the Exceptions printed by logger are not 
necessarily test failures, because I find some tests are trying trigger Runtime 
Exceptions deliberately. 

However I have a problem due to timeout, like 

{code} 
...
[junit] Testsuite: org.apache.cassandra.cql3.SecondaryIndexOnMapEntriesTest
[junit] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
4.269 sec
[junit]
[junit] Testsuite: org.apache.cassandra.cql3.SelectWithTokenFunctionTest
[junit] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
2.214 sec
[junit]
[junit] Testsuite: org.apache.cassandra.cql3.SelectionOrderingTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
1.777 sec
[junit]
[junit] Testsuite: org.apache.cassandra.cql3.SingleColumnRelationTest
[junit] Testsuite: org.apache.cassandra.cql3.Batch-With-Multiple-Tests
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 
sec
[junit]
[junit] Testcase: 
org.apache.cassandra.cql3.Batch-With-Multiple-Tests:testIndexOnClusteringColumns:
 Caused an ERROR
[junit] Timeout occurred. Please note the time in the report does not 
reflect the time until the timeout.
[junit] junit.framework.AssertionFailedError: Timeout occurred. Please note 
the time in the report does not reflect the time until the timeout.
[junit]
[junit]
[junit] Tests FAILED (timeout)

{code} 

The weird thing is that the testcase reporting timeout is not always the same 
testcase, and when being tested independently, 

{code} 
ant test -Dtest.name=SingleColumnRelationTest
{code} 

the timeout will not occur. 

Currently, I find when the timeout of junit in config file doubled, the test 
will work. 

I've tried on Mac and a 64bit ubuntu machine, with java 1.7. Besides, when I 
rolled back to release 2.1.3, it's all good. 

The problem seems to be a little weird, any ideas?


was (Author: mzhang):
I also encountered this problem when exec 

{code}
ant cql-test
{code}

I've tried on Mac and a 32bit ubuntu machine, with java 1.7. Besides, when I 
rolled back to  release 2.1.3, it's all good. 

The problem seems to be a little weird, any ideas?

> Tests Errors: Latest Cassandra trunk
> 
>
> Key: CASSANDRA-8539
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8539
> Project: Cassandra
>  Issue Type: Test
>  Components: Tests
>Reporter: Rekha Joshi
>  Labels: tests
> Fix For: 3.0
>
>
> On Mac 10.9.5, Java 1.7, latest cassandra trunk build is good, but tests have 
> 14 errors/203 warnings.Few test error snippets below.
> {noformat}
>  [junit] Testcase: 
> testRowTombstoneObservedBeforePurging(org.apache.cassandra.db.compaction.CompactionsPurgeTest):
> FAILED
> [junit] expected:<0> but was:<1>
> [junit] junit.framework.AssertionFailedError: expected:<0> but was:<1>
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionsPurgeTest.testRowTombstoneObservedBeforePurging(CompactionsPurgeTest.java:413)
> [junit] 
> [junit] 
> [junit] Test org.apache.cassandra.db.compaction.CompactionsPurgeTest 
> FAILED
> [junit] Testcase: 
> org.apache.cassandra.db.compaction.LeveledCompactionStrategyTest:testNewRepairedSSTable:
> Caused an ERROR
> [junit] Timeout occurred. Please note the time in the report does not 
> reflect the time until the timeout.
> [junit] junit.framework.AssertionFailedError: Timeout occurred. Please 
> note the time in the report does not reflect the time until the timeout.
> [junit]   at java.lang.Thread.run(Thread.java:745)
> [junit] 
> [junit] 
> [junit] Test 
> org.apache.cassandra.db.compaction.LeveledCompactionStrategyTest FAILED 
> (timeout)
> [junit] ERROR 19:15:35 Invocation of function 'cql_test_keyspace.function_10 
> : (int, int) -> int' failed
> [junit] java.lang.RuntimeException: null
> [junit]   at 
> org.apache.cassandra.cql3.udf.gen.Ccql_test_keyspacefunction_10_80.executeInternal(Ccql_test_keyspacefunction_10_80.java)
>  [na:na]
> [junit]   at 
> org.apache.cassandra.cql3.udf.gen.Ccql_test_keyspacefunction_10_80.execute(Ccql_test_keyspacefunction_10_80.java)
>  [na:na]
> [junit]   at 
> org.apache.cassandra.cql3.functions.UDAggregate$2.addInput(UDAggregate.java:156)
>  [main/:na]
> [junit]   at 
> org.apache.cassandra.cql3.selection.AggregateFunctionSelector.addInput(AggregateFunctionSelector.java:47)
>  [main/:na]
> [junit]   at 
>

[jira] [Updated] (CASSANDRA-8919) cqlsh return error in querying of CompositeType data

2015-03-05 Thread Philip Thompson (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Thompson updated CASSANDRA-8919:
---
Labels: cqlsh  (was: )

> cqlsh return error in querying of CompositeType data
> 
>
> Key: CASSANDRA-8919
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8919
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
> Environment: SUSE 11 SP3, C* 2.1.2
>Reporter: Mark
>Assignee: Tyler Hobbs
>Priority: Minor
>  Labels: cqlsh
> Fix For: 2.1.2
>
>
> cqlsh return below error when querying CompositeType data. Seems like 
> deserialize_safe is undefined for this CompositeType. Is it a issue need to 
> fix?
> {code}
> cassandra@cqlsh:up_data> select * from test_stand;
> Traceback (most recent call last):
>   File "/home/mql/bin/cqlsh", line 986, in perform_simple_statement
> rows = self.session.execute(statement, trace=self.tracing_enabled)
>   File 
> "/home/mql/bin/../lib/cassandra-driver-internal-only-2.1.2.zip/cassandra-driver-2.1.2/cassandra/cluster.py",
>  line 1294, in execute
> result = future.result(timeout)
>   File 
> "/home/mql/bin/../lib/cassandra-driver-internal-only-2.1.2.zip/cassandra-driver-2.1.2/cassandra/cluster.py",
>  line 2788, in result
> raise self._final_exception
> AttributeError: type object 'CompositeType(UTF8Type, Int32Type)' has no 
> attribute 'deserialize_safe'
> {code}
> Pre-condition (in cassandra-cli)
> {code}
> create keyspace up_data with placement_strategy = 
> 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = 
> {replication_factor:1};
> use up_data;
> create column family test_stand
> with column_type = 'Standard'
> and comparator = 'UTF8Type'
> and default_validation_class = 'BytesType'
> and key_validation_class = 'UTF8Type'
> and column_metadata = [
> {column_name : 'UTF8Typefield',
> validation_class : 'UTF8Type'},
> {column_name : 'IntegerTypefield',
> validation_class : 'IntegerType'},
> {column_name : 'CompositeTypefield',
> validation_class : 
> 'CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.Int32Type)'}
> ] and compression_options = null;
> set test_stand ['test_stand1']['UTF8Typefield']='utf8Type';
> set test_stand ['test_stand1']['CompositeTypefield']='utf8Type,12';
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7410) Pig support for BulkOutputFormat as a parameter in url

2015-03-05 Thread Alex Liu (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Liu updated CASSANDRA-7410:

Attachment: CASSANDRA-7410-v2-2.1-branch.txt

V2 version fixes the streaming error 

> Pig support for BulkOutputFormat as a parameter in url
> --
>
> Key: CASSANDRA-7410
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7410
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Hadoop
>Reporter: Alex Liu
>Assignee: Alex Liu
>Priority: Minor
> Fix For: 2.0.13
>
> Attachments: 7410-2.0-branch.txt, 7410-2.1-branch.txt, 
> 7410-v2-2.0-branch.txt, 7410-v3-2.0-branch.txt, 
> CASSANDRA-7410-v2-2.1-branch.txt
>
>
> Add BulkOutputFormat support in Pig url



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8358) Bundled tools shouldn't be using Thrift API

2015-03-05 Thread Philip Thompson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349620#comment-14349620
 ] 

Philip Thompson commented on CASSANDRA-8358:


Waiting on https://datastax-oss.atlassian.net/browse/JAVA-681 should be done 
tomorrow.

> Bundled tools shouldn't be using Thrift API
> ---
>
> Key: CASSANDRA-8358
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8358
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Aleksey Yeschenko
>Assignee: Philip Thompson
> Fix For: 3.0
>
>
> In 2.1, we switched cqlsh to the python-driver.
> In 3.0, we got rid of cassandra-cli.
> Yet there is still code that's using legacy Thrift API. We want to convert it 
> all to use the java-driver instead.
> 1. BulkLoader uses Thrift to query the schema tables. It should be using 
> java-driver metadata APIs directly instead.
> 2. o.a.c.hadoop.cql3.CqlRecordWriter is using Thrift
> 3. o.a.c.hadoop.ColumnFamilyRecordReader is using Thrift
> 4. o.a.c.hadoop.AbstractCassandraStorage is using Thrift
> 5. o.a.c.hadoop.pig.CqlStorage is using Thrift
> Some of the things listed above use Thrift to get the list of partition key 
> columns or clustering columns. Those should be converted to use the Metadata 
> API of the java-driver.
> Somewhat related to that, we also have badly ported code from Thrift in 
> o.a.c.hadoop.cql3.CqlRecordReader (see fetchKeys()) that manually fetches 
> columns from schema tables instead of properly using the driver's Metadata 
> API.
> We need all of it fixed. One exception, for now, is 
> o.a.c.hadoop.AbstractColumnFamilyInputFormat - it's using Thrift for its 
> describe_splits_ex() call that cannot be currently replaced by any 
> java-driver call (?).
> Once this is done, we can stop starting Thrift RPC port by default in 
> cassandra.yaml.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/3] cassandra git commit: Add nodetool statushandoff/statusbackup

2015-03-05 Thread yukim
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 4ce409e33 -> e8fbfc082
  refs/heads/trunk f6d8d88ce -> c610b3123


Add nodetool statushandoff/statusbackup

patch by Prajakta Bhosale; reviewed by yukim for CASSANDRA-8912


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

Branch: refs/heads/cassandra-2.1
Commit: e8fbfc0822db4f7635549e5f6c45e103562d0c0c
Parents: 4ce409e
Author: Prajakta Bhosale 
Authored: Thu Mar 5 17:24:10 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 17:24:58 2015 -0600

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/tools/NodeProbe.java   | 10 +++
 .../org/apache/cassandra/tools/NodeTool.java| 28 
 3 files changed, 39 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 59f9207..b8270d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -31,6 +31,7 @@
marked are in the live set (CASSANDRA-8689)
  * cassandra-stress support for varint (CASSANDRA-8882)
  * Fix Adler32 digest for compressed sstables (CASSANDRA-8778)
+ * Add nodetool statushandoff/statusbackup (CASSANDRA-8912)
 Merged from 2.0:
  * Fix regression in mixed single and multi-column relation support for
SELECT statements (CASSANDRA-8613)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/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 f124589..fc251a2 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -598,6 +598,11 @@ public class NodeProbe implements AutoCloseable
 ssProxy.setIncrementalBackupsEnabled(enabled);
 }
 
+public boolean isIncrementalBackupsEnabled()
+{
+return ssProxy.isIncrementalBackupsEnabled();
+}
+
 public void setCacheCapacities(int keyCacheCapacity, int rowCacheCapacity, 
int counterCacheCapacity)
 {
 try
@@ -796,6 +801,11 @@ public class NodeProbe implements AutoCloseable
 spProxy.setHintedHandoffEnabled(true);
 }
 
+public boolean isHandoffEnabled()
+{
+return spProxy.getHintedHandoffEnabled();
+}
+
 public void enableHintedHandoff(String dcNames)
 {
 spProxy.setHintedHandoffEnabledByDCList(dcNames);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/src/java/org/apache/cassandra/tools/NodeTool.java
--
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java 
b/src/java/org/apache/cassandra/tools/NodeTool.java
index 9094fbd..e0ad641 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -130,6 +130,8 @@ public class NodeTool
 StatusBinary.class,
 StatusGossip.class,
 StatusThrift.class,
+StatusBackup.class,
+StatusHandoff.class,
 Stop.class,
 StopDaemon.class,
 Version.class,
@@ -2315,6 +2317,32 @@ public class NodeTool
 }
 }
 
+@Command(name = "statusbackup", description = "Status of incremental 
backup")
+public static class StatusBackup extends NodeToolCmd
+{
+@Override
+public void execute(NodeProbe probe)
+{
+System.out.println(
+probe.isIncrementalBackupsEnabled()
+? "running"
+: "not running");
+}
+}
+
+@Command(name = "statushandoff", description = "Status of storing future 
hints on the current node")
+public static class StatusHandoff extends NodeToolCmd
+{
+@Override
+public void execute(NodeProbe probe)
+{
+System.out.println(
+probe.isHandoffEnabled()
+? "running"
+: "not running");
+}
+}
+
 @Command(name = "stop", description = "Stop compaction")
 public static class Stop extends NodeToolCmd
 {



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

2015-03-05 Thread yukim
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: c610b31232c6047851ffa3b1fcc3c682dde84f1a
Parents: f6d8d88 e8fbfc0
Author: Yuki Morishita 
Authored: Thu Mar 5 17:27:18 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 17:27:18 2015 -0600

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/tools/NodeProbe.java   | 10 +++
 .../org/apache/cassandra/tools/NodeTool.java| 28 
 3 files changed, 39 insertions(+)
--


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

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

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



[2/3] cassandra git commit: Add nodetool statushandoff/statusbackup

2015-03-05 Thread yukim
Add nodetool statushandoff/statusbackup

patch by Prajakta Bhosale; reviewed by yukim for CASSANDRA-8912


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

Branch: refs/heads/trunk
Commit: e8fbfc0822db4f7635549e5f6c45e103562d0c0c
Parents: 4ce409e
Author: Prajakta Bhosale 
Authored: Thu Mar 5 17:24:10 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 17:24:58 2015 -0600

--
 CHANGES.txt |  1 +
 .../org/apache/cassandra/tools/NodeProbe.java   | 10 +++
 .../org/apache/cassandra/tools/NodeTool.java| 28 
 3 files changed, 39 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 59f9207..b8270d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -31,6 +31,7 @@
marked are in the live set (CASSANDRA-8689)
  * cassandra-stress support for varint (CASSANDRA-8882)
  * Fix Adler32 digest for compressed sstables (CASSANDRA-8778)
+ * Add nodetool statushandoff/statusbackup (CASSANDRA-8912)
 Merged from 2.0:
  * Fix regression in mixed single and multi-column relation support for
SELECT statements (CASSANDRA-8613)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/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 f124589..fc251a2 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -598,6 +598,11 @@ public class NodeProbe implements AutoCloseable
 ssProxy.setIncrementalBackupsEnabled(enabled);
 }
 
+public boolean isIncrementalBackupsEnabled()
+{
+return ssProxy.isIncrementalBackupsEnabled();
+}
+
 public void setCacheCapacities(int keyCacheCapacity, int rowCacheCapacity, 
int counterCacheCapacity)
 {
 try
@@ -796,6 +801,11 @@ public class NodeProbe implements AutoCloseable
 spProxy.setHintedHandoffEnabled(true);
 }
 
+public boolean isHandoffEnabled()
+{
+return spProxy.getHintedHandoffEnabled();
+}
+
 public void enableHintedHandoff(String dcNames)
 {
 spProxy.setHintedHandoffEnabledByDCList(dcNames);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e8fbfc08/src/java/org/apache/cassandra/tools/NodeTool.java
--
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java 
b/src/java/org/apache/cassandra/tools/NodeTool.java
index 9094fbd..e0ad641 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -130,6 +130,8 @@ public class NodeTool
 StatusBinary.class,
 StatusGossip.class,
 StatusThrift.class,
+StatusBackup.class,
+StatusHandoff.class,
 Stop.class,
 StopDaemon.class,
 Version.class,
@@ -2315,6 +2317,32 @@ public class NodeTool
 }
 }
 
+@Command(name = "statusbackup", description = "Status of incremental 
backup")
+public static class StatusBackup extends NodeToolCmd
+{
+@Override
+public void execute(NodeProbe probe)
+{
+System.out.println(
+probe.isIncrementalBackupsEnabled()
+? "running"
+: "not running");
+}
+}
+
+@Command(name = "statushandoff", description = "Status of storing future 
hints on the current node")
+public static class StatusHandoff extends NodeToolCmd
+{
+@Override
+public void execute(NodeProbe probe)
+{
+System.out.println(
+probe.isHandoffEnabled()
+? "running"
+: "not running");
+}
+}
+
 @Command(name = "stop", description = "Stop compaction")
 public static class Stop extends NodeToolCmd
 {



[jira] [Commented] (CASSANDRA-7523) add date and time types

2015-03-05 Thread Joshua McKenzie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349590#comment-14349590
 ] 

Joshua McKenzie commented on CASSANDRA-7523:


[~slebresne] / [~thobbs]: one last question before I commit 
[this|https://github.com/apache/cassandra/compare/trunk...josh-mckenzie:7523].  
Currently I've modified doc/native_protocol_v3.spec to include Date and Time at 
0x0011 and 0x0012 respectively. Should we instead consider v3's spec frozen and 
have the formal type ID's for these types be added in as a subtask on 
CASSANDRA-8043?

> add date and time types
> ---
>
> Key: CASSANDRA-7523
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7523
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Jonathan Ellis
>Assignee: Joshua McKenzie
>Priority: Minor
>  Labels: client-impacting, docs
> Fix For: 2.1.4
>
>
> http://www.postgresql.org/docs/9.1/static/datatype-datetime.html
> (we already have timestamp; interval is out of scope for now, and see 
> CASSANDRA-6350 for discussion on timestamp-with-time-zone.  but date/time 
> should be pretty easy to add.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8576) Primary Key Pushdown For Hadoop

2015-03-05 Thread Alex Liu (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Liu updated CASSANDRA-8576:

Attachment: 8576-trunk.txt

> Primary Key Pushdown For Hadoop
> ---
>
> Key: CASSANDRA-8576
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8576
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Hadoop
>Reporter: Russell Alexander Spitzer
>Assignee: Alex Liu
> Fix For: 2.1.4
>
> Attachments: 8576-2.1-branch.txt, 8576-trunk.txt
>
>
> I've heard reports from several users that they would like to have predicate 
> pushdown functionality for hadoop (Hive in particular) based services. 
> Example usecase
> Table with wide partitions, one per customer
> Application team has HQL they would like to run on a single customer
> Currently time to complete scales with number of customers since Input Format 
> can't pushdown primary key predicate
> Current implementation requires a full table scan (since it can't recognize 
> that a single partition was specified)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8576) Primary Key Pushdown For Hadoop

2015-03-05 Thread Alex Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349527#comment-14349527
 ] 

Alex Liu commented on CASSANDRA-8576:
-

Pig-test on trunk fails, Philip Thompson is fixing it. I attach the patch on 
trunk, but we need merge it with Philip Thompson's fix.

> Primary Key Pushdown For Hadoop
> ---
>
> Key: CASSANDRA-8576
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8576
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Hadoop
>Reporter: Russell Alexander Spitzer
>Assignee: Alex Liu
> Fix For: 2.1.4
>
> Attachments: 8576-2.1-branch.txt
>
>
> I've heard reports from several users that they would like to have predicate 
> pushdown functionality for hadoop (Hive in particular) based services. 
> Example usecase
> Table with wide partitions, one per customer
> Application team has HQL they would like to run on a single customer
> Currently time to complete scales with number of customers since Input Format 
> can't pushdown primary key predicate
> Current implementation requires a full table scan (since it can't recognize 
> that a single partition was specified)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8927) Mark libjna-java + libjna-jni as incompatible in debian package

2015-03-05 Thread Brandon Williams (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Williams updated CASSANDRA-8927:

Reviewer: Brandon Williams

> Mark libjna-java + libjna-jni as incompatible in debian package
> ---
>
> Key: CASSANDRA-8927
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8927
> Project: Cassandra
>  Issue Type: Bug
>  Components: Packaging
> Environment: Debian
>Reporter: Robert Stupp
>Assignee: Michael Shuler
> Fix For: 3.0, 2.1.4
>
>
> Current Debian (Wheezy) might bring {{libjna-java}} in version 3.2.7-4, which 
> has incompatible {{libjnadispatch.so}} because since C* 2.1 we use JNA 4.0.0 
> (the native stuff changed):
> jna.jar includes all binaries for all supported platforms - so there's no 
> need for libjna installed separately.
> Since CASSANDRA-8714 has been committed, the incompatibility manifests in 
> {{java.lang.NoClassDefFoundError: Could not initialize class 
> com.sun.jna.Native}} (which is caused by outdated libjna-java installed via 
> apt).
> Note: Debian jessie adds new package {{libjna-jni}} (4.1.0-1) in addition to 
> {{libjna-java}} (4.1.0-1) - both contain the {{libjnidispatch.so}}. Although 
> these seem to work, we might hit the same issue when there's a need to 
> upgrade JNA to 4.2.x sometime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8927) Mark libjna-java + libjna-jni as incompatible in debian package

2015-03-05 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349505#comment-14349505
 ] 

Robert Stupp commented on CASSANDRA-8927:
-

Note: we don't actually need that for 2.1. But I don't think that it's a good 
idea to use {{libjnadispatch.so}} version 3.2.x in combination with 
jna-4.0.0.jar.

> Mark libjna-java + libjna-jni as incompatible in debian package
> ---
>
> Key: CASSANDRA-8927
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8927
> Project: Cassandra
>  Issue Type: Bug
>  Components: Packaging
> Environment: Debian
>Reporter: Robert Stupp
>Assignee: Michael Shuler
> Fix For: 3.0, 2.1.4
>
>
> Current Debian (Wheezy) might bring {{libjna-java}} in version 3.2.7-4, which 
> has incompatible {{libjnadispatch.so}} because since C* 2.1 we use JNA 4.0.0 
> (the native stuff changed):
> jna.jar includes all binaries for all supported platforms - so there's no 
> need for libjna installed separately.
> Since CASSANDRA-8714 has been committed, the incompatibility manifests in 
> {{java.lang.NoClassDefFoundError: Could not initialize class 
> com.sun.jna.Native}} (which is caused by outdated libjna-java installed via 
> apt).
> Note: Debian jessie adds new package {{libjna-jni}} (4.1.0-1) in addition to 
> {{libjna-java}} (4.1.0-1) - both contain the {{libjnidispatch.so}}. Although 
> these seem to work, we might hit the same issue when there's a need to 
> upgrade JNA to 4.2.x sometime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8927) Mark libjna-java + libjna-jni as incompatible in debian package

2015-03-05 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-8927:

Fix Version/s: 3.0

> Mark libjna-java + libjna-jni as incompatible in debian package
> ---
>
> Key: CASSANDRA-8927
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8927
> Project: Cassandra
>  Issue Type: Bug
>  Components: Packaging
> Environment: Debian
>Reporter: Robert Stupp
>Assignee: Michael Shuler
> Fix For: 3.0, 2.1.4
>
>
> Current Debian (Wheezy) might bring {{libjna-java}} in version 3.2.7-4, which 
> has incompatible {{libjnadispatch.so}} because since C* 2.1 we use JNA 4.0.0 
> (the native stuff changed):
> jna.jar includes all binaries for all supported platforms - so there's no 
> need for libjna installed separately.
> Since CASSANDRA-8714 has been committed, the incompatibility manifests in 
> {{java.lang.NoClassDefFoundError: Could not initialize class 
> com.sun.jna.Native}} (which is caused by outdated libjna-java installed via 
> apt).
> Note: Debian jessie adds new package {{libjna-jni}} (4.1.0-1) in addition to 
> {{libjna-java}} (4.1.0-1) - both contain the {{libjnidispatch.so}}. Although 
> these seem to work, we might hit the same issue when there's a need to 
> upgrade JNA to 4.2.x sometime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8927) Mark libjna-java + libjna-jni as incompatible in debian package

2015-03-05 Thread Robert Stupp (JIRA)
Robert Stupp created CASSANDRA-8927:
---

 Summary: Mark libjna-java + libjna-jni as incompatible in debian 
package
 Key: CASSANDRA-8927
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8927
 Project: Cassandra
  Issue Type: Bug
  Components: Packaging
 Environment: Debian
Reporter: Robert Stupp
Assignee: Michael Shuler
 Fix For: 2.1.4


Current Debian (Wheezy) might bring {{libjna-java}} in version 3.2.7-4, which 
has incompatible {{libjnadispatch.so}} because since C* 2.1 we use JNA 4.0.0 
(the native stuff changed):

jna.jar includes all binaries for all supported platforms - so there's no need 
for libjna installed separately.

Since CASSANDRA-8714 has been committed, the incompatibility manifests in 
{{java.lang.NoClassDefFoundError: Could not initialize class 
com.sun.jna.Native}} (which is caused by outdated libjna-java installed via 
apt).

Note: Debian jessie adds new package {{libjna-jni}} (4.1.0-1) in addition to 
{{libjna-java}} (4.1.0-1) - both contain the {{libjnidispatch.so}}. Although 
these seem to work, we might hit the same issue when there's a need to upgrade 
JNA to 4.2.x sometime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8535) java.lang.RuntimeException: Failed to rename XXX to YYY

2015-03-05 Thread Joshua McKenzie (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joshua McKenzie updated CASSANDRA-8535:
---
Attachment: 8535_v3.txt

v3 attached that should disable the switchWriter early re-open on all platforms 
if the feature is disabled in the yaml and forces the preemptive interval to 
max on Windows to bypass early re-open.

> java.lang.RuntimeException: Failed to rename XXX to YYY
> ---
>
> Key: CASSANDRA-8535
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8535
> Project: Cassandra
>  Issue Type: Bug
> Environment: Windows 2008 X64
>Reporter: Leonid Shalupov
>Assignee: Joshua McKenzie
>  Labels: Windows
> Fix For: 2.1.4
>
> Attachments: 8535_v1.txt, 8535_v2.txt, 8535_v3.txt
>
>
> {code}
> java.lang.RuntimeException: Failed to rename 
> build\test\cassandra\data;0\system\schema_keyspaces-b0f2235744583cdb9631c43e59ce3676\system-schema_keyspaces-tmp-ka-5-Index.db
>  to 
> build\test\cassandra\data;0\system\schema_keyspaces-b0f2235744583cdb9631c43e59ce3676\system-schema_keyspaces-ka-5-Index.db
>   at 
> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:170) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:154) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:569) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:561) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableWriter.close(SSTableWriter.java:535) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableWriter.finish(SSTableWriter.java:470) 
> ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableRewriter.finishAndMaybeThrow(SSTableRewriter.java:349)
>  ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableRewriter.finish(SSTableRewriter.java:324)
>  ~[main/:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableRewriter.finish(SSTableRewriter.java:304)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:200)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:75)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:59)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionTask.run(CompactionManager.java:226)
>  ~[main/:na]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
> ~[na:1.7.0_45]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
> ~[na:1.7.0_45]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  ~[na:1.7.0_45]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  [na:1.7.0_45]
>   at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
> Caused by: java.nio.file.FileSystemException: 
> build\test\cassandra\data;0\system\schema_keyspaces-b0f2235744583cdb9631c43e59ce3676\system-schema_keyspaces-tmp-ka-5-Index.db
>  -> 
> build\test\cassandra\data;0\system\schema_keyspaces-b0f2235744583cdb9631c43e59ce3676\system-schema_keyspaces-ka-5-Index.db:
>  The process cannot access the file because it is being used by another 
> process.
>   at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) 
> ~[na:1.7.0_45]
>   at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) 
> ~[na:1.7.0_45]
>   at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:301) 
> ~[na:1.7.0_45]
>   at 
> sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287) 
> ~[na:1.7.0_45]
>   at java.nio.file.Files.move(Files.java:1345) ~[na:1.7.0_45]
>   at 
> org.apache.cassandra.io.util.FileUtils.atomicMoveWithFallback(FileUtils.java:184)
>  ~[main/:na]
>   at 
> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:166) 
> ~[main/:na]
>   ... 18 common frames omitted
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7660) Indicate PK columns in "prepared" native protocol responses

2015-03-05 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349442#comment-14349442
 ] 

Benjamin Lerer commented on CASSANDRA-7660:
---

I noticed the following things:

* In {{VariableSpecifications.getPartitionKeyBindIndexes(CFMetaData cfm)}} the 
following line seems suspicious to me:
{{if (!targetColumn.ksName.equals(cfm.cfName) || 
!targetColumn.cfName.equals(cfm.ksName))}}

* The constructor {{Prepared(CQLStatement, VariableSpecifications)}} does not 
look to used anywhere.

* I feel that it will be more natural for 
{{allInSameCF(List names)}} to be in 
{{ColumnSpecification}} instead of in {{ResultMetadata}}. 

* I think that it would have been clearer to check for multiple cfm in 
{{BatchStatement}} rather than in 
{{VariableSpecification.getPartitionKeyBindIndexes}} even if it is probably 
less efficient. 

* I did not see any existing tests covering the serialization/deserialization 
of {{ResultMessage}} but I might have missed them. In case we do not have some 
it would be probably good to add some.

I had a look at the python driver code but I think that it would be good if 
someone else than me had a look at it as I am not that familiar with the driver.

Otherwise, I have found the change to the native protocol document quite clear.

> Indicate PK columns in "prepared" native protocol responses
> ---
>
> Key: CASSANDRA-7660
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7660
> Project: Cassandra
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Tyler Hobbs
>Assignee: Tyler Hobbs
>  Labels: protocolv4
> Fix For: 3.0
>
> Attachments: 7660-trunk.txt
>
>
> Currently, when native protocol drivers prepare statements, they need to 
> check their internal representation of the schema to determine which, if any, 
> of the columns are part of the partition key.  If the native protocol 
> response indicated this, it would remove the drivers' dependency on having an 
> internal representation of the schema when preparing statements.
> This would need to go in the v4 protocol.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8061) tmplink files are not removed

2015-03-05 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349428#comment-14349428
 ] 

Benedict commented on CASSANDRA-8061:
-

Having another look at the related code, I think I can point exactly to the 
problem, and to the fix. The latter is CASSANDRA-8707, and the former (without 
going into painstaking detail) is that the target bloom filter can be closed 
immediately during compaction if you have large partitions (circa 500Kb), due 
to a confluence of reasons, the main one being the error prone nature of our 
resource handling prior to the latest raft of changes. Now, barring some 
teething troubles, it should be much harder to make mistakes. We're also 
planning to introduce automated randomised acceptance testing for 3.0, that 
would test for behaviour under a wide variety of workloads like this, so that 
we can catch these more proactively in future.

There is no risk of corruption, only of compaction work not being done. My hope 
is 2.1.4 will be released soon, so you can lay the problem to rest.

> tmplink files are not removed
> -
>
> Key: CASSANDRA-8061
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8061
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Linux
>Reporter: Gianluca Borello
>Assignee: Joshua McKenzie
> Fix For: 2.1.4
>
> Attachments: 8061_v1.txt, 8248-thread_dump.txt
>
>
> After installing 2.1.0, I'm experiencing a bunch of tmplink files that are 
> filling my disk. I found https://issues.apache.org/jira/browse/CASSANDRA-7803 
> and that is very similar, and I confirm it happens both on 2.1.0 as well as 
> from the latest commit on the cassandra-2.1 branch 
> (https://github.com/apache/cassandra/commit/aca80da38c3d86a40cc63d9a122f7d45258e4685
>  from the cassandra-2.1)
> Even starting with a clean keyspace, after a few hours I get:
> {noformat}
> $ sudo find /raid0 | grep tmplink | xargs du -hs
> 2.7G  
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Data.db
> 13M   
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Index.db
> 1.8G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Data.db
> 12M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Index.db
> 5.2M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Index.db
> 822M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Data.db
> 7.3M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Index.db
> 1.2G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Data.db
> 6.7M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Index.db
> 1.1G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Data.db
> 11M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Index.db
> 1.7G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Data.db
> 812K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Index.db
> 122M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-208-Data.db
> 744K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-739-Index.db
> 660K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-193-Index.db
> 796K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Index.db
> 137M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Data.db
> 161M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Data.db
> 139M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Data.db
> 940K  

[jira] [Updated] (CASSANDRA-8926) Cfstats estimate number of keys should be stored as long, not int

2015-03-05 Thread DOAN DuyHai (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

DOAN DuyHai updated CASSANDRA-8926:
---
Description: 
For some table with huge number of partitions, *nodetool cfstats* returns 
negative display:

{code}
Number of keys (estimate): -2034463513
{code}

The simple reason is the counter used in Nodetool is an *int*, it should be a 
*long*

I attach a trivial fix

  was:
For some table with huge number of partitions, *nodetool cfstats* returns 
negative display:


Number of keys (estimate): -2034463513


The simple reason is the counter used in Nodetool is an *int*, it should be a 
*long*

I attach a trivial fix


> Cfstats estimate number of keys should be stored as long, not int
> -
>
> Key: CASSANDRA-8926
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8926
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
> Environment: Cassandra 2.1.3
> Nodetool
>Reporter: DOAN DuyHai
>Priority: Trivial
> Attachments: patch.diff
>
>
> For some table with huge number of partitions, *nodetool cfstats* returns 
> negative display:
> {code}
> Number of keys (estimate): -2034463513
> {code}
> The simple reason is the counter used in Nodetool is an *int*, it should be a 
> *long*
> I attach a trivial fix



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


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

2015-03-05 Thread benedict
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: f6d8d88ce3b54e3afdc41b30e2055d974594ac0c
Parents: 3fededc 4ce409e
Author: Benedict Elliott Smith 
Authored: Thu Mar 5 20:07:19 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:07:19 2015 +

--
 src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6d8d88c/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--



[jira] [Created] (CASSANDRA-8926) Cfstats estimate number of keys should be stored as long, not int

2015-03-05 Thread DOAN DuyHai (JIRA)
DOAN DuyHai created CASSANDRA-8926:
--

 Summary: Cfstats estimate number of keys should be stored as long, 
not int
 Key: CASSANDRA-8926
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8926
 Project: Cassandra
  Issue Type: Bug
  Components: Tools
 Environment: Cassandra 2.1.3
Nodetool
Reporter: DOAN DuyHai
Priority: Trivial
 Attachments: patch.diff

For some table with huge number of partitions, *nodetool cfstats* returns 
negative display:


Number of keys (estimate): -2034463513


The simple reason is the counter used in Nodetool is an *int*, it should be a 
*long*

I attach a trivial fix



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


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

2015-03-05 Thread benedict
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 3fededce1bbfc4fff320c058bcf0a97ca6124a20
Parents: 56e190b 0e62131
Author: Benedict Elliott Smith 
Authored: Thu Mar 5 20:05:25 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:05:25 2015 +

--
 CHANGES.txt |  1 +
 .../io/compress/CompressedSequentialWriter.java |  2 +-
 .../io/util/ChecksummedSequentialWriter.java|  2 +-
 .../io/util/DataIntegrityMetadata.java  | 22 ++--
 4 files changed, 23 insertions(+), 4 deletions(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3fededce/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3fededce/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--



[1/3] cassandra git commit: nit remove redundant int cast

2015-03-05 Thread benedict
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 0e621317e -> 4ce409e33
  refs/heads/trunk 3fededce1 -> f6d8d88ce


nit remove redundant int cast


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

Branch: refs/heads/cassandra-2.1
Commit: 4ce409e33ffce7b0976d95b66b0a43c68f2a7d88
Parents: 0e62131
Author: Benedict Elliott Smith 
Authored: Thu Mar 5 20:07:14 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:07:14 2015 +

--
 src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4ce409e3/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--
diff --git a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java 
b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
index e6f5083..ac924ec 100644
--- a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
+++ b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
@@ -123,7 +123,7 @@ public class DataIntegrityMetadata
 
 incrementalChecksum.update(buffer, start, end);
 incrementalChecksumValue = (int) 
incrementalChecksum.getValue();
-incrementalOut.writeInt((int) incrementalChecksumValue);
+incrementalOut.writeInt(incrementalChecksumValue);
 incrementalChecksum.reset();
 
 fullChecksum.update(buffer, start, end);
@@ -131,7 +131,7 @@ public class DataIntegrityMetadata
 if (checksumIncrementalResult)
 {
 ByteBuffer byteBuffer = ByteBuffer.allocate(4);
-byteBuffer.putInt((int) incrementalChecksumValue);
+byteBuffer.putInt(incrementalChecksumValue);
 fullChecksum.update(byteBuffer.array(), 0, 
byteBuffer.array().length);
 }
 }



[2/3] cassandra git commit: nit remove redundant int cast

2015-03-05 Thread benedict
nit remove redundant int cast


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

Branch: refs/heads/trunk
Commit: 4ce409e33ffce7b0976d95b66b0a43c68f2a7d88
Parents: 0e62131
Author: Benedict Elliott Smith 
Authored: Thu Mar 5 20:07:14 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:07:14 2015 +

--
 src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4ce409e3/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--
diff --git a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java 
b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
index e6f5083..ac924ec 100644
--- a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
+++ b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
@@ -123,7 +123,7 @@ public class DataIntegrityMetadata
 
 incrementalChecksum.update(buffer, start, end);
 incrementalChecksumValue = (int) 
incrementalChecksum.getValue();
-incrementalOut.writeInt((int) incrementalChecksumValue);
+incrementalOut.writeInt(incrementalChecksumValue);
 incrementalChecksum.reset();
 
 fullChecksum.update(buffer, start, end);
@@ -131,7 +131,7 @@ public class DataIntegrityMetadata
 if (checksumIncrementalResult)
 {
 ByteBuffer byteBuffer = ByteBuffer.allocate(4);
-byteBuffer.putInt((int) incrementalChecksumValue);
+byteBuffer.putInt(incrementalChecksumValue);
 fullChecksum.update(byteBuffer.array(), 0, 
byteBuffer.array().length);
 }
 }



[jira] [Commented] (CASSANDRA-8061) tmplink files are not removed

2015-03-05 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349402#comment-14349402
 ] 

graham sanderson commented on CASSANDRA-8061:
-

So w.r.t. to 

{code}
ERROR [CompactionExecutor:4967] 2015-01-29 18:54:10,709 
CassandraDaemon.java:170 - Exception in thread 
Thread[CompactionExecutor:4967,1,main]
java.lang.AssertionError: null
at org.apache.cassandra.io.util.Memory.size(Memory.java:307) ~[main/:na]
at org.apache.cassandra.utils.obs.OffHeapBitSet.capacity(OffHeapBitSet.java:61) 
~[main/:na]
at org.apache.cassandra.utils.BloomFilter.indexes(BloomFilter.java:74) 
~[main/:na]
{code}

We are also seeing this on 2.1.3 (nothing to do with windows) - it sounds like 
this is an end result of a race condition... as the code never explicitly 
appears to allocate empty bit sets.

[~benedict] is your sense that at this point data is already corrupted, or is 
this assertion actually protecting data at the cost of compaction (because 
there is another patch which disables assertions about 0 size off heap objects, 
which would suppress this)

> tmplink files are not removed
> -
>
> Key: CASSANDRA-8061
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8061
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Linux
>Reporter: Gianluca Borello
>Assignee: Joshua McKenzie
> Fix For: 2.1.4
>
> Attachments: 8061_v1.txt, 8248-thread_dump.txt
>
>
> After installing 2.1.0, I'm experiencing a bunch of tmplink files that are 
> filling my disk. I found https://issues.apache.org/jira/browse/CASSANDRA-7803 
> and that is very similar, and I confirm it happens both on 2.1.0 as well as 
> from the latest commit on the cassandra-2.1 branch 
> (https://github.com/apache/cassandra/commit/aca80da38c3d86a40cc63d9a122f7d45258e4685
>  from the cassandra-2.1)
> Even starting with a clean keyspace, after a few hours I get:
> {noformat}
> $ sudo find /raid0 | grep tmplink | xargs du -hs
> 2.7G  
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Data.db
> 13M   
> /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Index.db
> 1.8G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Data.db
> 12M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Index.db
> 5.2M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Index.db
> 822M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Data.db
> 7.3M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Index.db
> 1.2G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Data.db
> 6.7M  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Index.db
> 1.1G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Data.db
> 11M   
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Index.db
> 1.7G  
> /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Data.db
> 812K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Index.db
> 122M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-208-Data.db
> 744K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-739-Index.db
> 660K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-193-Index.db
> 796K  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Index.db
> 137M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Data.db
> 161M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Data.db
> 139M  
> /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1

[2/3] cassandra git commit: Fix Adler32 digest for compressed sstables

2015-03-05 Thread benedict
Fix Adler32 digest for compressed sstables

patch by jeff jirsa; reviewed by benedict for CASSANDRA-8778


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

Branch: refs/heads/trunk
Commit: 0e621317edb2cffac2a02d0ac13bd4a370373c73
Parents: 59ed491
Author: Jeff Jirsa 
Authored: Thu Mar 5 20:05:05 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:05:05 2015 +

--
 CHANGES.txt |  1 +
 .../io/compress/CompressedSequentialWriter.java |  2 +-
 .../io/util/ChecksummedSequentialWriter.java|  2 +-
 .../io/util/DataIntegrityMetadata.java  | 22 ++--
 4 files changed, 23 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 57dd97e..59f9207 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -30,6 +30,7 @@
  * markCompacting only succeeds if the exact SSTableReader instances being 
marked are in the live set (CASSANDRA-8689)
  * cassandra-stress support for varint (CASSANDRA-8882)
+ * Fix Adler32 digest for compressed sstables (CASSANDRA-8778)
 Merged from 2.0:
  * Fix regression in mixed single and multi-column relation support for
SELECT statements (CASSANDRA-8613)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
--
diff --git 
a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java 
b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
index ad53e83..6152c5f 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
@@ -132,7 +132,7 @@ public class CompressedSequentialWriter extends 
SequentialWriter
 // write data itself
 out.write(compressed.buffer, 0, compressedLength);
 // write corresponding checksum
-crcMetadata.append(compressed.buffer, 0, compressedLength);
+crcMetadata.append(compressed.buffer, 0, compressedLength, true);
 lastFlushOffset += compressedLength + 4;
 }
 catch (IOException e)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
--
diff --git 
a/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java 
b/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
index f4281b2..526347b 100644
--- a/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
@@ -37,7 +37,7 @@ public class ChecksummedSequentialWriter extends 
SequentialWriter
 protected void flushData()
 {
 super.flushData();
-crcMetadata.append(buffer, 0, validBufferBytes);
+crcMetadata.append(buffer, 0, validBufferBytes, false);
 }
 
 public void writeFullChecksum(Descriptor descriptor)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--
diff --git a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java 
b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
index 797b964..e6f5083 100644
--- a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
+++ b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
@@ -23,6 +23,7 @@ import java.io.DataOutput;
 import java.io.File;
 import java.io.IOError;
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.nio.file.Files;
 import java.util.zip.Adler32;
 import java.util.zip.Checksum;
@@ -107,15 +108,32 @@ public class DataIntegrityMetadata
 }
 }
 
-public void append(byte[] buffer, int start, int end)
+// checksumIncrementalResult indicates if the checksum we compute for 
this buffer should itself be
+// included in the full checksum, translating to if the partial 
checksum is serialized along with the
+// data it checksums (in which case the file checksum as calculated by 
external tools would mismatch if
+// we did not include it), or independently.
+
+// CompressedSequentialWriters serialize the partial checksums i

[1/3] cassandra git commit: Fix Adler32 digest for compressed sstables

2015-03-05 Thread benedict
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 59ed491ac -> 0e621317e
  refs/heads/trunk 56e190b1c -> 3fededce1


Fix Adler32 digest for compressed sstables

patch by jeff jirsa; reviewed by benedict for CASSANDRA-8778


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

Branch: refs/heads/cassandra-2.1
Commit: 0e621317edb2cffac2a02d0ac13bd4a370373c73
Parents: 59ed491
Author: Jeff Jirsa 
Authored: Thu Mar 5 20:05:05 2015 +
Committer: Benedict Elliott Smith 
Committed: Thu Mar 5 20:05:05 2015 +

--
 CHANGES.txt |  1 +
 .../io/compress/CompressedSequentialWriter.java |  2 +-
 .../io/util/ChecksummedSequentialWriter.java|  2 +-
 .../io/util/DataIntegrityMetadata.java  | 22 ++--
 4 files changed, 23 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 57dd97e..59f9207 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -30,6 +30,7 @@
  * markCompacting only succeeds if the exact SSTableReader instances being 
marked are in the live set (CASSANDRA-8689)
  * cassandra-stress support for varint (CASSANDRA-8882)
+ * Fix Adler32 digest for compressed sstables (CASSANDRA-8778)
 Merged from 2.0:
  * Fix regression in mixed single and multi-column relation support for
SELECT statements (CASSANDRA-8613)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
--
diff --git 
a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java 
b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
index ad53e83..6152c5f 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
@@ -132,7 +132,7 @@ public class CompressedSequentialWriter extends 
SequentialWriter
 // write data itself
 out.write(compressed.buffer, 0, compressedLength);
 // write corresponding checksum
-crcMetadata.append(compressed.buffer, 0, compressedLength);
+crcMetadata.append(compressed.buffer, 0, compressedLength, true);
 lastFlushOffset += compressedLength + 4;
 }
 catch (IOException e)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
--
diff --git 
a/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java 
b/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
index f4281b2..526347b 100644
--- a/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/util/ChecksummedSequentialWriter.java
@@ -37,7 +37,7 @@ public class ChecksummedSequentialWriter extends 
SequentialWriter
 protected void flushData()
 {
 super.flushData();
-crcMetadata.append(buffer, 0, validBufferBytes);
+crcMetadata.append(buffer, 0, validBufferBytes, false);
 }
 
 public void writeFullChecksum(Descriptor descriptor)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e621317/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
--
diff --git a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java 
b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
index 797b964..e6f5083 100644
--- a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
+++ b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
@@ -23,6 +23,7 @@ import java.io.DataOutput;
 import java.io.File;
 import java.io.IOError;
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.nio.file.Files;
 import java.util.zip.Adler32;
 import java.util.zip.Checksum;
@@ -107,15 +108,32 @@ public class DataIntegrityMetadata
 }
 }
 
-public void append(byte[] buffer, int start, int end)
+// checksumIncrementalResult indicates if the checksum we compute for 
this buffer should itself be
+// included in the full checksum, translating to if the partial 
checksum is serialized along with the
+// data it checksums (in which case the file checksum as calculated by 
external tools would

[jira] [Updated] (CASSANDRA-8925) broadcast_rpc_address NPEs while using rpc_interface

2015-03-05 Thread Chris Lockfort (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Lockfort updated CASSANDRA-8925:
--
Attachment: cassandra-2.1.3-8925.patch

> broadcast_rpc_address NPEs while using rpc_interface 
> -
>
> Key: CASSANDRA-8925
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8925
> Project: Cassandra
>  Issue Type: Bug
>  Components: Config
>Reporter: Chris Lockfort
>Assignee: Chris Lockfort
> Fix For: 2.1.4
>
> Attachments: cassandra-2.1.3-8925.patch
>
>
> Somewhat amusingly, it looks like my NPE on startup is the result of a 
> copy-paste error in:
> {code}
> [clockfort@clockfort cassandra]$ git log --stat 3e5edb82
> commit 3e5edb82c73b7b7c6e1d1e970fb764c3e3158da6
> Author: Ariel Weisberg 
> Date:   Tue Jan 27 13:30:47 2015 +0100
> rpc_interface and listen_interface generate NPE on startup when specified 
> interface doesn't exist
> 
> Patch by Ariel Weisberg; reviewed by Robert Stupp for CASSANDRA-8677
>  src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 46 
> +++---
>  1 file changed, 23 insertions(+), 23 deletions(-)
> {code}
> The log looks like:
> {code}
> INFO  18:51:13 DiskAccessMode 'auto' determined to be mmap, indexAccessMode 
> is mmap
> INFO  18:51:13 Global memtable on-heap threshold is enabled at 2008MB
> INFO  18:51:13 Global memtable off-heap threshold is enabled at 2008MB
> ERROR 18:51:13 Fatal error during configuration loading
> java.lang.NullPointerException: null
> at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:411)
>  ~[apache-cassandra-2.1.3.jar:2.1.3]
> at 
> org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:133)
>  ~[apache-cassandra-2.1.3.jar:2.1.3]
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:110) 
> [apache-cassandra-2.1.3.jar:2.1.3]
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:465)
>  [apache-cassandra-2.1.3.jar:2.1.3]
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:554) 
> [apache-cassandra-2.1.3.jar:2.1.3]
> null
> Fatal error during configuration loading; unable to start. See log for 
> stacktrace.
> {code}
> This is with a cassandra.yaml config snippet of:
> {code}
> start_rpc: true
> # rpc_address: localhost
> rpc_interface: eth0
> # RPC address to broadcast to drivers and other Cassandra nodes. This cannot
> # be set to 0.0.0.0. If left blank, this will be set to the value of
> # rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
> # be set.
> # broadcast_rpc_address: 1.2.3.4
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8925) broadcast_rpc_address NPEs while using rpc_interface

2015-03-05 Thread Chris Lockfort (JIRA)
Chris Lockfort created CASSANDRA-8925:
-

 Summary: broadcast_rpc_address NPEs while using rpc_interface 
 Key: CASSANDRA-8925
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8925
 Project: Cassandra
  Issue Type: Bug
  Components: Config
Reporter: Chris Lockfort
Assignee: Chris Lockfort
 Fix For: 2.1.4


Somewhat amusingly, it looks like my NPE on startup is the result of a 
copy-paste error in:
{code}
[clockfort@clockfort cassandra]$ git log --stat 3e5edb82
commit 3e5edb82c73b7b7c6e1d1e970fb764c3e3158da6
Author: Ariel Weisberg 
Date:   Tue Jan 27 13:30:47 2015 +0100

rpc_interface and listen_interface generate NPE on startup when specified 
interface doesn't exist

Patch by Ariel Weisberg; reviewed by Robert Stupp for CASSANDRA-8677

 src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 46 
+++---
 1 file changed, 23 insertions(+), 23 deletions(-)
{code}

The log looks like:
{code}
INFO  18:51:13 DiskAccessMode 'auto' determined to be mmap, indexAccessMode is 
mmap
INFO  18:51:13 Global memtable on-heap threshold is enabled at 2008MB
INFO  18:51:13 Global memtable off-heap threshold is enabled at 2008MB
ERROR 18:51:13 Fatal error during configuration loading
java.lang.NullPointerException: null
at 
org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:411)
 ~[apache-cassandra-2.1.3.jar:2.1.3]
at 
org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:133)
 ~[apache-cassandra-2.1.3.jar:2.1.3]
at 
org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:110) 
[apache-cassandra-2.1.3.jar:2.1.3]
at 
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:465) 
[apache-cassandra-2.1.3.jar:2.1.3]
at 
org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:554) 
[apache-cassandra-2.1.3.jar:2.1.3]
null
Fatal error during configuration loading; unable to start. See log for 
stacktrace.
{code}

This is with a cassandra.yaml config snippet of:
{code}
start_rpc: true
# rpc_address: localhost
rpc_interface: eth0
# RPC address to broadcast to drivers and other Cassandra nodes. This cannot
# be set to 0.0.0.0. If left blank, this will be set to the value of
# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
# be set.
# broadcast_rpc_address: 1.2.3.4
{code}





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7523) add date and time types

2015-03-05 Thread Joshua McKenzie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349396#comment-14349396
 ] 

Joshua McKenzie commented on CASSANDRA-7523:


Looks like we're good to go on the [python driver 
side|https://github.com/datastax/python-driver/pull/243].  Running the tests 
one last time and will commit for 2.1.4, assuming nobody has a problem with 
that.

> add date and time types
> ---
>
> Key: CASSANDRA-7523
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7523
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Jonathan Ellis
>Assignee: Joshua McKenzie
>Priority: Minor
>  Labels: client-impacting, docs
> Fix For: 2.1.4
>
>
> http://www.postgresql.org/docs/9.1/static/datatype-datetime.html
> (we already have timestamp; interval is out of scope for now, and see 
> CASSANDRA-6350 for discussion on timestamp-with-time-zone.  but date/time 
> should be pretty easy to add.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8789) OutboundTcpConnectionPool should route messages to sockets by size not type

2015-03-05 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349390#comment-14349390
 ] 

Ariel Weisberg commented on CASSANDRA-8789:
---

Yes it's in this comment 
https://issues.apache.org/jira/browse/CASSANDRA-8789?focusedCommentId=14320467&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14320467

> OutboundTcpConnectionPool should route messages to sockets by size not type
> ---
>
> Key: CASSANDRA-8789
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8789
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Ariel Weisberg
>Assignee: Ariel Weisberg
> Fix For: 3.0
>
> Attachments: 8789.diff
>
>
> I was looking at this trying to understand what messages flow over which 
> connection.
> For reads the request goes out over the command connection and the response 
> comes back over the ack connection.
> For writes the request goes out over the command connection and the response 
> comes back over the command connection.
> Reads get a dedicated socket for responses. Mutation commands and responses 
> both travel over the same socket along with read requests.
> Sockets are used uni-directional so there are actually four sockets in play 
> and four threads at each node (2 inbounded, 2 outbound).
> CASSANDRA-488 doesn't leave a record of what the impact of this change was. 
> If someone remembers what situations were made better it would be good to 
> know.
> I am not clear on when/how this is helpful. The consumer side shouldn't be 
> blocking so the only head of line blocking issue is the time it takes to 
> transfer data over the wire.
> If message size is the cause of blocking issues then the current design mixes 
> small messages and large messages on the same connection retaining the head 
> of line blocking.
> Read requests share the same connection as write requests (which are large), 
> and write acknowledgments (which are small) share the same connections as 
> write requests. The only winner is read acknowledgements.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8789) OutboundTcpConnectionPool should route messages to sockets by size not type

2015-03-05 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349381#comment-14349381
 ] 

Aleksey Yeschenko commented on CASSANDRA-8789:
--

Looks neat indeed. Not trying to stall progress here, but do we have numbers on 
this (standalone, and/or with 8692 included)? Mostly just curious.

> OutboundTcpConnectionPool should route messages to sockets by size not type
> ---
>
> Key: CASSANDRA-8789
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8789
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Ariel Weisberg
>Assignee: Ariel Weisberg
> Fix For: 3.0
>
> Attachments: 8789.diff
>
>
> I was looking at this trying to understand what messages flow over which 
> connection.
> For reads the request goes out over the command connection and the response 
> comes back over the ack connection.
> For writes the request goes out over the command connection and the response 
> comes back over the command connection.
> Reads get a dedicated socket for responses. Mutation commands and responses 
> both travel over the same socket along with read requests.
> Sockets are used uni-directional so there are actually four sockets in play 
> and four threads at each node (2 inbounded, 2 outbound).
> CASSANDRA-488 doesn't leave a record of what the impact of this change was. 
> If someone remembers what situations were made better it would be good to 
> know.
> I am not clear on when/how this is helpful. The consumer side shouldn't be 
> blocking so the only head of line blocking issue is the time it takes to 
> transfer data over the wire.
> If message size is the cause of blocking issues then the current design mixes 
> small messages and large messages on the same connection retaining the head 
> of line blocking.
> Read requests share the same connection as write requests (which are large), 
> and write acknowledgments (which are small) share the same connections as 
> write requests. The only winner is read acknowledgements.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8692) Coalesce intra-cluster network messages

2015-03-05 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349369#comment-14349369
 ] 

Benedict commented on CASSANDRA-8692:
-

Personally I'm comfortable including the patch as stands (in whichever version 
we decide), along with CASSANDRA-8789 in 3.0, and then move on to the 
proceeding investigations/improvements.

> Coalesce intra-cluster network messages
> ---
>
> Key: CASSANDRA-8692
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8692
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Ariel Weisberg
>Assignee: Ariel Weisberg
> Fix For: 2.1.4
>
> Attachments: batching-benchmark.png
>
>
> While researching CASSANDRA-8457 we found that it is effective and can be 
> done without introducing additional latency at low concurrency/throughput.
> The patch from that was used and found to be useful in a real life scenario 
> so I propose we implement this in 2.1 in addition to 3.0.
> The change set is a single file and is small enough to be reviewable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8225) Production-capable COPY FROM

2015-03-05 Thread Tyler Hobbs (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349364#comment-14349364
 ] 

Tyler Hobbs commented on CASSANDRA-8225:


bq.  How much performance do we lose if we use a new QueryMessage for each 
request instead of building frames ourselves?

Looks like about a 10% performance penalty on my laptop.  I would expect the 
difference to be a bit larger when C* isn't contending with cqlsh for CPU 
during parnew GCs, but this setup is probably typical for cqlsh and COPY.  I 
would be okay with taking a 10% hit for simpler code.

> Production-capable COPY FROM
> 
>
> Key: CASSANDRA-8225
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8225
> Project: Cassandra
>  Issue Type: New Feature
>  Components: Tools
>Reporter: Jonathan Ellis
>Assignee: Tyler Hobbs
>  Labels: cqlsh
> Fix For: 2.1.4
>
> Attachments: 8225-2.1.txt
>
>
> Via [~schumacr],
> bq. I pulled down a sourceforge data generator and created a moc file of 
> 500,000 rows that had an incrementing sequence number, date, and SSN. I then 
> used our COPY command and MySQL's LOAD DATA INFILE to load the file on my 
> Mac. Results were: 
> {noformat}
> mysql> load data infile '/Users/robin/dev/datagen3.txt'  into table p_test  
> fields terminated by ',';
> Query OK, 50 rows affected (2.18 sec)
> {noformat}
> C* 2.1.0 (pre-CASSANDRA-7405)
> {noformat}
> cqlsh:dev> copy p_test from '/Users/robin/dev/datagen3.txt' with 
> delimiter=',';
> 50 rows imported in 16 minutes and 45.485 seconds.
> {noformat}
> Cassandra 2.1.1:
> {noformat}
> cqlsh:dev> copy p_test from '/Users/robin/dev/datagen3.txt' with 
> delimiter=',';
> Processed 50 rows; Write: 4037.46 rows/s
> 50 rows imported in 2 minutes and 3.058 seconds.
> {noformat}
> [jbellis] 7405 gets us almost an order of magnitude improvement.  
> Unfortunately we're still almost 2 orders slower than mysql.
> I don't think we can continue to tell people, "use sstableloader instead."  
> The number of users sophisticated enough to use the sstable writers is small 
> and (relatively) decreasing as our user base expands.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8692) Coalesce intra-cluster network messages

2015-03-05 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349355#comment-14349355
 ] 

Ariel Weisberg commented on CASSANDRA-8692:
---

Are you testing with or without vnodes? Last time we talked it was without 
vnodes. I would expect that without vnodes you would get the performance boost 
even at large cluster sizes because each individual node should be frequently 
messaging with up to RF - 1 other nodes and there should be an opportunity to 
coalesce.

If you aren't seeing any benefit then I think there may be other bottlenecks in 
play. At 96 nodes are you able to reach CPU saturation at each node? I am not 
able to saturate in AWS and there is the weird step from 500% utilization to 
2000% with no change in throughput or latency. I think there is something in 
the way there that I want to look into. You are also measuring workloads that 
could be bottlenecked on other things. You really have to be specific about 
what you are measuring when determining whether this optimization is expected 
to help.

With vnodes I wouldn't expect much as you grow the cluster. I also didn't see a 
huge boost in GCE, the results are in an earlier comment.

You also don't get the most mileage out of this change until you combine it 
CASSANDRA-8789 which routes more messages over the same socket doubling the 
opportunity to coalesce if you are doing reads.

I don't feel passionate about getting this in to 2.1, but I would like to move 
on to investigating the utilization issues I have found.


> Coalesce intra-cluster network messages
> ---
>
> Key: CASSANDRA-8692
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8692
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Ariel Weisberg
>Assignee: Ariel Weisberg
> Fix For: 2.1.4
>
> Attachments: batching-benchmark.png
>
>
> While researching CASSANDRA-8457 we found that it is effective and can be 
> done without introducing additional latency at low concurrency/throughput.
> The patch from that was used and found to be useful in a real life scenario 
> so I propose we implement this in 2.1 in addition to 3.0.
> The change set is a single file and is small enough to be reviewable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8879) Alter table on compact storage broken

2015-03-05 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349338#comment-14349338
 ] 

Jonathan Ellis commented on CASSANDRA-8879:
---

+1

> Alter table on compact storage broken
> -
>
> Key: CASSANDRA-8879
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8879
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Nick Bailey
>Assignee: Tyler Hobbs
> Fix For: 2.0.13
>
> Attachments: 8879-2.0.txt
>
>
> In 2.0 HEAD, alter table on compact storage tables seems to be broken. With 
> the following table definition, altering the column breaks cqlsh and 
> generates a stack trace in the log.
> {noformat}
> CREATE TABLE settings (
>   key blob,
>   column1 blob,
>   value blob,
>   PRIMARY KEY ((key), column1)
> ) WITH COMPACT STORAGE
> {noformat}
> {noformat}
> cqlsh:OpsCenter> alter table settings ALTER column1 TYPE ascii ;
> TSocket read 0 bytes
> cqlsh:OpsCenter> DESC TABLE settings;
> {noformat}
> {noformat}
> ERROR [Thrift:7] 2015-02-26 17:20:24,640 CassandraDaemon.java (line 199) 
> Exception in thread Thread[Thrift:7,5,main]
> java.lang.AssertionError
> >...at 
> >org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:198)
> >...at 
> >org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:79)
> >...at 
> >org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:158)
> >...at 
> >org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:175)
> >...at 
> >org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1958)
> >...at 
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4486)
> >...at 
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4470)
> >...at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> >...at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> >...at 
> >org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:204)
> >...at 
> >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> >...at 
> >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >...at java.lang.Thread.run(Thread.java:724)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CASSANDRA-8866) PartitionedCompactionStrategy

2015-03-05 Thread Jonathan Ellis (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Ellis resolved CASSANDRA-8866.
---
Resolution: Duplicate
  Reviewer:   (was: Carl Yeksigian)

... okay, reading the previous comment there isn't actually one file per 
partition (in the normal Cassandra terminology of partition).  There's one file 
per token range.

So really this is a more limited implementation of CASSANDRA-6696 which is no 
doubt what Aleksey meant.  This is basically what you'd get with a "compact 
everything, all the time" strategy on top of 6696, which is going to do a lot 
worse from a write amplification standpoint than STCS or even LCS.  So I'm 
going to close this as a duplicate.

> PartitionedCompactionStrategy
> -
>
> Key: CASSANDRA-8866
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8866
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Takenori Sato
> Attachments: cassandra-2.0-8866.txt
>
>
> PartitionedCompactionStrategy is a new compaction strategy with the following 
> goals in mind:
> * Column tombstone removal effectiveness
> * Read performance
> As the name suggests, PartitionedCompactionStrategy actively splits 
> un-partitioned sstables(newly flushed, imported, compaction strategy switch) 
> into partitions by IPartitioner. The number of nodes will be configurable.
> Then, PartitionedCompactionStrategy finds an interesting partition at 
> compaction based on the followings:
> - the number of sstables
> - the ratio of droppable tombstones
> - read hotness
> You may think this design looks similar to SizeTieredCompactionStrategy and 
> LeveledCompactionStrategy, but the big difference is that a compaction by 
> PartitionedCompactionStrategy is based on rows(a partitions). And this allows 
> more effective column tombstone removal, and better read performance.
> Also note that this will not require any changes to the other components. So 
> this is expected to be a purely pluggable compaction strategy.
> A possible implementation of 
> _PertitionedCompactionStrategy#getNextBackgroundTask()_ is as follows:
> # find un-partitioned sstables
> # split un-partitioned sstables into partitiones
> # group all the sstables into partitions
> # find an interesting partition
> #* the number of sstables
> #* the number of droppable tombstones
> #* hotness
> # create a compaction task for the interesting bucket if found



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8836) Factor out CRC32Ex into a separate maven dependency

2015-03-05 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349326#comment-14349326
 ] 

Ariel Weisberg commented on CASSANDRA-8836:
---

+1 Works for me. Can build with Java 7, open it in Eclipse with Java 7. If I 
run with Java 8 it returns the Java 8 implementation.

> Factor out CRC32Ex into a separate maven dependency
> ---
>
> Key: CASSANDRA-8836
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8836
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Ariel Weisberg
>Assignee: T Jake Luciani
> Fix For: 3.0
>
> Attachments: 8836.patch
>
>
> The current arrangement works from the CLI, but is inconvenient for developer 
> using Java 7 from an IDE. They have to configure the override class the way 
> build.xml does when compiling.
> If we refactored http://pastebin.com/Z5NAEhzr and the interface it needs to 
> compile http://pastebin.com/tCEvuETA into a separate maven dependency and 
> removed CRC32Ex from CRC32Factory it wouldn't trip up IDEs. They would just 
> add all the jars under lib and move on with life.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8879) Alter table on compact storage broken

2015-03-05 Thread Tyler Hobbs (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349318#comment-14349318
 ] 

Tyler Hobbs commented on CASSANDRA-8879:


+1, I think that's reasonable.

> Alter table on compact storage broken
> -
>
> Key: CASSANDRA-8879
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8879
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Nick Bailey
>Assignee: Tyler Hobbs
> Fix For: 2.0.13
>
> Attachments: 8879-2.0.txt
>
>
> In 2.0 HEAD, alter table on compact storage tables seems to be broken. With 
> the following table definition, altering the column breaks cqlsh and 
> generates a stack trace in the log.
> {noformat}
> CREATE TABLE settings (
>   key blob,
>   column1 blob,
>   value blob,
>   PRIMARY KEY ((key), column1)
> ) WITH COMPACT STORAGE
> {noformat}
> {noformat}
> cqlsh:OpsCenter> alter table settings ALTER column1 TYPE ascii ;
> TSocket read 0 bytes
> cqlsh:OpsCenter> DESC TABLE settings;
> {noformat}
> {noformat}
> ERROR [Thrift:7] 2015-02-26 17:20:24,640 CassandraDaemon.java (line 199) 
> Exception in thread Thread[Thrift:7,5,main]
> java.lang.AssertionError
> >...at 
> >org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:198)
> >...at 
> >org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:79)
> >...at 
> >org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:158)
> >...at 
> >org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:175)
> >...at 
> >org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1958)
> >...at 
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4486)
> >...at 
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4470)
> >...at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> >...at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> >...at 
> >org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:204)
> >...at 
> >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> >...at 
> >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >...at java.lang.Thread.run(Thread.java:724)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-8919) cqlsh return error in querying of CompositeType data

2015-03-05 Thread Tyler Hobbs (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tyler Hobbs reassigned CASSANDRA-8919:
--

Assignee: Tyler Hobbs

> cqlsh return error in querying of CompositeType data
> 
>
> Key: CASSANDRA-8919
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8919
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
> Environment: SUSE 11 SP3, C* 2.1.2
>Reporter: Mark
>Assignee: Tyler Hobbs
>Priority: Minor
> Fix For: 2.1.2
>
>
> cqlsh return below error when querying CompositeType data. Seems like 
> deserialize_safe is undefined for this CompositeType. Is it a issue need to 
> fix?
> {code}
> cassandra@cqlsh:up_data> select * from test_stand;
> Traceback (most recent call last):
>   File "/home/mql/bin/cqlsh", line 986, in perform_simple_statement
> rows = self.session.execute(statement, trace=self.tracing_enabled)
>   File 
> "/home/mql/bin/../lib/cassandra-driver-internal-only-2.1.2.zip/cassandra-driver-2.1.2/cassandra/cluster.py",
>  line 1294, in execute
> result = future.result(timeout)
>   File 
> "/home/mql/bin/../lib/cassandra-driver-internal-only-2.1.2.zip/cassandra-driver-2.1.2/cassandra/cluster.py",
>  line 2788, in result
> raise self._final_exception
> AttributeError: type object 'CompositeType(UTF8Type, Int32Type)' has no 
> attribute 'deserialize_safe'
> {code}
> Pre-condition (in cassandra-cli)
> {code}
> create keyspace up_data with placement_strategy = 
> 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = 
> {replication_factor:1};
> use up_data;
> create column family test_stand
> with column_type = 'Standard'
> and comparator = 'UTF8Type'
> and default_validation_class = 'BytesType'
> and key_validation_class = 'UTF8Type'
> and column_metadata = [
> {column_name : 'UTF8Typefield',
> validation_class : 'UTF8Type'},
> {column_name : 'IntegerTypefield',
> validation_class : 'IntegerType'},
> {column_name : 'CompositeTypefield',
> validation_class : 
> 'CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.Int32Type)'}
> ] and compression_options = null;
> set test_stand ['test_stand1']['UTF8Typefield']='utf8Type';
> set test_stand ['test_stand1']['CompositeTypefield']='utf8Type,12';
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8487) system.schema_columns sometimes missing for 'system' keyspace

2015-03-05 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349288#comment-14349288
 ] 

Aleksey Yeschenko commented on CASSANDRA-8487:
--

Same goes to [~aholmber].

> system.schema_columns sometimes missing for 'system' keyspace
> -
>
> Key: CASSANDRA-8487
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8487
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Adam Holmberg
>Assignee: Aleksey Yeschenko
>Priority: Minor
>
> Occasionally a Cassandra node will have missing schema_columns information 
> where keyspace_name='system'.
> {code}
> cqlsh> select * from system.schema_columns where keyspace_name='system';
>  keyspace_name | columnfamily_name | column_name
> ---+---+-
> (0 rows)
> {code}
> All keyspace and column family schema info is present for 'system' -- it's 
> only the column information missing.
> This can occur on an existing cluster following node restart. The data 
> usually appears again after bouncing the node.
> This is impactful to client drivers that expect column meta for configured 
> tables.
> Reproducible in 2.1.2. Have not seen it crop up in 2.0.11.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CASSANDRA-8487) system.schema_columns sometimes missing for 'system' keyspace

2015-03-05 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko resolved CASSANDRA-8487.
--
Resolution: Cannot Reproduce

> system.schema_columns sometimes missing for 'system' keyspace
> -
>
> Key: CASSANDRA-8487
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8487
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Adam Holmberg
>Assignee: Aleksey Yeschenko
>Priority: Minor
>
> Occasionally a Cassandra node will have missing schema_columns information 
> where keyspace_name='system'.
> {code}
> cqlsh> select * from system.schema_columns where keyspace_name='system';
>  keyspace_name | columnfamily_name | column_name
> ---+---+-
> (0 rows)
> {code}
> All keyspace and column family schema info is present for 'system' -- it's 
> only the column information missing.
> This can occur on an existing cluster following node restart. The data 
> usually appears again after bouncing the node.
> This is impactful to client drivers that expect column meta for configured 
> tables.
> Reproducible in 2.1.2. Have not seen it crop up in 2.0.11.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8487) system.schema_columns sometimes missing for 'system' keyspace

2015-03-05 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349285#comment-14349285
 ] 

Aleksey Yeschenko commented on CASSANDRA-8487:
--

[~danderson] Thanks. I'm going to close it as Cannot Reproduce (in 2.1.3). Can 
you please reopen if it happens again?

> system.schema_columns sometimes missing for 'system' keyspace
> -
>
> Key: CASSANDRA-8487
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8487
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Adam Holmberg
>Assignee: Aleksey Yeschenko
>Priority: Minor
>
> Occasionally a Cassandra node will have missing schema_columns information 
> where keyspace_name='system'.
> {code}
> cqlsh> select * from system.schema_columns where keyspace_name='system';
>  keyspace_name | columnfamily_name | column_name
> ---+---+-
> (0 rows)
> {code}
> All keyspace and column family schema info is present for 'system' -- it's 
> only the column information missing.
> This can occur on an existing cluster following node restart. The data 
> usually appears again after bouncing the node.
> This is impactful to client drivers that expect column meta for configured 
> tables.
> Reproducible in 2.1.2. Have not seen it crop up in 2.0.11.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


cassandra git commit: Fix link to CREATE KEYSPACE in CQL3 docs

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 90a012a1f -> d04602d3d


Fix link to CREATE KEYSPACE in CQL3 docs

Patch by Jon Åslund; reviewed by Tyler Hobbs


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

Branch: refs/heads/cassandra-2.0
Commit: d04602d3da3793e574e59bed60bd0a2b5b88917b
Parents: 90a012a
Author: Jon Åslund 
Authored: Thu Mar 5 12:54:01 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:01 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d04602d3/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index cf074af..4f66e74 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -194,7 +194,7 @@ ALTER KEYSPACE Excelsior
   WITH replication = {'class': 'SimpleStrategy', 'replication_factor' 
: 4};
 
 p. 
-The @ALTER KEYSPACE@ statement alter the properties of an existing keyspace. 
The supported @@ are the same that for the "@CREATE 
TABLE@":#createKeyspaceStmt statement.
+The @ALTER KEYSPACE@ statement alters the properties of an existing keyspace. 
The supported @@ are the same as for the "@CREATE 
KEYSPACE@":#createKeyspaceStmt statement.
 
 
 h3(#dropKeyspaceStmt). DROP KEYSPACE



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

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 56e190b1cd18ea04dd9835722b599f75f80f30a7
Parents: 71778ee 59ed491
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:54:58 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:58 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/56e190b1/doc/cql3/CQL.textile
--



[2/2] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 59ed491ac8dbc8e7a1dcfa6bf1cc1501f8dec72b
Parents: 9c7a601 d04602d
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:54:40 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:40 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59ed491a/doc/cql3/CQL.textile
--



[jira] [Commented] (CASSANDRA-8487) system.schema_columns sometimes missing for 'system' keyspace

2015-03-05 Thread Daniel Anderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349267#comment-14349267
 ] 

Daniel Anderson commented on CASSANDRA-8487:


I am seeing the same problem on 2.1.0. The problem is reproducible in my test 
environment 1 out of 10 times.

I have not been able to reproduce the problem in 2.1.3.

> system.schema_columns sometimes missing for 'system' keyspace
> -
>
> Key: CASSANDRA-8487
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8487
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Adam Holmberg
>Assignee: Aleksey Yeschenko
>Priority: Minor
>
> Occasionally a Cassandra node will have missing schema_columns information 
> where keyspace_name='system'.
> {code}
> cqlsh> select * from system.schema_columns where keyspace_name='system';
>  keyspace_name | columnfamily_name | column_name
> ---+---+-
> (0 rows)
> {code}
> All keyspace and column family schema info is present for 'system' -- it's 
> only the column information missing.
> This can occur on an existing cluster following node restart. The data 
> usually appears again after bouncing the node.
> This is impactful to client drivers that expect column meta for configured 
> tables.
> Reproducible in 2.1.2. Have not seen it crop up in 2.0.11.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 59ed491ac8dbc8e7a1dcfa6bf1cc1501f8dec72b
Parents: 9c7a601 d04602d
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:54:40 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:40 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59ed491a/doc/cql3/CQL.textile
--



[1/3] cassandra git commit: Fix link to CREATE KEYSPACE in CQL3 docs

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 71778eec2 -> 56e190b1c


Fix link to CREATE KEYSPACE in CQL3 docs

Patch by Jon Åslund; reviewed by Tyler Hobbs


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

Branch: refs/heads/trunk
Commit: d04602d3da3793e574e59bed60bd0a2b5b88917b
Parents: 90a012a
Author: Jon Åslund 
Authored: Thu Mar 5 12:54:01 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:01 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d04602d3/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index cf074af..4f66e74 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -194,7 +194,7 @@ ALTER KEYSPACE Excelsior
   WITH replication = {'class': 'SimpleStrategy', 'replication_factor' 
: 4};
 
 p. 
-The @ALTER KEYSPACE@ statement alter the properties of an existing keyspace. 
The supported @@ are the same that for the "@CREATE 
TABLE@":#createKeyspaceStmt statement.
+The @ALTER KEYSPACE@ statement alters the properties of an existing keyspace. 
The supported @@ are the same as for the "@CREATE 
KEYSPACE@":#createKeyspaceStmt statement.
 
 
 h3(#dropKeyspaceStmt). DROP KEYSPACE



[1/2] cassandra git commit: Fix link to CREATE KEYSPACE in CQL3 docs

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 9c7a601bb -> 59ed491ac


Fix link to CREATE KEYSPACE in CQL3 docs

Patch by Jon Åslund; reviewed by Tyler Hobbs


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

Branch: refs/heads/cassandra-2.1
Commit: d04602d3da3793e574e59bed60bd0a2b5b88917b
Parents: 90a012a
Author: Jon Åslund 
Authored: Thu Mar 5 12:54:01 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:54:01 2015 -0600

--
 doc/cql3/CQL.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d04602d3/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index cf074af..4f66e74 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -194,7 +194,7 @@ ALTER KEYSPACE Excelsior
   WITH replication = {'class': 'SimpleStrategy', 'replication_factor' 
: 4};
 
 p. 
-The @ALTER KEYSPACE@ statement alter the properties of an existing keyspace. 
The supported @@ are the same that for the "@CREATE 
TABLE@":#createKeyspaceStmt statement.
+The @ALTER KEYSPACE@ statement alters the properties of an existing keyspace. 
The supported @@ are the same as for the "@CREATE 
KEYSPACE@":#createKeyspaceStmt statement.
 
 
 h3(#dropKeyspaceStmt). DROP KEYSPACE



[jira] [Updated] (CASSANDRA-8922) CQL doc: Correct link text in ALTER KEYSPACE section

2015-03-05 Thread Tyler Hobbs (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tyler Hobbs updated CASSANDRA-8922:
---
Assignee: Jon Ã…slund

> CQL doc: Correct link text in ALTER KEYSPACE section
> 
>
> Key: CASSANDRA-8922
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8922
> Project: Cassandra
>  Issue Type: Bug
>  Components: Documentation & website
>Reporter: Jon Ã…slund
>Assignee: Jon Ã…slund
>Priority: Trivial
> Fix For: 2.0.13, 2.1.4
>
> Attachments: trunk-8922.txt
>
>
> The text in ALTER KEYSPACE says: "The supported  are the same 
> that for the CREATE TABLE statement". Should be CREATE KEYSPACE of course.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8882) Wrong type mapping for varint -- Cassandra Stress 2.1

2015-03-05 Thread Sebastian Estevez (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349252#comment-14349252
 ] 

Sebastian Estevez commented on CASSANDRA-8882:
--

Thank you sir

> Wrong type mapping for varint -- Cassandra Stress 2.1
> -
>
> Key: CASSANDRA-8882
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8882
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Sebastian Estevez
> Fix For: 2.1.4
>
>
> Run a workload with a varint type, you'll see the following error:
> {code}
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for 
> value 2 of CQL type varint, expecting class java.math.BigInteger but class 
> java.lang.Integer provided
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CASSANDRA-8918) Optimise compaction performance for unique partition keys

2015-03-05 Thread Jonathan Ellis (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Ellis resolved CASSANDRA-8918.
---
   Resolution: Later
Fix Version/s: (was: 3.0)

All right.  Resolving as Later.

> Optimise compaction performance for unique partition keys
> -
>
> Key: CASSANDRA-8918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8918
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Benedict
>
> Related to the raft of improvements we're looking at for improving the CPU 
> burden of merge, if we can demonstrate that an entire partition key is unique 
> to a given file (which is quite easily done) we can avoid materialising any 
> of the row, and simply copy the data wholesale, with potentially some small 
> modifications to the index file data if it has clustering column index 
> entries, and special treatment of tombstones (most simple would be to only 
> check there are no tombstones to purge, and abort this approach if so).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8613) Regression in mixed single and multi-column relation support

2015-03-05 Thread Tyler Hobbs (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tyler Hobbs updated CASSANDRA-8613:
---
Attachment: 8613-trunk-v2.txt
8613-2.1-v2.txt
8613-2.0-v2.txt

> Regression in mixed single and multi-column relation support
> 
>
> Key: CASSANDRA-8613
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8613
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Tyler Hobbs
>Assignee: Benjamin Lerer
> Fix For: 2.0.13, 2.1.4
>
> Attachments: 8613-2.0-v2.txt, 8613-2.1-v2.txt, 8613-trunk-v2.txt, 
> CASSANDRA-8613-2.0.txt, CASSANDRA-8613-2.1.txt, CASSANDRA-8613-trunk.txt
>
>
> In 2.0.6 through 2.0.8, a query like the following was supported:
> {noformat}
> SELECT * FROM mytable WHERE clustering_0 = ? AND (clustering_1, clustering_2) 
> > (?, ?)
> {noformat}
> However, after CASSANDRA-6875, you'll get the following error:
> {noformat}
> Clustering columns may not be skipped in multi-column relations. They should 
> appear in the PRIMARY KEY order. Got (c, d) > (0, 0)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/8] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Fix mixed single and multi-column relation support

Patch by Benjamin Lerer; reviewed by Tyler Hobbs for CASSANDRA-8613


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

Branch: refs/heads/trunk
Commit: 90a012a1fe29edbb70de30d5f683e10cc27e1602
Parents: fb67c41
Author: blerer 
Authored: Thu Mar 5 12:25:03 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:25:03 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java| 384 +---
 .../cassandra/cql3/MultiColumnRelationTest.java | 186 +++-
 .../cql3/statements/SelectStatementTest.java| 973 +++
 4 files changed, 1386 insertions(+), 159 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index faa14d5..462a8d1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.13:
+ * Fix regression in mixed single and multi-column relation support for
+   SELECT statements (CASSANDRA-8613)
  * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/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 59ed6e1..6b3c781 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.cql3.statements;
 import java.nio.ByteBuffer;
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import com.google.common.base.Objects;
 import com.google.common.base.Predicate;
@@ -31,7 +32,6 @@ import org.github.jamm.MemoryMeter;
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.cql3.CFDefinition.Name;
-import org.apache.cassandra.cql3.CFDefinition.Name.Kind;
 import org.apache.cassandra.transport.messages.ResultMessage;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.*;
@@ -641,7 +641,13 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 return ByteBufferUtil.EMPTY_BYTE_BUFFER;
 
 // We deal with IN queries for keys in other places, so we know 
buildBound will return only one result
-return buildBound(b, cfDef.partitionKeys(), keyRestrictions, false, 
cfDef.getKeyNameBuilder(), variables).get(0);
+return buildBound(b,
+  new ArrayList(cfDef.partitionKeys()),
+  keyRestrictions,
+  false,
+  cfDef,
+  cfDef.getKeyNameBuilder(),
+  variables).get(0);
 }
 
 private Token getTokenBound(Bound b, List variables, 
IPartitioner p) throws InvalidRequestException
@@ -713,18 +719,35 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 
 ColumnNameBuilder builder = cfDef.getColumnNameBuilder();
 Iterator idIter = 
cfDef.clusteringColumns().iterator();
-for (Restriction r : columnRestrictions)
+while (idIter.hasNext())
 {
 CFDefinition.Name name = idIter.next();
+Restriction r = columnRestrictions[name.position];
 assert r != null && !r.isSlice();
 
 if (r.isEQ())
 {
 List values = r.values(variables);
-ByteBuffer val = values.get(0);
-if (val == null)
-throw new InvalidRequestException(String.format("Invalid 
null value for clustering key part %s", name.name));
-builder.add(val);
+if (r.isMultiColumn())
+{
+for (int i = 0, m = values.size(); i < m; i++)
+{
+if (i != 0)
+name = idIter.next();
+
+ByteBuffer val = values.get(i);
+if (val == null)
+throw new 
InvalidRequestException(String.format("Invalid null value in condition for 
column %s", nam

[8/8] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 71778eec24e42512365cb562aecf07b5fbd28265
Parents: 258e59f 9c7a601
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:34:56 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:34:56 2015 -0600

--
 CHANGES.txt |2 +
 .../cassandra/cql3/MultiColumnRelation.java |   17 +-
 .../AbstractPrimaryKeyRestrictions.java |   12 +
 .../cql3/restrictions/AbstractRestriction.java  |5 +-
 .../ForwardingPrimaryKeyRestrictions.java   |   25 +
 .../restrictions/MultiColumnRestriction.java|  269 ++---
 .../restrictions/PrimaryKeyRestrictionSet.java  |  325 +
 .../restrictions/PrimaryKeyRestrictions.java|6 +-
 .../cql3/restrictions/Restriction.java  |   49 +-
 .../cql3/restrictions/RestrictionSet.java   |  252 
 .../cql3/restrictions/Restrictions.java |4 +-
 .../SingleColumnPrimaryKeyRestrictions.java |  327 -
 .../restrictions/SingleColumnRestriction.java   |  111 +-
 .../restrictions/SingleColumnRestrictions.java  |  210 
 .../restrictions/StatementRestrictions.java |   16 +-
 .../cql3/restrictions/TokenRestriction.java |   21 +-
 .../cql3/statements/ModificationStatement.java  |   66 +-
 .../db/composites/CompositesBuilder.java|  117 +-
 .../cassandra/cql3/MultiColumnRelationTest.java |  206 +++-
 .../PrimaryKeyRestrictionSetTest.java   | 1120 ++
 20 files changed, 2293 insertions(+), 867 deletions(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/71778eec/src/java/org/apache/cassandra/cql3/MultiColumnRelation.java
--
diff --cc src/java/org/apache/cassandra/cql3/MultiColumnRelation.java
index 7e7a901,37eb69e..b54bdd0
--- a/src/java/org/apache/cassandra/cql3/MultiColumnRelation.java
+++ b/src/java/org/apache/cassandra/cql3/MultiColumnRelation.java
@@@ -112,109 -91,54 +112,106 @@@ public class MultiColumnRelation extend
  
  /**
   * For non-IN relations, returns the Tuples.Literal or Tuples.Raw marker 
for a single tuple.
 + * @return a Tuples.Literal for non-IN relations or Tuples.Raw marker for 
a single tuple.
   */
 -public Term.MultiColumnRaw getValue()
 +private Term.MultiColumnRaw getValue()
  {
 -assert relationType != Operator.IN;
 -return valuesOrMarker;
 +return relationType == Operator.IN ? inMarker : valuesOrMarker;
  }
  
 -/**
 - * For IN relations, returns the list of Tuples.Literal instances or 
Tuples.Raw markers.
 - * If a single IN marker was used, this will return null;
 - */
 -public List getInValues()
 +@Override
 +public boolean isMultiColumn()
  {
 +return true;
 +}
  
 -return inValues;
 +@Override
 +protected Restriction newEQRestriction(CFMetaData cfm,
 +   VariableSpecifications boundNames) 
throws InvalidRequestException
 +{
 +List receivers = receivers(cfm);
 +Term term = toTerm(receivers, getValue(), cfm.ksName, boundNames);
- return new MultiColumnRestriction.EQ(cfm.comparator, receivers, term);
++return new MultiColumnRestriction.EQ(receivers, term);
  }
  
 -/**
 - * For IN relations, returns the single marker for the IN values if there 
is one, otherwise null.
 - */
 -public Tuples.INRaw getInMarker()
 +@Override
 +protected Restriction newINRestriction(CFMetaData cfm,
 +   VariableSpecifications boundNames) 
throws InvalidRequestException
  {
 -return inMarker;
 +List receivers = receivers(cfm);
 +List terms = toTerms(receivers, inValues, cfm.ksName, 
boundNames);
 +if (terms == null)
 +{
 +Term term = toTerm(receivers, getValue(), cfm.ksName, boundNames);
- return new MultiColumnRestriction.InWithMarker(cfm.comparator, 
receivers, (AbstractMarker) term);
++return new MultiColumnRestriction.InWithMarker(receivers, 
(AbstractMarker) term);
 +}
- return new MultiColumnRestriction.InWithValues(cfm.comparator, 
receivers, terms);
++return new MultiColumnRestriction.InWithValues(receivers, terms);
  }
  
 -public boolean isMultiColumn()
 +@Override
 +protected Restricti

[7/8] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/71778eec/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
index 9fbe462,000..56a10a8
mode 100644,00..100644
--- 
a/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
+++ 
b/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java
@@@ -1,521 -1,0 +1,558 @@@
 +/*
 + * 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.
 + */
 +package org.apache.cassandra.cql3.restrictions;
 +
 +import java.nio.ByteBuffer;
 +import java.util.ArrayList;
++import java.util.Collection;
 +import java.util.Collections;
 +import java.util.List;
 +
 +import org.apache.cassandra.config.ColumnDefinition;
 +import org.apache.cassandra.cql3.AbstractMarker;
 +import org.apache.cassandra.cql3.Operator;
 +import org.apache.cassandra.cql3.QueryOptions;
 +import org.apache.cassandra.cql3.Term;
 +import org.apache.cassandra.cql3.statements.Bound;
 +import org.apache.cassandra.db.IndexExpression;
++import org.apache.cassandra.db.composites.CompositesBuilder;
 +import org.apache.cassandra.db.index.SecondaryIndex;
 +import org.apache.cassandra.db.index.SecondaryIndexManager;
 +import org.apache.cassandra.db.marshal.CompositeType;
 +import org.apache.cassandra.exceptions.InvalidRequestException;
 +
 +import static 
org.apache.cassandra.cql3.statements.RequestValidations.checkFalse;
 +import static 
org.apache.cassandra.cql3.statements.RequestValidations.checkTrue;
 +import static 
org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest;
 +
 +public abstract class SingleColumnRestriction extends AbstractRestriction
 +{
 +/**
 + * The definition of the column to which apply the restriction.
 + */
 +protected final ColumnDefinition columnDef;
 +
 +public SingleColumnRestriction(ColumnDefinition columnDef)
 +{
 +this.columnDef = columnDef;
 +}
 +
- /**
-  * Returns the definition of the column to which is associated this 
restriction.
-  * @return the definition of the column to which is associated this 
restriction
-  */
- public ColumnDefinition getColumnDef()
++@Override
++public Collection getColumnDefs()
 +{
- return columnDef;
++return Collections.singletonList(columnDef);
 +}
 +
 +@Override
- public void addIndexExpressionTo(List expressions,
-  SecondaryIndexManager indexManager,
-  QueryOptions options) throws 
InvalidRequestException
++public ColumnDefinition getFirstColumn()
 +{
- List values = values(options);
- checkTrue(values.size() == 1, "IN restrictions are not supported on 
indexed columns");
++return columnDef;
++}
 +
- ByteBuffer value = validateIndexedValue(columnDef, values.get(0));
- expressions.add(new IndexExpression(columnDef.name.bytes, 
Operator.EQ, value));
++@Override
++public ColumnDefinition getLastColumn()
++{
++return columnDef;
 +}
 +
 +@Override
 +public boolean hasSupportingIndex(SecondaryIndexManager indexManager)
 +{
 +SecondaryIndex index = 
indexManager.getIndexForColumn(columnDef.name.bytes);
 +return index != null && isSupportedBy(index);
 +}
 +
++@Override
++public final Restriction mergeWith(Restriction otherRestriction) throws 
InvalidRequestException
++{
++checkFalse(otherRestriction.isMultiColumn(),
++   "Mixing single column relations and multi column 
relations on clustering columns is not allowed");
++
++return doMergeWith(otherRestriction);
++}
++
++protected abstract Restriction doMergeWith(Restriction otherRestriction) 
throws InvalidRequestException;
++
 +/**
 + * Check if this type of restriction is supported by the specified index.
 + *
 + * @param index the Secondary index
 + * @return true this type of restriction is supported by the 
specified index,
 + * false otherwise.

[jira] [Commented] (CASSANDRA-8860) Too many java.util.HashMap$Entry objects in heap

2015-03-05 Thread Robert Coli (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349220#comment-14349220
 ] 

Robert Coli commented on CASSANDRA-8860:


{quote}We should probably remove this feature alltogether (cold_reads_to_omit), 
using DTCS suits these kinds of workloads much better{quote}
For the record (not that anyone asked... ;D) I am +1 here; seems like lots of 
complexity for a questionable potential win, and initial implementation has 
exposed some serious potential edge cases. DTCS FTW.

> Too many java.util.HashMap$Entry objects in heap
> 
>
> Key: CASSANDRA-8860
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8860
> Project: Cassandra
>  Issue Type: Bug
> Environment: Cassandra 2.1.3, jdk 1.7u51
>Reporter: Phil Yang
>Assignee: Marcus Eriksson
> Fix For: 2.1.4
>
> Attachments: 0001-remove-cold_reads_to_omit.patch, 8860-v2.txt, 
> 8860.txt, cassandra-env.sh, cassandra.yaml, jmap.txt, jstack.txt, 
> jstat-afterv1.txt, jstat-afterv2.txt, jstat-before.txt
>
>
> While I upgrading my cluster to 2.1.3, I find some nodes (not all) may have 
> GC issue after the node restarting successfully. Old gen grows very fast and 
> most of the space can not be recycled after setting its status to normal 
> immediately. The qps of both reading and writing are very low and there is no 
> heavy compaction.
> Jmap result seems strange that there are too many java.util.HashMap$Entry 
> objects in heap, where in my experience the "[B" is usually the No1.
> If I downgrade it to 2.1.1, this issue will not appear.
> I uploaded conf files and jstack/jmap outputs. I'll upload heap dump if 
> someone need it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/8] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 258e59fcf -> 71778eec2


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java 
b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
new file mode 100644
index 000..1a66002
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
@@ -0,0 +1,973 @@
+/*
+ * 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.
+ */
+package org.apache.cassandra.cql3.statements;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Test;
+
+import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.cql3.*;
+import org.apache.cassandra.cql3.CFDefinition.Name;
+import org.apache.cassandra.db.ColumnFamilyType;
+import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.CompositeType;
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.utils.ByteBufferUtil;
+
+import static org.junit.Assert.assertArrayEquals;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+
+public class SelectStatementTest
+{
+@Test
+public void testBuildBoundWithNoRestrictions() throws Exception
+{
+Restriction[] restrictions = new Restriction[2];
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+}
+
+/**
+ * Test 'clustering_0 = 1' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_1 = 1' with 2 clustering columns
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndTwoClusteringColumns() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq, null };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef,restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertEndOfRangeComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_0 IN (1, 2, 3)' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneInRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer value1 = ByteBufferUtil.bytes(1);
+ByteBuffer value2 = ByteBufferUtil.bytes(2);
+ByteBuffer value3 =

[4/8] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --cc test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 25df030,e3ccba5..a4ee5d7
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@@ -17,65 -17,835 +17,221 @@@
   */
  package org.apache.cassandra.cql3;
  
 -import org.apache.cassandra.SchemaLoader;
 -import org.apache.cassandra.db.ConsistencyLevel;
 -import org.apache.cassandra.db.marshal.*;
 -import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.exceptions.RequestExecutionException;
 -import org.apache.cassandra.exceptions.RequestValidationException;
 -import org.apache.cassandra.exceptions.SyntaxException;
 -import org.apache.cassandra.gms.Gossiper;
 -import org.apache.cassandra.service.ClientState;
 -import org.apache.cassandra.service.QueryState;
 -import org.apache.cassandra.transport.messages.ResultMessage;
 -import org.apache.cassandra.utils.ByteBufferUtil;
 -import org.apache.cassandra.utils.MD5Digest;
 -import org.junit.AfterClass;
 -import org.junit.BeforeClass;
  import org.junit.Test;
 -import org.slf4j.Logger;
 -import org.slf4j.LoggerFactory;
  
 -import java.nio.ByteBuffer;
 -import java.util.*;
 -
 -import static org.apache.cassandra.cql3.QueryProcessor.process;
 -import static org.apache.cassandra.cql3.QueryProcessor.processInternal;
 -import static org.junit.Assert.assertTrue;
 -import static org.junit.Assert.assertEquals;
 -import static com.google.common.collect.Lists.newArrayList;
 -import static org.junit.Assert.fail;
 -
 -public class MultiColumnRelationTest
 +public class MultiColumnRelationTest extends CQLTester
  {
 -private static final Logger logger = 
LoggerFactory.getLogger(MultiColumnRelationTest.class);
 -static ClientState clientState;
 -static String keyspace = "multi_column_relation_test";
 -
 -@BeforeClass
 -public static void setUpClass() throws Throwable
 -{
 -SchemaLoader.loadSchema();
 -executeSchemaChange("CREATE KEYSPACE IF NOT EXISTS %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}");
 -for (boolean isCompact : new boolean[]{false, true})
 -{
 -String tableSuffix = isCompact ? "_compact" : "";
 -String compactOption = isCompact ? " WITH COMPACT STORAGE" : "";
 -
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.single_partition" + 
tableSuffix + "(a int PRIMARY KEY, b int)" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.compound_partition" + 
tableSuffix + "(a int, b int, c int, PRIMARY KEY ((a, b)))" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.single_clustering" + 
tableSuffix + "(a int, b int, c int, PRIMARY KEY (a, b))" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.multiple_clustering" + 
tableSuffix + "(a int, b int, c int, d int, PRIMARY KEY (a, b, c, d))" + 
compactOption);
 -
 -compactOption = isCompact ? " COMPACT STORAGE AND " : "";
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed" + tableSuffix +
 -"(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH " + compactOption + " CLUSTERING ORDER BY (b DESC, c ASC, d DESC)");
 -}
 -
 -executeSchemaChange("CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_with_indices (a int, b int, c int, d int, e int, PRIMARY 
KEY (a, b, c, d))");
 -executeSchemaChange("CREATE INDEX ON 
%s.multiple_clustering_with_indices (b)");
 -executeSchemaChange("CREATE INDEX ON 
%s.multiple_clustering_with_indices (e)");
 -
 -executeSchemaChange("CREATE TABLE IF NOT EXISTS 
%s.partition_with_indices (a int, b int, c int, d int, e int, f int, PRIMARY 
KEY ((a, b), c, d, e))");
 -executeSchemaChange("CREATE INDEX ON %s.partition_with_indices (c)");
 -executeSchemaChange("CREATE INDEX ON %s.partition_with_indices (f)");
 -
 -clientState = ClientState.forInternalCalls();
 -}
 -
 -@AfterClass
 -public static void stopGossiper()
 -{
 -Gossiper.instance.stop();
 -}
 -
 -private static void executeSchemaChange(String query) throws Throwable
 +@Test
 +public void testSingleClusteringInvalidQueries() throws Throwable
  {
 -try
 -{
 -process(String.format(query, keyspace), ConsistencyLevel.ONE);
 -} catch (RuntimeException exc)
 +for (String compactOption : new String[]{"", " WITH COMPACT STORAGE"})
  {
 -throw exc.getCause();
 +cre

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

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/71778eec/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --cc test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 51625da,a4ee5d7..8bd4e97
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@@ -64,39 -64,174 +64,225 @@@ public class MultiColumnRelationTest ex
   "SELECT * FROM %s WHERE a=0 AND (b, c, d) IN 
((?, ?, ?, ?, ?))", 0, 1, 2, 3, 4);
  
  // Missing first clustering column
- assertInvalidMessage("Clustering columns may not be skipped in 
multi-column relations. They should appear in the PRIMARY KEY order. Got (c, d) 
= (?, ?)",
 -assertInvalidMessage("PRIMARY KEY column \"c\" cannot be 
restricted (preceding column \"b\" is not restricted)",
++assertInvalidMessage("PRIMARY KEY column \"c\" cannot be 
restricted as preceding column \"b\" is not restricted",
   "SELECT * FROM %s WHERE a = 0 AND (c, d) = 
(?, ?)", 0, 0);
- assertInvalidMessage("Clustering columns may not be skipped in 
multi-column relations. They should appear in the PRIMARY KEY order. Got (c, d) 
> (?, ?)",
 -assertInvalidMessage("PRIMARY KEY column \"c\" cannot be 
restricted (preceding column \"b\" is not restricted)",
++assertInvalidMessage("PRIMARY KEY column \"c\" cannot be 
restricted as preceding column \"b\" is not restricted",
   "SELECT * FROM %s WHERE a = 0 AND (c, d) > 
(?, ?)", 0, 0);
  
  // Nulls
--assertInvalidMessage("Invalid null value in condition for column 
d",
++assertInvalidMessage("Invalid null value in condition for 
columns: [b, c, d]",
   "SELECT * FROM %s WHERE a = 0 AND (b, c, d) 
IN ((?, ?, ?))", 1, 2, null);
  
  // Wrong type for 'd'
 -assertInvalidMessage("Expected 4 or 0 byte int (6)",
 - "SELECT * FROM %s WHERE a = 0 AND (b, c, d) 
= (?, ?, ?)", 1, 2, "foobar");
 -
 -assertInvalidMessage("Invalid tuple type literal for b of type 
int",
 - "SELECT * FROM %s WHERE a = 0 AND b = (?, ?, 
?)", 1, 2, 3);
 +assertInvalid("SELECT * FROM %s WHERE a = 0 AND (b, c, d) = (?, 
?, ?)", 1, 2, "foobar");
 +assertInvalid("SELECT * FROM %s WHERE a = 0 AND b = (?, ?, ?)", 
1, 2, 3);
  
  // Mix single and tuple inequalities
 -assertInvalidMessage("Column \"b\" cannot be restricted by both a 
tuple notation inequality and a single column inequality (b < ?)",
 +assertInvalidMessage("Mixing single column relations and multi 
column relations on clustering columns is not allowed",
   "SELECT * FROM %s WHERE a = 0 AND (b, c, d) 
> (?, ?, ?) AND b < ?", 0, 1, 0, 1);
 -assertInvalidMessage("Column \"c\" cannot be restricted by both a 
tuple notation inequality and a single column inequality (c < ?)",
 +assertInvalidMessage("Mixing single column relations and multi 
column relations on clustering columns is not allowed",
   "SELECT * FROM %s WHERE a = 0 AND (b, c, d) 
> (?, ?, ?) AND c < ?", 0, 1, 0, 1);
 -assertInvalidMessage("Column \"b\" cannot have both 
tuple-notation inequalities and single-column inequalities: (b, c, d) < (?, ?, 
?)",
 +assertInvalidMessage("Mixing single column relations and multi 
column relations on clustering columns is not allowed",
   "SELECT * FROM %s WHERE a = 0 AND b > ? AND 
(b, c, d) < (?, ?, ?)", 1, 1, 1, 0);
 -assertInvalidMessage("Column \"c\" cannot have both 
tuple-notation inequalities and single-column inequalities: (b, c, d) < (?, ?, 
?)",
 +assertInvalidMessage("Mixing single column relations and multi 
column relations on clustering columns is not allowed",
   "SELECT * FROM %s WHERE a = 0 AND c > ? AND 
(b, c, d) < (?, ?, ?)", 1, 1, 1, 0);
  
 -assertInvalidMessage("Multi-column relations can only be applied 
to clustering columns: a",
 +assertInvalidMessage("Multi-column relations can only be applied 
to clustering columns but was applied to: a",
   "SELECT * FROM %s WHERE (a, b, c, d) IN ((?, 
?, ?, ?))", 0, 1, 2, 3);
- assertInvalidMessage("Clustering columns may not be skipped in 
multi-column relations. They should appear in the PRIMARY KEY order. Got (c, d) 
IN ((?, ?))",
 -assertInvalidMessage("PRIMARY KEY column \"c\" cannot be 
restricted (preceding column \"b\" is not restricted)",
++assertInvalidMessage("PRIMARY KEY column \"c\"

[5/8] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 9c7a601bbd6ea0df72f6acea8d4cda2fd13f949c
Parents: ecf48dd 90a012a
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:29:26 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:29:26 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/MultiColumnRestriction.java |   2 +-
 .../cassandra/cql3/statements/Restriction.java  |   2 +-
 .../cql3/statements/SelectStatement.java| 426 
 .../statements/SingleColumnRestriction.java |  11 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 198 +++-
 .../cql3/statements/SelectStatementTest.java| 965 +++
 7 files changed, 1386 insertions(+), 220 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/CHANGES.txt
--
diff --cc CHANGES.txt
index ea79e22,462a8d1..57dd97e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,36 -1,6 +1,38 @@@
 -2.0.13:
 +2.1.4
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 
(CASSANDRA-8750)
 + * Make SSTableWriter.openEarly more robust and obvious (CASSANDRA-8747)
 + * Enforce SSTableReader.first/last (CASSANDRA-8744)
 + * Cleanup SegmentedFile API (CASSANDRA-8749)
 + * Avoid overlap with early compaction replacement (CASSANDRA-8683)
 + * Safer Resource Management++ (CASSANDRA-8707)
 + * Write partition size estimates into a system table (CASSANDRA-7688)
 + * cqlsh: Fix keys() and full() collection indexes in DESCRIBE output
 +   (CASSANDRA-8154)
 + * Show progress of streaming in nodetool netstats (CASSANDRA-8886)
 + * IndexSummaryBuilder utilises offheap memory, and shares data between
 +   each IndexSummary opened from it (CASSANDRA-8757)
 + * markCompacting only succeeds if the exact SSTableReader instances being 
 +   marked are in the live set (CASSANDRA-8689)
 + * cassandra-stress support for varint (CASSANDRA-8882)
 +Merged from 2.0:
+  * Fix regression in mixed single and multi-column relation support for
+SELECT statements (CASSANDRA-8613)
   * Add ability to limit number of native connections (CASSANDRA-8086)
   * Add offline tool to relevel sstables (CASSANDRA-8301)
   * Preserve stream ID for more protocol errors (CASSANDRA-8848)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
index 96cb905,f643684..6946c98
--- a/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
+++ b/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
@@@ -59,7 -58,7 +59,7 @@@ public interface MultiColumnRestrictio
   */
  public static class InWithValues extends 
SingleColumnRestriction.InWithValues implements MultiColumnRestriction.IN
  {
--public InWithValues(List values)
++public InWithValues(List values)
  {
  super(values);
  }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/src/java/org/apache/cassandra/cql3/statements/Restriction.java
--
diff --cc src/java/org/apache/cassandra/cql3/statements/Restriction.java
index 659ed95,3d33bde..485fd22
--- a/src/java/org/apache/cassandr

[3/8] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
index 000,1a66002..2a1330d
mode 00,100644..100644
--- a/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
+++ b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
@@@ -1,0 -1,973 +1,965 @@@
+ /*
+  * 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.
+  */
+ package org.apache.cassandra.cql3.statements;
+ 
+ import java.nio.ByteBuffer;
+ import java.util.ArrayList;
 -import java.util.Collections;
+ import java.util.List;
+ 
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.config.CFMetaData;
+ import org.apache.cassandra.config.ColumnDefinition;
+ import org.apache.cassandra.cql3.*;
 -import org.apache.cassandra.cql3.CFDefinition.Name;
++import org.apache.cassandra.cql3.Term.MultiItemTerminal;
+ import org.apache.cassandra.db.ColumnFamilyType;
++import org.apache.cassandra.db.composites.Composite;
++import org.apache.cassandra.db.composites.Composite.EOC;
++import org.apache.cassandra.db.composites.Composites;
++import org.apache.cassandra.db.composites.CompoundSparseCellNameType;
+ import org.apache.cassandra.db.marshal.AbstractType;
 -import org.apache.cassandra.db.marshal.CompositeType;
+ import org.apache.cassandra.db.marshal.Int32Type;
 -import org.apache.cassandra.exceptions.ConfigurationException;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
+ import org.apache.cassandra.utils.ByteBufferUtil;
+ 
 -import static org.junit.Assert.assertArrayEquals;
 -
+ import static java.util.Arrays.asList;
+ import static org.junit.Assert.assertEquals;
+ 
+ public class SelectStatementTest
+ {
+ @Test
 -public void testBuildBoundWithNoRestrictions() throws Exception
++public void testBuildBoundWithNoRestrictions() throws 
InvalidRequestException
+ {
+ Restriction[] restrictions = new Restriction[2];
 -CFDefinition cfDef = createCFDefinition(restrictions.length);
+ 
 -List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
++List bounds = executeBuildBound(restrictions, Bound.START);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0));
++assertEmptyComposite(bounds.get(0));
+ 
 -bounds = executeBuildBound(cfDef, restrictions, Bound.END);
++bounds = executeBuildBound(restrictions, Bound.END);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0));
++assertEmptyComposite(bounds.get(0));
+ }
+ 
+ /**
+  * Test 'clustering_0 = 1' with only one clustering column
+  */
+ @Test
 -public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws Exception
++public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws InvalidRequestException
+ {
+ ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+ SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+ Restriction[] restrictions = new Restriction[] { eq };
 -CFDefinition cfDef = createCFDefinition(restrictions.length);
+ 
 -List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
++List bounds = executeBuildBound(restrictions, Bound.START);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0), clustering_0);
++assertComposite(bounds.get(0), clustering_0, EOC.START);
+ 
 -bounds = executeBuildBound(cfDef, restrictions, Bound.END);
++bounds = executeBuildBound(restrictions, Bound.END);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0), clustering_0);
++assertComposite(bounds.get(0), clustering_0, EOC.END);
+ }
+ 
+ /**
+  * Test 'clustering_1 = 1' with 2 clustering columns
+  */
+ @Test
 -public void testBuildBoundWithOneEqRestrictionsAndTwoClusteringColumns() 
throws Exception
++public void testBuild

[5/5] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 9c7a601bbd6ea0df72f6acea8d4cda2fd13f949c
Parents: ecf48dd 90a012a
Author: Tyler Hobbs 
Authored: Thu Mar 5 12:29:26 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:29:26 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/MultiColumnRestriction.java |   2 +-
 .../cassandra/cql3/statements/Restriction.java  |   2 +-
 .../cql3/statements/SelectStatement.java| 426 
 .../statements/SingleColumnRestriction.java |  11 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 198 +++-
 .../cql3/statements/SelectStatementTest.java| 965 +++
 7 files changed, 1386 insertions(+), 220 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/CHANGES.txt
--
diff --cc CHANGES.txt
index ea79e22,462a8d1..57dd97e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,36 -1,6 +1,38 @@@
 -2.0.13:
 +2.1.4
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 
(CASSANDRA-8750)
 + * Make SSTableWriter.openEarly more robust and obvious (CASSANDRA-8747)
 + * Enforce SSTableReader.first/last (CASSANDRA-8744)
 + * Cleanup SegmentedFile API (CASSANDRA-8749)
 + * Avoid overlap with early compaction replacement (CASSANDRA-8683)
 + * Safer Resource Management++ (CASSANDRA-8707)
 + * Write partition size estimates into a system table (CASSANDRA-7688)
 + * cqlsh: Fix keys() and full() collection indexes in DESCRIBE output
 +   (CASSANDRA-8154)
 + * Show progress of streaming in nodetool netstats (CASSANDRA-8886)
 + * IndexSummaryBuilder utilises offheap memory, and shares data between
 +   each IndexSummary opened from it (CASSANDRA-8757)
 + * markCompacting only succeeds if the exact SSTableReader instances being 
 +   marked are in the live set (CASSANDRA-8689)
 + * cassandra-stress support for varint (CASSANDRA-8882)
 +Merged from 2.0:
+  * Fix regression in mixed single and multi-column relation support for
+SELECT statements (CASSANDRA-8613)
   * Add ability to limit number of native connections (CASSANDRA-8086)
   * Add offline tool to relevel sstables (CASSANDRA-8301)
   * Preserve stream ID for more protocol errors (CASSANDRA-8848)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
index 96cb905,f643684..6946c98
--- a/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
+++ b/src/java/org/apache/cassandra/cql3/statements/MultiColumnRestriction.java
@@@ -59,7 -58,7 +59,7 @@@ public interface MultiColumnRestrictio
   */
  public static class InWithValues extends 
SingleColumnRestriction.InWithValues implements MultiColumnRestriction.IN
  {
--public InWithValues(List values)
++public InWithValues(List values)
  {
  super(values);
  }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/src/java/org/apache/cassandra/cql3/statements/Restriction.java
--
diff --cc src/java/org/apache/cassandra/cql3/statements/Restriction.java
index 659ed95,3d33bde..485fd22
--- a/src/java/org/apache/

[1/5] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 ecf48dd79 -> 9c7a601bb


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java 
b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
new file mode 100644
index 000..1a66002
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
@@ -0,0 +1,973 @@
+/*
+ * 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.
+ */
+package org.apache.cassandra.cql3.statements;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Test;
+
+import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.cql3.*;
+import org.apache.cassandra.cql3.CFDefinition.Name;
+import org.apache.cassandra.db.ColumnFamilyType;
+import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.CompositeType;
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.utils.ByteBufferUtil;
+
+import static org.junit.Assert.assertArrayEquals;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+
+public class SelectStatementTest
+{
+@Test
+public void testBuildBoundWithNoRestrictions() throws Exception
+{
+Restriction[] restrictions = new Restriction[2];
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+}
+
+/**
+ * Test 'clustering_0 = 1' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_1 = 1' with 2 clustering columns
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndTwoClusteringColumns() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq, null };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef,restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertEndOfRangeComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_0 IN (1, 2, 3)' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneInRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer value1 = ByteBufferUtil.bytes(1);
+ByteBuffer value2 = ByteBufferUtil.bytes(2);
+ByteBuffer 

[3/5] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
--
diff --cc 
test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
index 000,1a66002..2a1330d
mode 00,100644..100644
--- a/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
+++ b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
@@@ -1,0 -1,973 +1,965 @@@
+ /*
+  * 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.
+  */
+ package org.apache.cassandra.cql3.statements;
+ 
+ import java.nio.ByteBuffer;
+ import java.util.ArrayList;
 -import java.util.Collections;
+ import java.util.List;
+ 
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.config.CFMetaData;
+ import org.apache.cassandra.config.ColumnDefinition;
+ import org.apache.cassandra.cql3.*;
 -import org.apache.cassandra.cql3.CFDefinition.Name;
++import org.apache.cassandra.cql3.Term.MultiItemTerminal;
+ import org.apache.cassandra.db.ColumnFamilyType;
++import org.apache.cassandra.db.composites.Composite;
++import org.apache.cassandra.db.composites.Composite.EOC;
++import org.apache.cassandra.db.composites.Composites;
++import org.apache.cassandra.db.composites.CompoundSparseCellNameType;
+ import org.apache.cassandra.db.marshal.AbstractType;
 -import org.apache.cassandra.db.marshal.CompositeType;
+ import org.apache.cassandra.db.marshal.Int32Type;
 -import org.apache.cassandra.exceptions.ConfigurationException;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
+ import org.apache.cassandra.utils.ByteBufferUtil;
+ 
 -import static org.junit.Assert.assertArrayEquals;
 -
+ import static java.util.Arrays.asList;
+ import static org.junit.Assert.assertEquals;
+ 
+ public class SelectStatementTest
+ {
+ @Test
 -public void testBuildBoundWithNoRestrictions() throws Exception
++public void testBuildBoundWithNoRestrictions() throws 
InvalidRequestException
+ {
+ Restriction[] restrictions = new Restriction[2];
 -CFDefinition cfDef = createCFDefinition(restrictions.length);
+ 
 -List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
++List bounds = executeBuildBound(restrictions, Bound.START);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0));
++assertEmptyComposite(bounds.get(0));
+ 
 -bounds = executeBuildBound(cfDef, restrictions, Bound.END);
++bounds = executeBuildBound(restrictions, Bound.END);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0));
++assertEmptyComposite(bounds.get(0));
+ }
+ 
+ /**
+  * Test 'clustering_0 = 1' with only one clustering column
+  */
+ @Test
 -public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws Exception
++public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws InvalidRequestException
+ {
+ ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+ SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+ Restriction[] restrictions = new Restriction[] { eq };
 -CFDefinition cfDef = createCFDefinition(restrictions.length);
+ 
 -List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
++List bounds = executeBuildBound(restrictions, Bound.START);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0), clustering_0);
++assertComposite(bounds.get(0), clustering_0, EOC.START);
+ 
 -bounds = executeBuildBound(cfDef, restrictions, Bound.END);
++bounds = executeBuildBound(restrictions, Bound.END);
+ assertEquals(1, bounds.size());
 -assertComposite(cfDef, bounds.get(0), clustering_0);
++assertComposite(bounds.get(0), clustering_0, EOC.END);
+ }
+ 
+ /**
+  * Test 'clustering_1 = 1' with 2 clustering columns
+  */
+ @Test
 -public void testBuildBoundWithOneEqRestrictionsAndTwoClusteringColumns() 
throws Exception
++public void testBuild

[2/5] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Fix mixed single and multi-column relation support

Patch by Benjamin Lerer; reviewed by Tyler Hobbs for CASSANDRA-8613


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

Branch: refs/heads/cassandra-2.1
Commit: 90a012a1fe29edbb70de30d5f683e10cc27e1602
Parents: fb67c41
Author: blerer 
Authored: Thu Mar 5 12:25:03 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:25:03 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java| 384 +---
 .../cassandra/cql3/MultiColumnRelationTest.java | 186 +++-
 .../cql3/statements/SelectStatementTest.java| 973 +++
 4 files changed, 1386 insertions(+), 159 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index faa14d5..462a8d1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.13:
+ * Fix regression in mixed single and multi-column relation support for
+   SELECT statements (CASSANDRA-8613)
  * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/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 59ed6e1..6b3c781 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.cql3.statements;
 import java.nio.ByteBuffer;
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import com.google.common.base.Objects;
 import com.google.common.base.Predicate;
@@ -31,7 +32,6 @@ import org.github.jamm.MemoryMeter;
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.cql3.CFDefinition.Name;
-import org.apache.cassandra.cql3.CFDefinition.Name.Kind;
 import org.apache.cassandra.transport.messages.ResultMessage;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.*;
@@ -641,7 +641,13 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 return ByteBufferUtil.EMPTY_BYTE_BUFFER;
 
 // We deal with IN queries for keys in other places, so we know 
buildBound will return only one result
-return buildBound(b, cfDef.partitionKeys(), keyRestrictions, false, 
cfDef.getKeyNameBuilder(), variables).get(0);
+return buildBound(b,
+  new ArrayList(cfDef.partitionKeys()),
+  keyRestrictions,
+  false,
+  cfDef,
+  cfDef.getKeyNameBuilder(),
+  variables).get(0);
 }
 
 private Token getTokenBound(Bound b, List variables, 
IPartitioner p) throws InvalidRequestException
@@ -713,18 +719,35 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 
 ColumnNameBuilder builder = cfDef.getColumnNameBuilder();
 Iterator idIter = 
cfDef.clusteringColumns().iterator();
-for (Restriction r : columnRestrictions)
+while (idIter.hasNext())
 {
 CFDefinition.Name name = idIter.next();
+Restriction r = columnRestrictions[name.position];
 assert r != null && !r.isSlice();
 
 if (r.isEQ())
 {
 List values = r.values(variables);
-ByteBuffer val = values.get(0);
-if (val == null)
-throw new InvalidRequestException(String.format("Invalid 
null value for clustering key part %s", name.name));
-builder.add(val);
+if (r.isMultiColumn())
+{
+for (int i = 0, m = values.size(); i < m; i++)
+{
+if (i != 0)
+name = idIter.next();
+
+ByteBuffer val = values.get(i);
+if (val == null)
+throw new 
InvalidRequestException(String.format("Invalid null value in condition for 
column 

[4/5] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c7a601b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --cc test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 25df030,e3ccba5..a4ee5d7
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@@ -17,65 -17,835 +17,221 @@@
   */
  package org.apache.cassandra.cql3;
  
 -import org.apache.cassandra.SchemaLoader;
 -import org.apache.cassandra.db.ConsistencyLevel;
 -import org.apache.cassandra.db.marshal.*;
 -import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.exceptions.RequestExecutionException;
 -import org.apache.cassandra.exceptions.RequestValidationException;
 -import org.apache.cassandra.exceptions.SyntaxException;
 -import org.apache.cassandra.gms.Gossiper;
 -import org.apache.cassandra.service.ClientState;
 -import org.apache.cassandra.service.QueryState;
 -import org.apache.cassandra.transport.messages.ResultMessage;
 -import org.apache.cassandra.utils.ByteBufferUtil;
 -import org.apache.cassandra.utils.MD5Digest;
 -import org.junit.AfterClass;
 -import org.junit.BeforeClass;
  import org.junit.Test;
 -import org.slf4j.Logger;
 -import org.slf4j.LoggerFactory;
  
 -import java.nio.ByteBuffer;
 -import java.util.*;
 -
 -import static org.apache.cassandra.cql3.QueryProcessor.process;
 -import static org.apache.cassandra.cql3.QueryProcessor.processInternal;
 -import static org.junit.Assert.assertTrue;
 -import static org.junit.Assert.assertEquals;
 -import static com.google.common.collect.Lists.newArrayList;
 -import static org.junit.Assert.fail;
 -
 -public class MultiColumnRelationTest
 +public class MultiColumnRelationTest extends CQLTester
  {
 -private static final Logger logger = 
LoggerFactory.getLogger(MultiColumnRelationTest.class);
 -static ClientState clientState;
 -static String keyspace = "multi_column_relation_test";
 -
 -@BeforeClass
 -public static void setUpClass() throws Throwable
 -{
 -SchemaLoader.loadSchema();
 -executeSchemaChange("CREATE KEYSPACE IF NOT EXISTS %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}");
 -for (boolean isCompact : new boolean[]{false, true})
 -{
 -String tableSuffix = isCompact ? "_compact" : "";
 -String compactOption = isCompact ? " WITH COMPACT STORAGE" : "";
 -
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.single_partition" + 
tableSuffix + "(a int PRIMARY KEY, b int)" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.compound_partition" + 
tableSuffix + "(a int, b int, c int, PRIMARY KEY ((a, b)))" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.single_clustering" + 
tableSuffix + "(a int, b int, c int, PRIMARY KEY (a, b))" + compactOption);
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS %s.multiple_clustering" + 
tableSuffix + "(a int, b int, c int, d int, PRIMARY KEY (a, b, c, d))" + 
compactOption);
 -
 -compactOption = isCompact ? " COMPACT STORAGE AND " : "";
 -executeSchemaChange(
 -"CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed" + tableSuffix +
 -"(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH " + compactOption + " CLUSTERING ORDER BY (b DESC, c ASC, d DESC)");
 -}
 -
 -executeSchemaChange("CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_with_indices (a int, b int, c int, d int, e int, PRIMARY 
KEY (a, b, c, d))");
 -executeSchemaChange("CREATE INDEX ON 
%s.multiple_clustering_with_indices (b)");
 -executeSchemaChange("CREATE INDEX ON 
%s.multiple_clustering_with_indices (e)");
 -
 -executeSchemaChange("CREATE TABLE IF NOT EXISTS 
%s.partition_with_indices (a int, b int, c int, d int, e int, f int, PRIMARY 
KEY ((a, b), c, d, e))");
 -executeSchemaChange("CREATE INDEX ON %s.partition_with_indices (c)");
 -executeSchemaChange("CREATE INDEX ON %s.partition_with_indices (f)");
 -
 -clientState = ClientState.forInternalCalls();
 -}
 -
 -@AfterClass
 -public static void stopGossiper()
 -{
 -Gossiper.instance.stop();
 -}
 -
 -private static void executeSchemaChange(String query) throws Throwable
 +@Test
 +public void testSingleClusteringInvalidQueries() throws Throwable
  {
 -try
 -{
 -process(String.format(query, keyspace), ConsistencyLevel.ONE);
 -} catch (RuntimeException exc)
 +for (String compactOption : new String[]{"", " WITH COMPACT STORAGE"})
  {
 -throw exc.getCause();
 +cre

[1/2] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 fb67c41ad -> 90a012a1f


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java 
b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
new file mode 100644
index 000..1a66002
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/statements/SelectStatementTest.java
@@ -0,0 +1,973 @@
+/*
+ * 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.
+ */
+package org.apache.cassandra.cql3.statements;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Test;
+
+import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.cql3.*;
+import org.apache.cassandra.cql3.CFDefinition.Name;
+import org.apache.cassandra.db.ColumnFamilyType;
+import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.CompositeType;
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.utils.ByteBufferUtil;
+
+import static org.junit.Assert.assertArrayEquals;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+
+public class SelectStatementTest
+{
+@Test
+public void testBuildBoundWithNoRestrictions() throws Exception
+{
+Restriction[] restrictions = new Restriction[2];
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0));
+}
+
+/**
+ * Test 'clustering_0 = 1' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef, restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_1 = 1' with 2 clustering columns
+ */
+@Test
+public void testBuildBoundWithOneEqRestrictionsAndTwoClusteringColumns() 
throws Exception
+{
+ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);
+SingleColumnRestriction.EQ eq = new 
SingleColumnRestriction.EQ(toTerm(clustering_0), false);
+Restriction[] restrictions = new Restriction[] { eq, null };
+CFDefinition cfDef = createCFDefinition(restrictions.length);
+
+List bounds = executeBuildBound(cfDef, restrictions, 
Bound.START);
+assertEquals(1, bounds.size());
+assertComposite(cfDef, bounds.get(0), clustering_0);
+
+bounds = executeBuildBound(cfDef,restrictions, Bound.END);
+assertEquals(1, bounds.size());
+assertEndOfRangeComposite(cfDef, bounds.get(0), clustering_0);
+}
+
+/**
+ * Test 'clustering_0 IN (1, 2, 3)' with only one clustering column
+ */
+@Test
+public void testBuildBoundWithOneInRestrictionsAndOneClusteringColumn() 
throws Exception
+{
+ByteBuffer value1 = ByteBufferUtil.bytes(1);
+ByteBuffer value2 = ByteBufferUtil.bytes(2);
+ByteBuffer 

[2/2] cassandra git commit: Fix mixed single and multi-column relation support

2015-03-05 Thread tylerhobbs
Fix mixed single and multi-column relation support

Patch by Benjamin Lerer; reviewed by Tyler Hobbs for CASSANDRA-8613


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

Branch: refs/heads/cassandra-2.0
Commit: 90a012a1fe29edbb70de30d5f683e10cc27e1602
Parents: fb67c41
Author: blerer 
Authored: Thu Mar 5 12:25:03 2015 -0600
Committer: Tyler Hobbs 
Committed: Thu Mar 5 12:25:03 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java| 384 +---
 .../cassandra/cql3/MultiColumnRelationTest.java | 186 +++-
 .../cql3/statements/SelectStatementTest.java| 973 +++
 4 files changed, 1386 insertions(+), 159 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index faa14d5..462a8d1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.13:
+ * Fix regression in mixed single and multi-column relation support for
+   SELECT statements (CASSANDRA-8613)
  * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/90a012a1/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 59ed6e1..6b3c781 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.cql3.statements;
 import java.nio.ByteBuffer;
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import com.google.common.base.Objects;
 import com.google.common.base.Predicate;
@@ -31,7 +32,6 @@ import org.github.jamm.MemoryMeter;
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.cql3.CFDefinition.Name;
-import org.apache.cassandra.cql3.CFDefinition.Name.Kind;
 import org.apache.cassandra.transport.messages.ResultMessage;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.*;
@@ -641,7 +641,13 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 return ByteBufferUtil.EMPTY_BYTE_BUFFER;
 
 // We deal with IN queries for keys in other places, so we know 
buildBound will return only one result
-return buildBound(b, cfDef.partitionKeys(), keyRestrictions, false, 
cfDef.getKeyNameBuilder(), variables).get(0);
+return buildBound(b,
+  new ArrayList(cfDef.partitionKeys()),
+  keyRestrictions,
+  false,
+  cfDef,
+  cfDef.getKeyNameBuilder(),
+  variables).get(0);
 }
 
 private Token getTokenBound(Bound b, List variables, 
IPartitioner p) throws InvalidRequestException
@@ -713,18 +719,35 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 
 ColumnNameBuilder builder = cfDef.getColumnNameBuilder();
 Iterator idIter = 
cfDef.clusteringColumns().iterator();
-for (Restriction r : columnRestrictions)
+while (idIter.hasNext())
 {
 CFDefinition.Name name = idIter.next();
+Restriction r = columnRestrictions[name.position];
 assert r != null && !r.isSlice();
 
 if (r.isEQ())
 {
 List values = r.values(variables);
-ByteBuffer val = values.get(0);
-if (val == null)
-throw new InvalidRequestException(String.format("Invalid 
null value for clustering key part %s", name.name));
-builder.add(val);
+if (r.isMultiColumn())
+{
+for (int i = 0, m = values.size(); i < m; i++)
+{
+if (i != 0)
+name = idIter.next();
+
+ByteBuffer val = values.get(i);
+if (val == null)
+throw new 
InvalidRequestException(String.format("Invalid null value in condition for 
column 

[jira] [Commented] (CASSANDRA-8911) Consider Mutation-based Repairs

2015-03-05 Thread T Jake Luciani (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349170#comment-14349170
 ] 

T Jake Luciani commented on CASSANDRA-8911:
---

I think this would also give us the ability to constantly repair in the 
background. we could use the hints log for which Primary keys to repair.

> Consider Mutation-based Repairs
> ---
>
> Key: CASSANDRA-8911
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8911
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Tyler Hobbs
>
> We should consider a mutation-based repair to replace the existing streaming 
> repair.  While we're at it, we could do away with a lot of the complexity 
> around merkle trees.
> I have not planned this out in detail, but here's roughly what I'm thinking:
>  * Instead of building an entire merkle tree up front, just send the "leaves" 
> one-by-one.  Instead of dealing with token ranges, make the leaves primary 
> key ranges.  The PK ranges would need to be contiguous, so that the start of 
> each range would match the end of the previous range. (The first and last 
> leaves would need to be open-ended on one end of the PK range.) This would be 
> similar to doing a read with paging.
>  * Once one page of data is read, compute a hash of it and send it to the 
> other replicas along with the PK range that it covers and a row count.
>  * When the replicas receive the hash, the perform a read over the same PK 
> range (using a LIMIT of the row count + 1) and compare hashes (unless the row 
> counts don't match, in which case this can be skipped).
>  * If there is a mismatch, the replica will send a mutation covering that 
> page's worth of data (ignoring the row count this time) to the source node.
> Here are the advantages that I can think of:
>  * With the current repair behavior of streaming, vnode-enabled clusters may 
> need to stream hundreds of small SSTables.  This results in increased compact
> ion load on the receiving node.  With the mutation-based approach, memtables 
> would naturally merge these.
>  * It's simple to throttle.  For example, you could give a number of rows/sec 
> that should be repaired.
>  * It's easy to see what PK range has been repaired so far.  This could make 
> it simpler to resume a repair that fails midway.
>  * Inconsistencies start to be repaired almost right away.
>  * Less special code \(?\)
>  * Wide partitions are no longer a problem.
> There are a few problems I can think of:
>  * Counters.  I don't know if this can be made safe, or if they need to be 
> skipped.
>  * To support incremental repair, we need to be able to read from only 
> repaired sstables.  Probably not too difficult to do.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


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

2015-03-05 Thread yukim
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 258e59fcf3eae9f808e9c37c0aee2c54458e3cf9
Parents: ac75ce3 ecf48dd
Author: Yuki Morishita 
Authored: Thu Mar 5 11:52:37 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:52:37 2015 -0600

--
 CHANGES.txt |   2 +
 .../org/apache/cassandra/config/Config.java |  12 +++
 .../cassandra/config/DatabaseDescriptor.java|  12 ++-
 .../cql3/statements/UpdateStatement.java|  41 ++--
 src/java/org/apache/cassandra/db/Keyspace.java  |   8 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  56 ++
 .../io/sstable/CQLSSTableWriterClientTest.java  | 102 +++
 .../io/sstable/CQLSSTableWriterTest.java|  23 +++--
 8 files changed, 215 insertions(+), 41 deletions(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/258e59fc/src/java/org/apache/cassandra/config/Config.java
--
diff --cc src/java/org/apache/cassandra/config/Config.java
index 7e1e9ee,c683d7b..a174a0f
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@@ -205,9 -200,10 +205,11 @@@ public class Confi
  public volatile int counter_cache_save_period = 7200;
  public volatile int counter_cache_keys_to_save = Integer.MAX_VALUE;
  
 -public String memory_allocator = NativeAllocator.class.getSimpleName();
 +@Deprecated
 +public String memory_allocator;
  
+ private static boolean isClientMode = false;
+ 
  public Integer file_cache_size_in_mb;
  
  public boolean inter_dc_tcp_nodelay = true;
@@@ -239,6 -231,16 +241,16 @@@
  outboundBindAny = value;
  }
  
+ public static boolean isClientMode()
+ {
 -   return isClientMode;
++return isClientMode;
+ }
+ 
+ public static void setClientMode(boolean clientMode)
+ {
+ isClientMode = clientMode;
+ }
+ 
  public void configHintedHandoff() throws ConfigurationException
  {
  if (hinted_handoff_enabled != null && 
!hinted_handoff_enabled.isEmpty())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/258e59fc/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index b1a2684,924ab3c..af21f74
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -92,16 -115,36 +92,26 @@@ public class DatabaseDescripto
  private static String localDC;
  private static Comparator localComparator;
  
 +public static void forceStaticInitialization() {}
  static
  {
+ // In client mode, we use a default configuration. Note that the 
fields of this class will be
+ // left unconfigured however (the partitioner or localDC will be null 
for instance) so this
+ // should be used with care.
  try
  {
- applyConfig(loadConfig());
+ if (Config.isClientMode())
+ {
+ conf = new Config();
 -// at least we have to set memoryAllocator to open SSTable in 
client mode
 -memoryAllocator = 
FBUtilities.newOffHeapAllocator(conf.memory_allocator);
+ }
+ else
+ {
+ applyConfig(loadConfig());
+ }
  }
 -catch (ConfigurationException e)
 -{
 -logger.error("Fatal configuration error", e);
 -System.err.println(e.getMessage() + "\nFatal configuration error; 
unable to start. See log for stacktrace.");
 -System.exit(1);
 -}
  catch (Exception e)
  {
 -logger.error("Fatal error during configuration loading", e);
 -System.err.println(e.getMessage() + "\nFatal error during 
configuration loading; unable to start. See log for stacktrace.");
 -JVMStabilityInspector.inspectThrowable(e);
 -System.exit(1);
 +throw new ExceptionInInitializerError(e);
  }
  }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/258e59fc/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
-

[3/6] cassandra git commit: Fix CQLSSTableWriter throwing exception and spawning threads

2015-03-05 Thread yukim
Fix CQLSSTableWriter throwing exception and spawning threads

patch by Benjamin Lerer; reviewed by yukim for CASSANDRA-8808


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

Branch: refs/heads/trunk
Commit: fb67c41ad7faeff7a5f33e9e0bca6493a3febe89
Parents: e56d9ef
Author: blerer 
Authored: Tue Mar 3 12:00:57 2015 +0100
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:41:50 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/UpdateStatement.java|  23 
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  50 ++--
 .../io/sstable/CQLSSTableWriterClientTest.java  | 116 +++
 .../io/sstable/CQLSSTableWriterTest.java|  31 +++--
 5 files changed, 198 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4e34c9e..faa14d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -27,6 +27,8 @@
  * 'nodetool info' prints exception against older node (CASSANDRA-8796)
  * Ensure SSTableSimpleUnsortedWriter.close() terminates if
disk writer has crashed (CASSANDRA-8807)
+ * Fix CQLSSTableWriter throwing exception and spawning threads
+   (CASSANDRA-8808)
 
 2.0.12:
  * Use more efficient slice size for querying internal secondary

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 594b5db..f34edaf 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -50,6 +50,15 @@ public class UpdateStatement extends ModificationStatement
 public void addUpdateForKey(ColumnFamily cf, ByteBuffer key, 
ColumnNameBuilder builder, UpdateParameters params)
 throws InvalidRequestException
 {
+addUpdateForKey(cf, key, builder, params, true);
+}
+
+public void addUpdateForKey(ColumnFamily cf,
+ByteBuffer key,
+ColumnNameBuilder builder,
+UpdateParameters params,
+boolean validateIndexedColumns) throws 
InvalidRequestException
+{
 CFDefinition cfDef = cfm.getCfDef();
 
 if (builder.getLength() > FBUtilities.MAX_UNSIGNED_SHORT)
@@ -106,6 +115,20 @@ public class UpdateStatement extends ModificationStatement
 update.execute(key, cf, builder.copy(), params);
 }
 
+// validateIndexedColumns trigger a call to Keyspace.open() which we 
want to be able to avoid in some case
+//(e.g. when using CQLSSTableWriter)
+if (validateIndexedColumns)
+validateIndexedColumns(cf);
+}
+
+/**
+ * Checks that the value of the indexed columns is valid.
+ *
+ * @param cf the column family
+ * @throws InvalidRequestException if one of the values is invalid
+ */
+private void validateIndexedColumns(ColumnFamily cf) throws 
InvalidRequestException
+{
 SecondaryIndexManager indexManager = 
Keyspace.open(cfm.ksName).getColumnFamilyStore(cfm.cfId).indexManager;
 if (indexManager.hasIndexes())
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
--
diff --git a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java 
b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 8006112..fb4c186 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -37,9 +37,9 @@ import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Murmur3Partitioner;
+import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.RequestValidationException;
-import org.apache.cassandra.io.compress.CompressionParameters;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.ClientState;
 import org.apache.cass

[5/6] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread yukim
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: ecf48dd79d29ba80008afa26fd40c3fc6d9509ac
Parents: b1c2536 fb67c41
Author: Yuki Morishita 
Authored: Thu Mar 5 11:48:22 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:48:22 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/UpdateStatement.java|  29 -
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  56 +
 .../io/sstable/CQLSSTableWriterClientTest.java  | 116 +++
 .../io/sstable/CQLSSTableWriterTest.java|  21 +++-
 5 files changed, 195 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecf48dd7/CHANGES.txt
--
diff --cc CHANGES.txt
index aa2e1f9,faa14d5..ea79e22
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -42,105 -10,10 +42,107 @@@ Merged from 2.0
 table with ASC ordering and paging (CASSANDRA-8767)
   * AssertionError: "Memory was freed" when running cleanup (CASSANDRA-8716)
   * Make it possible to set max_sstable_age to fractional days (CASSANDRA-8406)
 - * Fix memory leak in SSTableSimple*Writer and SSTableReader.validate()
 -   (CASSANDRA-8748)
   * Fix some multi-column relations with indexes on some clustering
 columns (CASSANDRA-8275)
 + * Fix memory leak in SSTableSimple*Writer and SSTableReader.validate()
 +   (CASSANDRA-8748)
 + * Throw OOM if allocating memory fails to return a valid pointer 
(CASSANDRA-8726)
 + * Fix SSTableSimpleUnsortedWriter ConcurrentModificationException 
(CASSANDRA-8619)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableSimpleUnsortedWriter.close() terminates if
 +   disk writer has crashed (CASSANDRA-8807)
++ * Fix CQLSSTableWriter throwing exception and spawning threads
++   (CASSANDRA-8808)
 +
 +
 +2.1.3
 + * Fix HSHA/offheap_objects corruption (CASSANDRA-8719)
 + * Upgrade libthrift to 0.9.2 (CASSANDRA-8685)
 + * Don't use the shared ref in sstableloader (CASSANDRA-8704)
 + * Purge internal prepared statements if related tables or
 +   keyspaces are dropped (CASSANDRA-8693)
 + * (cqlsh) Handle unicode BOM at start of files (CASSANDRA-8638)
 + * Stop compactions before exiting offline tools (CASSANDRA-8623)
 + * Update tools/stress/README.txt to match current behaviour (CASSANDRA-7933)
 + * Fix schema from Thrift conversion with empty metadata (CASSANDRA-8695)
 + * Safer Resource Management (CASSANDRA-7705)
 + * Make sure we compact highly overlapping cold sstables with
 +   STCS (CASSANDRA-8635)
 + * rpc_interface and listen_interface generate NPE on startup when specified
 +   interface doesn't exist (CASSANDRA-8677)
 + * Fix ArrayIndexOutOfBoundsException in nodetool cfhistograms 
(CASSANDRA-8514)
 + * Switch from yammer metrics for nodetool cf/proxy histograms 
(CASSANDRA-8662)
 + * Make sure we don't add tmplink files to the compaction
 +   strategy (CASSANDRA-8580)
 + * (cqlsh) Handle maps with blob keys (CASSANDRA-8372)
 + * (cqlsh) Handle DynamicCompositeType schemas correctly (CASSANDRA-8563)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6706)
 + * Add tooling to detect hot partitions (CASSANDRA-7974)
 + * Fix cassandra-stress user-mode truncation of partition generation 
(CASSANDRA-8608)
 + * Only stream from unrepaired sstables during inc repair (CASSANDRA-8267)
 + * Don't allow starting multiple inc repairs on the same sstables 
(CASSANDRA-8316)
 + * Invalidate prepared BATCH statements when related tables
 +   or keyspaces are dropped (CASSANDRA-8652)
 + * Fix missing results in secondary index queries on collections
 +   with ALLOW FILTERING (CASSANDRA-8421)
 + * Expose EstimatedHistogram metrics for range slices (CASSANDRA-8627)
 + * (cqlsh) Escape clqshrc passwords properly (CASSANDRA-8618)
 + * Fix NPE when passing wrong argument in ALTER TABLE statement 
(CASSANDRA-8355)
 + * Pig: Refactor and deprecate CqlStorage (CASSANDRA-8599)
 + * Don't reuse the same cleanup strategy for all sstables (CASSANDRA-8537)
 + * Fix case-sensitivity of index name on CREATE and DROP INDEX
 +   statements (CASSANDRA-8365)
 + * Better detection/logging for corruption in compressed sstables 
(CASSANDRA-8192)
 + * Use the correct repairedAt value when closing writer (CASSANDRA-8570)
 + * (cqlsh) Handle a schema mismatch being detected on startup (CASSANDRA-8512)
 + * Properly calculate expected write size during compaction (CASSANDRA-8532)
 + * Invalidate affected prepared statements when a table's col

[2/6] cassandra git commit: Fix CQLSSTableWriter throwing exception and spawning threads

2015-03-05 Thread yukim
Fix CQLSSTableWriter throwing exception and spawning threads

patch by Benjamin Lerer; reviewed by yukim for CASSANDRA-8808


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

Branch: refs/heads/cassandra-2.1
Commit: fb67c41ad7faeff7a5f33e9e0bca6493a3febe89
Parents: e56d9ef
Author: blerer 
Authored: Tue Mar 3 12:00:57 2015 +0100
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:41:50 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/UpdateStatement.java|  23 
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  50 ++--
 .../io/sstable/CQLSSTableWriterClientTest.java  | 116 +++
 .../io/sstable/CQLSSTableWriterTest.java|  31 +++--
 5 files changed, 198 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4e34c9e..faa14d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -27,6 +27,8 @@
  * 'nodetool info' prints exception against older node (CASSANDRA-8796)
  * Ensure SSTableSimpleUnsortedWriter.close() terminates if
disk writer has crashed (CASSANDRA-8807)
+ * Fix CQLSSTableWriter throwing exception and spawning threads
+   (CASSANDRA-8808)
 
 2.0.12:
  * Use more efficient slice size for querying internal secondary

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 594b5db..f34edaf 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -50,6 +50,15 @@ public class UpdateStatement extends ModificationStatement
 public void addUpdateForKey(ColumnFamily cf, ByteBuffer key, 
ColumnNameBuilder builder, UpdateParameters params)
 throws InvalidRequestException
 {
+addUpdateForKey(cf, key, builder, params, true);
+}
+
+public void addUpdateForKey(ColumnFamily cf,
+ByteBuffer key,
+ColumnNameBuilder builder,
+UpdateParameters params,
+boolean validateIndexedColumns) throws 
InvalidRequestException
+{
 CFDefinition cfDef = cfm.getCfDef();
 
 if (builder.getLength() > FBUtilities.MAX_UNSIGNED_SHORT)
@@ -106,6 +115,20 @@ public class UpdateStatement extends ModificationStatement
 update.execute(key, cf, builder.copy(), params);
 }
 
+// validateIndexedColumns trigger a call to Keyspace.open() which we 
want to be able to avoid in some case
+//(e.g. when using CQLSSTableWriter)
+if (validateIndexedColumns)
+validateIndexedColumns(cf);
+}
+
+/**
+ * Checks that the value of the indexed columns is valid.
+ *
+ * @param cf the column family
+ * @throws InvalidRequestException if one of the values is invalid
+ */
+private void validateIndexedColumns(ColumnFamily cf) throws 
InvalidRequestException
+{
 SecondaryIndexManager indexManager = 
Keyspace.open(cfm.ksName).getColumnFamilyStore(cfm.cfId).indexManager;
 if (indexManager.hasIndexes())
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
--
diff --git a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java 
b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 8006112..fb4c186 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -37,9 +37,9 @@ import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Murmur3Partitioner;
+import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.RequestValidationException;
-import org.apache.cassandra.io.compress.CompressionParameters;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.ClientState;
 import org.apa

[1/6] cassandra git commit: Fix CQLSSTableWriter throwing exception and spawning threads

2015-03-05 Thread yukim
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 e56d9efb7 -> fb67c41ad
  refs/heads/cassandra-2.1 b1c2536cc -> ecf48dd79
  refs/heads/trunk ac75ce3e9 -> 258e59fcf


Fix CQLSSTableWriter throwing exception and spawning threads

patch by Benjamin Lerer; reviewed by yukim for CASSANDRA-8808


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

Branch: refs/heads/cassandra-2.0
Commit: fb67c41ad7faeff7a5f33e9e0bca6493a3febe89
Parents: e56d9ef
Author: blerer 
Authored: Tue Mar 3 12:00:57 2015 +0100
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:41:50 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/UpdateStatement.java|  23 
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  50 ++--
 .../io/sstable/CQLSSTableWriterClientTest.java  | 116 +++
 .../io/sstable/CQLSSTableWriterTest.java|  31 +++--
 5 files changed, 198 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4e34c9e..faa14d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -27,6 +27,8 @@
  * 'nodetool info' prints exception against older node (CASSANDRA-8796)
  * Ensure SSTableSimpleUnsortedWriter.close() terminates if
disk writer has crashed (CASSANDRA-8807)
+ * Fix CQLSSTableWriter throwing exception and spawning threads
+   (CASSANDRA-8808)
 
 2.0.12:
  * Use more efficient slice size for querying internal secondary

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 594b5db..f34edaf 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -50,6 +50,15 @@ public class UpdateStatement extends ModificationStatement
 public void addUpdateForKey(ColumnFamily cf, ByteBuffer key, 
ColumnNameBuilder builder, UpdateParameters params)
 throws InvalidRequestException
 {
+addUpdateForKey(cf, key, builder, params, true);
+}
+
+public void addUpdateForKey(ColumnFamily cf,
+ByteBuffer key,
+ColumnNameBuilder builder,
+UpdateParameters params,
+boolean validateIndexedColumns) throws 
InvalidRequestException
+{
 CFDefinition cfDef = cfm.getCfDef();
 
 if (builder.getLength() > FBUtilities.MAX_UNSIGNED_SHORT)
@@ -106,6 +115,20 @@ public class UpdateStatement extends ModificationStatement
 update.execute(key, cf, builder.copy(), params);
 }
 
+// validateIndexedColumns trigger a call to Keyspace.open() which we 
want to be able to avoid in some case
+//(e.g. when using CQLSSTableWriter)
+if (validateIndexedColumns)
+validateIndexedColumns(cf);
+}
+
+/**
+ * Checks that the value of the indexed columns is valid.
+ *
+ * @param cf the column family
+ * @throws InvalidRequestException if one of the values is invalid
+ */
+private void validateIndexedColumns(ColumnFamily cf) throws 
InvalidRequestException
+{
 SecondaryIndexManager indexManager = 
Keyspace.open(cfm.ksName).getColumnFamilyStore(cfm.cfId).indexManager;
 if (indexManager.hasIndexes())
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb67c41a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
--
diff --git a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java 
b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 8006112..fb4c186 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -37,9 +37,9 @@ import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Murmur3Partitioner;
+import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.RequestValidationException;
-import org

[4/6] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread yukim
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: ecf48dd79d29ba80008afa26fd40c3fc6d9509ac
Parents: b1c2536 fb67c41
Author: Yuki Morishita 
Authored: Thu Mar 5 11:48:22 2015 -0600
Committer: Yuki Morishita 
Committed: Thu Mar 5 11:48:22 2015 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/UpdateStatement.java|  29 -
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  56 +
 .../io/sstable/CQLSSTableWriterClientTest.java  | 116 +++
 .../io/sstable/CQLSSTableWriterTest.java|  21 +++-
 5 files changed, 195 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecf48dd7/CHANGES.txt
--
diff --cc CHANGES.txt
index aa2e1f9,faa14d5..ea79e22
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -42,105 -10,10 +42,107 @@@ Merged from 2.0
 table with ASC ordering and paging (CASSANDRA-8767)
   * AssertionError: "Memory was freed" when running cleanup (CASSANDRA-8716)
   * Make it possible to set max_sstable_age to fractional days (CASSANDRA-8406)
 - * Fix memory leak in SSTableSimple*Writer and SSTableReader.validate()
 -   (CASSANDRA-8748)
   * Fix some multi-column relations with indexes on some clustering
 columns (CASSANDRA-8275)
 + * Fix memory leak in SSTableSimple*Writer and SSTableReader.validate()
 +   (CASSANDRA-8748)
 + * Throw OOM if allocating memory fails to return a valid pointer 
(CASSANDRA-8726)
 + * Fix SSTableSimpleUnsortedWriter ConcurrentModificationException 
(CASSANDRA-8619)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableSimpleUnsortedWriter.close() terminates if
 +   disk writer has crashed (CASSANDRA-8807)
++ * Fix CQLSSTableWriter throwing exception and spawning threads
++   (CASSANDRA-8808)
 +
 +
 +2.1.3
 + * Fix HSHA/offheap_objects corruption (CASSANDRA-8719)
 + * Upgrade libthrift to 0.9.2 (CASSANDRA-8685)
 + * Don't use the shared ref in sstableloader (CASSANDRA-8704)
 + * Purge internal prepared statements if related tables or
 +   keyspaces are dropped (CASSANDRA-8693)
 + * (cqlsh) Handle unicode BOM at start of files (CASSANDRA-8638)
 + * Stop compactions before exiting offline tools (CASSANDRA-8623)
 + * Update tools/stress/README.txt to match current behaviour (CASSANDRA-7933)
 + * Fix schema from Thrift conversion with empty metadata (CASSANDRA-8695)
 + * Safer Resource Management (CASSANDRA-7705)
 + * Make sure we compact highly overlapping cold sstables with
 +   STCS (CASSANDRA-8635)
 + * rpc_interface and listen_interface generate NPE on startup when specified
 +   interface doesn't exist (CASSANDRA-8677)
 + * Fix ArrayIndexOutOfBoundsException in nodetool cfhistograms 
(CASSANDRA-8514)
 + * Switch from yammer metrics for nodetool cf/proxy histograms 
(CASSANDRA-8662)
 + * Make sure we don't add tmplink files to the compaction
 +   strategy (CASSANDRA-8580)
 + * (cqlsh) Handle maps with blob keys (CASSANDRA-8372)
 + * (cqlsh) Handle DynamicCompositeType schemas correctly (CASSANDRA-8563)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6706)
 + * Add tooling to detect hot partitions (CASSANDRA-7974)
 + * Fix cassandra-stress user-mode truncation of partition generation 
(CASSANDRA-8608)
 + * Only stream from unrepaired sstables during inc repair (CASSANDRA-8267)
 + * Don't allow starting multiple inc repairs on the same sstables 
(CASSANDRA-8316)
 + * Invalidate prepared BATCH statements when related tables
 +   or keyspaces are dropped (CASSANDRA-8652)
 + * Fix missing results in secondary index queries on collections
 +   with ALLOW FILTERING (CASSANDRA-8421)
 + * Expose EstimatedHistogram metrics for range slices (CASSANDRA-8627)
 + * (cqlsh) Escape clqshrc passwords properly (CASSANDRA-8618)
 + * Fix NPE when passing wrong argument in ALTER TABLE statement 
(CASSANDRA-8355)
 + * Pig: Refactor and deprecate CqlStorage (CASSANDRA-8599)
 + * Don't reuse the same cleanup strategy for all sstables (CASSANDRA-8537)
 + * Fix case-sensitivity of index name on CREATE and DROP INDEX
 +   statements (CASSANDRA-8365)
 + * Better detection/logging for corruption in compressed sstables 
(CASSANDRA-8192)
 + * Use the correct repairedAt value when closing writer (CASSANDRA-8570)
 + * (cqlsh) Handle a schema mismatch being detected on startup (CASSANDRA-8512)
 + * Properly calculate expected write size during compaction (CASSANDRA-8532)
 + * Invalidate affected prepared statements when a table's columns
 + 

[jira] [Updated] (CASSANDRA-8086) Cassandra should have ability to limit the number of native connections

2015-03-05 Thread Joshua McKenzie (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joshua McKenzie updated CASSANDRA-8086:
---
Issue Type: Improvement  (was: Bug)

> Cassandra should have ability to limit the number of native connections
> ---
>
> Key: CASSANDRA-8086
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8086
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Vishy Kasar
>Assignee: Norman Maurer
> Fix For: 2.0.13, 2.1.4
>
> Attachments: 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-2.1.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-2.0.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-final-v2.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-final.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c.txt
>
>
> We have a production cluster with 72 instances spread across 2 DCs. We have a 
> large number ( ~ 40,000 ) of clients hitting this cluster. Client normally 
> connects to 4 cassandra instances. Some event (we think it is a schema change 
> on server side) triggered the client to establish connections to all 
> cassandra instances of local DC. This brought the server to its knees. The 
> client connections failed and client attempted re-connections. 
> Cassandra should protect itself from such attack from client. Do we have any 
> knobs to control the number of max connections? If not, we need to add that 
> knob.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8086) Cassandra should have ability to limit the number of native connections

2015-03-05 Thread Joshua McKenzie (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joshua McKenzie updated CASSANDRA-8086:
---
Fix Version/s: 2.0.13

> Cassandra should have ability to limit the number of native connections
> ---
>
> Key: CASSANDRA-8086
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8086
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Vishy Kasar
>Assignee: Norman Maurer
> Fix For: 2.0.13, 2.1.4
>
> Attachments: 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-2.1.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-2.0.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-final-v2.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c-final.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c.patch, 
> 0001-CASSANDRA-8086-Allow-to-limit-the-number-of-native-c.txt
>
>
> We have a production cluster with 72 instances spread across 2 DCs. We have a 
> large number ( ~ 40,000 ) of clients hitting this cluster. Client normally 
> connects to 4 cassandra instances. Some event (we think it is a schema change 
> on server side) triggered the client to establish connections to all 
> cassandra instances of local DC. This brought the server to its knees. The 
> client connections failed and client attempted re-connections. 
> Cassandra should protect itself from such attack from client. Do we have any 
> knobs to control the number of max connections? If not, we need to add that 
> knob.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/2] cassandra git commit: Add ability to limit number of native connections

2015-03-05 Thread jmckenzie
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 790256825 -> b1c2536cc


Add ability to limit number of native connections

Patch by Norman Maurer; reviewed by jmckenzie for CASSANDRA-8086


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

Branch: refs/heads/cassandra-2.1
Commit: e56d9efb7c18138fac9059207568598bbb964eb9
Parents: 2428b9c
Author: Norman Maurer 
Authored: Thu Mar 5 10:37:53 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 10:37:53 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 111 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 160 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f98bb3f..4e34c9e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.13:
+ * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)
  * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/conf/cassandra.yaml
--
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 163ae9e..f99ade1 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -332,6 +332,14 @@ native_transport_port: 9042
 # be rejected as invalid. The default is 256MB.
 # native_transport_max_frame_size_in_mb: 256
 
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
 # Whether to start the thrift rpc server.
 start_rpc: true
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/Config.java
--
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index 4dd71aa..3c223e3 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -112,6 +112,8 @@ public class Config
 public Integer native_transport_port = 9042;
 public Integer native_transport_max_threads = 128;
 public Integer native_transport_max_frame_size_in_mb = 256;
+public volatile Long native_transport_max_concurrent_connections = -1L;
+public volatile Long native_transport_max_concurrent_connections_per_ip = 
-1L;
 
 @Deprecated
 public Integer thrift_max_message_length_in_mb = 16;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 286014e..b3b10c1 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1108,6 +1108,25 @@ public class DatabaseDescriptor
 return conf.native_transport_max_frame_size_in_mb * 1024 * 1024;
 }
 
+public static Long getNativeTransportMaxConcurrentConnections()
+{
+return conf.native_transport_max_concurrent_connections;
+}
+
+public static void setNativeTransportMaxConcurrentConnections(long 
nativeTransportMaxConcurrentConnections)
+{
+conf.native_transport_max_concurrent_connections = 
nativeTransportMaxConcurrentConnections;
+}
+
+public static Long getNativeTransportMaxConcurrentConnectionsPerIp() {
+return conf.native_transport_max_concurrent_connections_per_ip;
+}
+
+public static void setNativeTransportMaxConcurrentConnectionsPerIp(long 
native_transport_max_concurrent_connections_per_ip)
+{
+conf.native_transport_max_concu

[1/3] cassandra git commit: Add ability to limit number of native connections

2015-03-05 Thread jmckenzie
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0d2ec11c7 -> ac75ce3e9


Add ability to limit number of native connections

Patch by Norman Maurer; reviewed by jmckenzie for CASSANDRA-8086


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

Branch: refs/heads/trunk
Commit: e56d9efb7c18138fac9059207568598bbb964eb9
Parents: 2428b9c
Author: Norman Maurer 
Authored: Thu Mar 5 10:37:53 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 10:37:53 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 111 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 160 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f98bb3f..4e34c9e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.13:
+ * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)
  * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/conf/cassandra.yaml
--
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 163ae9e..f99ade1 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -332,6 +332,14 @@ native_transport_port: 9042
 # be rejected as invalid. The default is 256MB.
 # native_transport_max_frame_size_in_mb: 256
 
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
 # Whether to start the thrift rpc server.
 start_rpc: true
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/Config.java
--
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index 4dd71aa..3c223e3 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -112,6 +112,8 @@ public class Config
 public Integer native_transport_port = 9042;
 public Integer native_transport_max_threads = 128;
 public Integer native_transport_max_frame_size_in_mb = 256;
+public volatile Long native_transport_max_concurrent_connections = -1L;
+public volatile Long native_transport_max_concurrent_connections_per_ip = 
-1L;
 
 @Deprecated
 public Integer thrift_max_message_length_in_mb = 16;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 286014e..b3b10c1 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1108,6 +1108,25 @@ public class DatabaseDescriptor
 return conf.native_transport_max_frame_size_in_mb * 1024 * 1024;
 }
 
+public static Long getNativeTransportMaxConcurrentConnections()
+{
+return conf.native_transport_max_concurrent_connections;
+}
+
+public static void setNativeTransportMaxConcurrentConnections(long 
nativeTransportMaxConcurrentConnections)
+{
+conf.native_transport_max_concurrent_connections = 
nativeTransportMaxConcurrentConnections;
+}
+
+public static Long getNativeTransportMaxConcurrentConnectionsPerIp() {
+return conf.native_transport_max_concurrent_connections_per_ip;
+}
+
+public static void setNativeTransportMaxConcurrentConnectionsPerIp(long 
native_transport_max_concurrent_connections_per_ip)
+{
+conf.native_transport_max_concurrent_connection

[jira] [Updated] (CASSANDRA-8761) Make custom role options accessible from IRoleManager

2015-03-05 Thread Sam Tunnicliffe (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Tunnicliffe updated CASSANDRA-8761:
---
Attachment: 8761-v2.txt

v2 patch with options column always present in LIST ROLES resultset metadata

> Make custom role options accessible from IRoleManager
> -
>
> Key: CASSANDRA-8761
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8761
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sam Tunnicliffe
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 3.0
>
> Attachments: 8761-v2.txt, 8761.txt
>
>
> IRoleManager implementations may support custom OPTIONS arguments to CREATE & 
> ALTER ROLE. If supported, these custom options should be retrievable from the 
> IRoleManager and included in the results of LIST ROLES queries.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread jmckenzie
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
CHANGES.txt


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

Branch: refs/heads/trunk
Commit: b1c2536ccb244be078cddc0da6c788d2b7c0f4ec
Parents: 7902568 e56d9ef
Author: Joshua McKenzie 
Authored: Thu Mar 5 11:32:41 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 11:32:41 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 108 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 157 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/CHANGES.txt
--
diff --cc CHANGES.txt
index 137c0f1,4e34c9e..aa2e1f9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,36 -1,5 +1,37 @@@
 -2.0.13:
 +2.1.4
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 
(CASSANDRA-8750)
 + * Make SSTableWriter.openEarly more robust and obvious (CASSANDRA-8747)
 + * Enforce SSTableReader.first/last (CASSANDRA-8744)
 + * Cleanup SegmentedFile API (CASSANDRA-8749)
 + * Avoid overlap with early compaction replacement (CASSANDRA-8683)
 + * Safer Resource Management++ (CASSANDRA-8707)
 + * Write partition size estimates into a system table (CASSANDRA-7688)
 + * cqlsh: Fix keys() and full() collection indexes in DESCRIBE output
 +   (CASSANDRA-8154)
 + * Show progress of streaming in nodetool netstats (CASSANDRA-8886)
 + * IndexSummaryBuilder utilises offheap memory, and shares data between
 +   each IndexSummary opened from it (CASSANDRA-8757)
 + * markCompacting only succeeds if the exact SSTableReader instances being 
 +   marked are in the live set (CASSANDRA-8689)
 + * cassandra-stress support for varint (CASSANDRA-8882)
 +Merged from 2.0:
+  * Add ability to limit number of native connections (CASSANDRA-8086)
   * Add offline tool to relevel sstables (CASSANDRA-8301)
   * Preserve stream ID for more protocol errors (CASSANDRA-8848)
   * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/conf/cassandra.yaml
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/config/Config.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/service/StorageProxy.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/service/StorageProxyMBean.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/transport/ConnectionLimitHandler.java
--
d

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

2015-03-05 Thread jmckenzie
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: ac75ce3e9961a7bb77640c01030744e6e19781a6
Parents: 0d2ec11 b1c2536
Author: Joshua McKenzie 
Authored: Thu Mar 5 11:37:05 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 11:37:05 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 108 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 157 insertions(+), 1 deletion(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/conf/cassandra.yaml
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/src/java/org/apache/cassandra/config/Config.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/src/java/org/apache/cassandra/service/StorageProxy.java
--
diff --cc src/java/org/apache/cassandra/service/StorageProxy.java
index 162a843,2ca94b7..80b22f4
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@@ -2249,11 -2294,17 +2249,17 @@@ public class StorageProxy implements St
  
  public Long getTruncateRpcTimeout() { return 
DatabaseDescriptor.getTruncateRpcTimeout(); }
  public void setTruncateRpcTimeout(Long timeoutInMillis) { 
DatabaseDescriptor.setTruncateRpcTimeout(timeoutInMillis); }
+ 
+ public Long getNativeTransportMaxConcurrentConnections() { return 
DatabaseDescriptor.getNativeTransportMaxConcurrentConnections(); }
+ public void setNativeTransportMaxConcurrentConnections(Long 
nativeTransportMaxConcurrentConnections) { 
DatabaseDescriptor.setNativeTransportMaxConcurrentConnections(nativeTransportMaxConcurrentConnections);
 }
+ 
+ public Long getNativeTransportMaxConcurrentConnectionsPerIp() { return 
DatabaseDescriptor.getNativeTransportMaxConcurrentConnectionsPerIp(); }
+ public void setNativeTransportMaxConcurrentConnectionsPerIp(Long 
nativeTransportMaxConcurrentConnections) { 
DatabaseDescriptor.setNativeTransportMaxConcurrentConnectionsPerIp(nativeTransportMaxConcurrentConnections);
 }
+ 
  public void reloadTriggerClasses() { 
TriggerExecutor.instance.reloadClasses(); }
  
- 
  public long getReadRepairAttempted() {
 -return ReadRepairMetrics.attempted.count();
 +return ReadRepairMetrics.attempted.getCount();
  }
  
  public long getReadRepairRepairedBlocking() {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/src/java/org/apache/cassandra/service/StorageProxyMBean.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac75ce3e/src/java/org/apache/cassandra/transport/Server.java
--



[2/2] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2015-03-05 Thread jmckenzie
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
CHANGES.txt


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

Branch: refs/heads/cassandra-2.1
Commit: b1c2536ccb244be078cddc0da6c788d2b7c0f4ec
Parents: 7902568 e56d9ef
Author: Joshua McKenzie 
Authored: Thu Mar 5 11:32:41 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 11:32:41 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 108 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 157 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/CHANGES.txt
--
diff --cc CHANGES.txt
index 137c0f1,4e34c9e..aa2e1f9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,36 -1,5 +1,37 @@@
 -2.0.13:
 +2.1.4
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 
(CASSANDRA-8750)
 + * Make SSTableWriter.openEarly more robust and obvious (CASSANDRA-8747)
 + * Enforce SSTableReader.first/last (CASSANDRA-8744)
 + * Cleanup SegmentedFile API (CASSANDRA-8749)
 + * Avoid overlap with early compaction replacement (CASSANDRA-8683)
 + * Safer Resource Management++ (CASSANDRA-8707)
 + * Write partition size estimates into a system table (CASSANDRA-7688)
 + * cqlsh: Fix keys() and full() collection indexes in DESCRIBE output
 +   (CASSANDRA-8154)
 + * Show progress of streaming in nodetool netstats (CASSANDRA-8886)
 + * IndexSummaryBuilder utilises offheap memory, and shares data between
 +   each IndexSummary opened from it (CASSANDRA-8757)
 + * markCompacting only succeeds if the exact SSTableReader instances being 
 +   marked are in the live set (CASSANDRA-8689)
 + * cassandra-stress support for varint (CASSANDRA-8882)
 +Merged from 2.0:
+  * Add ability to limit number of native connections (CASSANDRA-8086)
   * Add offline tool to relevel sstables (CASSANDRA-8301)
   * Preserve stream ID for more protocol errors (CASSANDRA-8848)
   * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/conf/cassandra.yaml
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/config/Config.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/service/StorageProxy.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/service/StorageProxyMBean.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1c2536c/src/java/org/apache/cassandra/transport/ConnectionLimitHandler.java

cassandra git commit: Add ability to limit number of native connections

2015-03-05 Thread jmckenzie
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 2428b9c55 -> e56d9efb7


Add ability to limit number of native connections

Patch by Norman Maurer; reviewed by jmckenzie for CASSANDRA-8086


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

Branch: refs/heads/cassandra-2.0
Commit: e56d9efb7c18138fac9059207568598bbb964eb9
Parents: 2428b9c
Author: Norman Maurer 
Authored: Thu Mar 5 10:37:53 2015 -0600
Committer: Joshua McKenzie 
Committed: Thu Mar 5 10:37:53 2015 -0600

--
 CHANGES.txt |   1 +
 conf/cassandra.yaml |   8 ++
 .../org/apache/cassandra/config/Config.java |   2 +
 .../cassandra/config/DatabaseDescriptor.java|  19 
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../cassandra/service/StorageProxyMBean.java|   3 +
 .../transport/ConnectionLimitHandler.java   | 111 +++
 .../org/apache/cassandra/transport/Server.java  |   9 ++
 8 files changed, 160 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f98bb3f..4e34c9e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.13:
+ * Add ability to limit number of native connections (CASSANDRA-8086)
  * Add offline tool to relevel sstables (CASSANDRA-8301)
  * Preserve stream ID for more protocol errors (CASSANDRA-8848)
  * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/conf/cassandra.yaml
--
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 163ae9e..f99ade1 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -332,6 +332,14 @@ native_transport_port: 9042
 # be rejected as invalid. The default is 256MB.
 # native_transport_max_frame_size_in_mb: 256
 
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
 # Whether to start the thrift rpc server.
 start_rpc: true
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/Config.java
--
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index 4dd71aa..3c223e3 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -112,6 +112,8 @@ public class Config
 public Integer native_transport_port = 9042;
 public Integer native_transport_max_threads = 128;
 public Integer native_transport_max_frame_size_in_mb = 256;
+public volatile Long native_transport_max_concurrent_connections = -1L;
+public volatile Long native_transport_max_concurrent_connections_per_ip = 
-1L;
 
 @Deprecated
 public Integer thrift_max_message_length_in_mb = 16;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e56d9efb/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
--
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 286014e..b3b10c1 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1108,6 +1108,25 @@ public class DatabaseDescriptor
 return conf.native_transport_max_frame_size_in_mb * 1024 * 1024;
 }
 
+public static Long getNativeTransportMaxConcurrentConnections()
+{
+return conf.native_transport_max_concurrent_connections;
+}
+
+public static void setNativeTransportMaxConcurrentConnections(long 
nativeTransportMaxConcurrentConnections)
+{
+conf.native_transport_max_concurrent_connections = 
nativeTransportMaxConcurrentConnections;
+}
+
+public static Long getNativeTransportMaxConcurrentConnectionsPerIp() {
+return conf.native_transport_max_concurrent_connections_per_ip;
+}
+
+public static void setNativeTransportMaxConcurrentConnectionsPerIp(long 
native_transport_max_concurrent_connections_per_ip)
+{
+conf.native_transport_max_concu

[jira] [Updated] (CASSANDRA-8876) Allow easier init script reuse

2015-03-05 Thread Brandon Williams (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Williams updated CASSANDRA-8876:

Reviewer: Michael Shuler  (was: Brandon Williams)
Assignee: (was: Michael Shuler)

> Allow easier init script reuse
> --
>
> Key: CASSANDRA-8876
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8876
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Packaging
>Reporter: Marko Asplund
> Fix For: 3.0
>
> Attachments: trunk-CASSANDRA-8876.txt
>
>
> Make it possible to reuse the Cassandra debian init script with different 
> configuration and Cassandra home paths by making paths configurable via 
> environment variables set in /etc/default/cassandra.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8911) Consider Mutation-based Repairs

2015-03-05 Thread Marcus Eriksson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349135#comment-14349135
 ] 

Marcus Eriksson commented on CASSANDRA-8911:


and I think we could still do it incrementally by just iterating over the keys 
in the unrepaired sstables. If we do this we would need to make sure we have a 
separate(?) memtable for these reads to flush that data into a repaired sstable

> Consider Mutation-based Repairs
> ---
>
> Key: CASSANDRA-8911
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8911
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Tyler Hobbs
>
> We should consider a mutation-based repair to replace the existing streaming 
> repair.  While we're at it, we could do away with a lot of the complexity 
> around merkle trees.
> I have not planned this out in detail, but here's roughly what I'm thinking:
>  * Instead of building an entire merkle tree up front, just send the "leaves" 
> one-by-one.  Instead of dealing with token ranges, make the leaves primary 
> key ranges.  The PK ranges would need to be contiguous, so that the start of 
> each range would match the end of the previous range. (The first and last 
> leaves would need to be open-ended on one end of the PK range.) This would be 
> similar to doing a read with paging.
>  * Once one page of data is read, compute a hash of it and send it to the 
> other replicas along with the PK range that it covers and a row count.
>  * When the replicas receive the hash, the perform a read over the same PK 
> range (using a LIMIT of the row count + 1) and compare hashes (unless the row 
> counts don't match, in which case this can be skipped).
>  * If there is a mismatch, the replica will send a mutation covering that 
> page's worth of data (ignoring the row count this time) to the source node.
> Here are the advantages that I can think of:
>  * With the current repair behavior of streaming, vnode-enabled clusters may 
> need to stream hundreds of small SSTables.  This results in increased compact
> ion load on the receiving node.  With the mutation-based approach, memtables 
> would naturally merge these.
>  * It's simple to throttle.  For example, you could give a number of rows/sec 
> that should be repaired.
>  * It's easy to see what PK range has been repaired so far.  This could make 
> it simpler to resume a repair that fails midway.
>  * Inconsistencies start to be repaired almost right away.
>  * Less special code \(?\)
>  * Wide partitions are no longer a problem.
> There are a few problems I can think of:
>  * Counters.  I don't know if this can be made safe, or if they need to be 
> skipped.
>  * To support incremental repair, we need to be able to read from only 
> repaired sstables.  Probably not too difficult to do.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


  1   2   >