git commit: Correctly handle prepared operation on collections

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2.0 553b9e86d - b4f2f2014


Correctly handle prepared operation on collections

patch by slebresne; reviewed by jbellis for CASSANDRA-4945


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

Branch: refs/heads/cassandra-1.2.0
Commit: b4f2f2014e088b293fc7305f9c3e6409ee428495
Parents: 553b9e8
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:13:07 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:13:07 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index e63350b..cdd651a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Use Stats.db when bulk loading if present (CASSANDRA-4957)
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
+ * Correctly handle prepared operation on collections (CASSANDRA-4945)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/src/java/org/apache/cassandra/cql3/Cql.g
--
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g 
b/src/java/org/apache/cassandra/cql3/Cql.g
index ce08e66..9c3f77b 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -74,7 +74,7 @@ options {
 // used by UPDATE of the counter columns to validate if '-' was supplied 
by user
 public void validateMinusSupplied(Object op, final Term value, IntStream 
stream) throws MissingTokenException
 {
-if (op == null  (value.isBindMarker() || 
Long.parseLong(value.getText())  0))
+if (op == null  Long.parseLong(value.getText())  0)
 throw new MissingTokenException(102, stream, value);
 }
 
@@ -561,7 +561,8 @@ cfOrKsName[CFName name, boolean isKs]
 ;
 
 set_operation returns [Operation op]
-: t=term { $op = ColumnOperation.Set(t); }
+: t=finalTerm{ $op = ColumnOperation.Set(t); }
+| mk=QMARK   { $op = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.SET); }
 | m=map_literal  { $op = MapOperation.Set(m);  }
 | l=list_literal { $op = ListOperation.Set(l); }
 | s=set_literal  { $op = SetOperation.Set(s);  }
@@ -591,14 +592,9 @@ term returns [Term term]
 | t=QMARK  { $term = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
 ;
 
-intTerm returns [Term integer]
-: t=INTEGER { $integer = new Term($t.text, $t.type); }
-| t=QMARK   { $integer = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
-;
-
 termPairWithOperation[ListPairColumnIdentifier, Operation columns]
 : key=cident '='
-(set_op = set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
+( set_op=set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
 | c=cident op=operation
   {
   if (!key.equals(c))
@@ -611,6 +607,13 @@ termPairWithOperation[ListPairColumnIdentifier, 
Operation columns]
   addRecognitionError(Only expressions like X = value + X 
are supported.);
   columns.add(Pair.ColumnIdentifier, Operationcreate(key, 
ListOperation.Prepend(ll)));
   }
+| mk=QMARK '+' c=cident
+  {
+  if (!key.equals(c))
+  addRecognitionError(Only expressions like X = value + X 
are supported.);
+  PreparedOperation pop = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.PREPARED_PLUS);
+  columns.add(Pair.ColumnIdentifier, 

[1/2] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 c235229e9 - 3479c636b


Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: 3479c636baee9af58b742e4af80512823f9be138
Parents: c235229 b4f2f20
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:14:03 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:14:03 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


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



[2/2] git commit: Correctly handle prepared operation on collections

2012-11-21 Thread slebresne
Correctly handle prepared operation on collections

patch by slebresne; reviewed by jbellis for CASSANDRA-4945


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

Branch: refs/heads/cassandra-1.2
Commit: b4f2f2014e088b293fc7305f9c3e6409ee428495
Parents: 553b9e8
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:13:07 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:13:07 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index e63350b..cdd651a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Use Stats.db when bulk loading if present (CASSANDRA-4957)
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
+ * Correctly handle prepared operation on collections (CASSANDRA-4945)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/src/java/org/apache/cassandra/cql3/Cql.g
--
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g 
b/src/java/org/apache/cassandra/cql3/Cql.g
index ce08e66..9c3f77b 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -74,7 +74,7 @@ options {
 // used by UPDATE of the counter columns to validate if '-' was supplied 
by user
 public void validateMinusSupplied(Object op, final Term value, IntStream 
stream) throws MissingTokenException
 {
-if (op == null  (value.isBindMarker() || 
Long.parseLong(value.getText())  0))
+if (op == null  Long.parseLong(value.getText())  0)
 throw new MissingTokenException(102, stream, value);
 }
 
@@ -561,7 +561,8 @@ cfOrKsName[CFName name, boolean isKs]
 ;
 
 set_operation returns [Operation op]
-: t=term { $op = ColumnOperation.Set(t); }
+: t=finalTerm{ $op = ColumnOperation.Set(t); }
+| mk=QMARK   { $op = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.SET); }
 | m=map_literal  { $op = MapOperation.Set(m);  }
 | l=list_literal { $op = ListOperation.Set(l); }
 | s=set_literal  { $op = SetOperation.Set(s);  }
@@ -591,14 +592,9 @@ term returns [Term term]
 | t=QMARK  { $term = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
 ;
 
-intTerm returns [Term integer]
-: t=INTEGER { $integer = new Term($t.text, $t.type); }
-| t=QMARK   { $integer = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
-;
-
 termPairWithOperation[ListPairColumnIdentifier, Operation columns]
 : key=cident '='
-(set_op = set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
+( set_op=set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
 | c=cident op=operation
   {
   if (!key.equals(c))
@@ -611,6 +607,13 @@ termPairWithOperation[ListPairColumnIdentifier, 
Operation columns]
   addRecognitionError(Only expressions like X = value + X 
are supported.);
   columns.add(Pair.ColumnIdentifier, Operationcreate(key, 
ListOperation.Prepend(ll)));
   }
+| mk=QMARK '+' c=cident
+  {
+  if (!key.equals(c))
+  addRecognitionError(Only expressions like X = value + X 
are supported.);
+  PreparedOperation pop = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.PREPARED_PLUS);
+  columns.add(Pair.ColumnIdentifier, Operationcreate(key, pop));
+  }
 )
 | key=cident '[' t=term ']' '=' 

[2/3] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: 3479c636baee9af58b742e4af80512823f9be138
Parents: c235229 b4f2f20
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:14:03 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:14:03 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


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



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

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/trunk 298606afd - 86447b7df


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: 86447b7df829a1e8040bd428ad1d86568dbd30f6
Parents: 298606a 3479c63
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:14:20 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:14:20 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


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



[3/3] git commit: Correctly handle prepared operation on collections

2012-11-21 Thread slebresne
Correctly handle prepared operation on collections

patch by slebresne; reviewed by jbellis for CASSANDRA-4945


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

Branch: refs/heads/trunk
Commit: b4f2f2014e088b293fc7305f9c3e6409ee428495
Parents: 553b9e8
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 09:13:07 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 09:13:07 2012 +0100

--
 CHANGES.txt|1 +
 src/java/org/apache/cassandra/cql3/Cql.g   |   39 +++--
 .../cassandra/cql3/operations/ColumnOperation.java |   27 +---
 .../cassandra/cql3/operations/ListOperation.java   |   83 +++--
 .../cassandra/cql3/operations/MapOperation.java|   24 ++-
 .../cassandra/cql3/operations/Operation.java   |9 +-
 .../cql3/operations/PreparedOperation.java |  143 +++
 .../cassandra/cql3/operations/SetOperation.java|   44 -
 .../cassandra/cql3/statements/UpdateStatement.java |   25 +--
 9 files changed, 298 insertions(+), 97 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index e63350b..cdd651a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Use Stats.db when bulk loading if present (CASSANDRA-4957)
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
+ * Correctly handle prepared operation on collections (CASSANDRA-4945)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4f2f201/src/java/org/apache/cassandra/cql3/Cql.g
--
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g 
b/src/java/org/apache/cassandra/cql3/Cql.g
index ce08e66..9c3f77b 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -74,7 +74,7 @@ options {
 // used by UPDATE of the counter columns to validate if '-' was supplied 
by user
 public void validateMinusSupplied(Object op, final Term value, IntStream 
stream) throws MissingTokenException
 {
-if (op == null  (value.isBindMarker() || 
Long.parseLong(value.getText())  0))
+if (op == null  Long.parseLong(value.getText())  0)
 throw new MissingTokenException(102, stream, value);
 }
 
@@ -561,7 +561,8 @@ cfOrKsName[CFName name, boolean isKs]
 ;
 
 set_operation returns [Operation op]
-: t=term { $op = ColumnOperation.Set(t); }
+: t=finalTerm{ $op = ColumnOperation.Set(t); }
+| mk=QMARK   { $op = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.SET); }
 | m=map_literal  { $op = MapOperation.Set(m);  }
 | l=list_literal { $op = ListOperation.Set(l); }
 | s=set_literal  { $op = SetOperation.Set(s);  }
@@ -591,14 +592,9 @@ term returns [Term term]
 | t=QMARK  { $term = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
 ;
 
-intTerm returns [Term integer]
-: t=INTEGER { $integer = new Term($t.text, $t.type); }
-| t=QMARK   { $integer = new Term($t.text, $t.type, 
++currentBindMarkerIdx); }
-;
-
 termPairWithOperation[ListPairColumnIdentifier, Operation columns]
 : key=cident '='
-(set_op = set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
+( set_op=set_operation { columns.add(Pair.ColumnIdentifier, 
Operationcreate(key, set_op)); }
 | c=cident op=operation
   {
   if (!key.equals(c))
@@ -611,6 +607,13 @@ termPairWithOperation[ListPairColumnIdentifier, 
Operation columns]
   addRecognitionError(Only expressions like X = value + X 
are supported.);
   columns.add(Pair.ColumnIdentifier, Operationcreate(key, 
ListOperation.Prepend(ll)));
   }
+| mk=QMARK '+' c=cident
+  {
+  if (!key.equals(c))
+  addRecognitionError(Only expressions like X = value + X 
are supported.);
+  PreparedOperation pop = new PreparedOperation(new Term($mk.text, 
$mk.type, ++currentBindMarkerIdx), PreparedOperation.Kind.PREPARED_PLUS);
+  columns.add(Pair.ColumnIdentifier, Operationcreate(key, pop));
+  }
 )
 | key=cident '[' t=term ']' '=' vv=term
  

[jira] [Created] (CASSANDRA-4978) SSL support for the binary protocol

2012-11-21 Thread Sylvain Lebresne (JIRA)
Sylvain Lebresne created CASSANDRA-4978:
---

 Summary: SSL support for the binary protocol
 Key: CASSANDRA-4978
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4978
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
 Fix For: 1.2.1


We should add support for SSL in the binary protocol. This should be relatively 
straightforward since Netty already have all it takes to add such support.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-3818) disabling m-a-t for fun and profit (and other ant stuff)

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-3818:
--

Reviewer: dbrosius  (was: stephenc)

 disabling m-a-t for fun and profit (and other ant stuff)
 

 Key: CASSANDRA-3818
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3818
 Project: Cassandra
  Issue Type: Bug
  Components: Core, Packaging
Affects Versions: 1.0.7
Reporter: Eric Evans
Assignee: Eric Evans
Priority: Minor
  Labels: build
 Fix For: 1.1.7

 Attachments: 
 ASF.LICENSE.NOT.GRANTED--v1-0001-CASSANDRA-3818-keep-init-in-init-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0002-clean-up-avro-generation-dependencies-and-dependants.txt,
  
 ASF.LICENSE.NOT.GRANTED--v1-0003-remove-useless-build-subprojects-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0004-group-test-targets-under-test-all.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0005-add-property-to-disable-maven-junk.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0006-add-property-to-disable-rat-license-header-writing.txt,
  ASF.LICENSE.NOT.GRANTED--v1-0007-don-t-needlessly-regenerate-thrift-code.txt


 It should be possible to disable maven-ant-tasks for environments with more 
 rigid dependency control, or where network access isn't available.
 Patches to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3818) disabling m-a-t for fun and profit (and other ant stuff)

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501858#comment-13501858
 ] 

Jonathan Ellis commented on CASSANDRA-3818:
---

Dave, what can you make of this?

 disabling m-a-t for fun and profit (and other ant stuff)
 

 Key: CASSANDRA-3818
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3818
 Project: Cassandra
  Issue Type: Bug
  Components: Core, Packaging
Affects Versions: 1.0.7
Reporter: Eric Evans
Assignee: Eric Evans
Priority: Minor
  Labels: build
 Fix For: 1.1.7

 Attachments: 
 ASF.LICENSE.NOT.GRANTED--v1-0001-CASSANDRA-3818-keep-init-in-init-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0002-clean-up-avro-generation-dependencies-and-dependants.txt,
  
 ASF.LICENSE.NOT.GRANTED--v1-0003-remove-useless-build-subprojects-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0004-group-test-targets-under-test-all.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0005-add-property-to-disable-maven-junk.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0006-add-property-to-disable-rat-license-header-writing.txt,
  ASF.LICENSE.NOT.GRANTED--v1-0007-don-t-needlessly-regenerate-thrift-code.txt


 It should be possible to disable maven-ant-tasks for environments with more 
 rigid dependency control, or where network access isn't available.
 Patches to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-2388) ColumnFamilyRecordReader fails for a given split because a host is down, even if records could reasonably be read from other replica.

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501857#comment-13501857
 ] 

Jonathan Ellis commented on CASSANDRA-2388:
---

Jake's plan above seems like a reasonable approach, but let me back up a step.  
I'm just not convinced that the problem we're trying to solve is a real one.  
Why do we want to suck a split's worth of data off-node?  If it's because you 
don't have TackTrackers running on your Cassandra nodes, well, go fix that.

If it's because Hadoop has created too many tasks and all the local replicas 
have their task queue full, won't assigning it to a non-local TT just cause 
more contention, than waiting for a local slot to free up?

 ColumnFamilyRecordReader fails for a given split because a host is down, even 
 if records could reasonably be read from other replica.
 -

 Key: CASSANDRA-2388
 URL: https://issues.apache.org/jira/browse/CASSANDRA-2388
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 0.6
Reporter: Eldon Stegall
Assignee: Mck SembWever
Priority: Minor
  Labels: hadoop, inputformat
 Fix For: 1.1.7

 Attachments: 0002_On_TException_try_next_split.patch, 
 CASSANDRA-2388-addition1.patch, CASSANDRA-2388-extended.patch, 
 CASSANDRA-2388.patch, CASSANDRA-2388.patch, CASSANDRA-2388.patch, 
 CASSANDRA-2388.patch


 ColumnFamilyRecordReader only tries the first location for a given split. We 
 should try multiple locations for a given split.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4871) get_paged_slice does not obey SlicePredicate

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4871:
--

Issue Type: New Feature  (was: Improvement)

 get_paged_slice does not obey SlicePredicate
 

 Key: CASSANDRA-4871
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4871
 Project: Cassandra
  Issue Type: New Feature
  Components: API, Hadoop
Affects Versions: 1.1.6
Reporter: Scott Fines
 Fix For: 1.1.6

 Attachments: CASSANDRA-4816.patch


 When experimenting with WideRow support, I noticed that it is not possible to 
 specify a bounding SlicePredicate. This means that, no matter what you may 
 wish, the entire Column Family will be used during a get_paged_slice call. 
 This is unfortunate, if (for example) you are attempting to do MapReduce over 
 a subset of your column range.
 get_paged_slice should support a SlicePredicate, which will bound the column 
 range over which data is returned. It seems like this SlicePredicate should 
 be optional, so that existing code is not broken--when the SlicePredicate is 
 not specified, have it default to going over the entire column range.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: Fix overflow in SelectStatement.getLimit()

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2.0 b4f2f2014 - e39bf7a3d


Fix overflow in SelectStatement.getLimit()


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

Branch: refs/heads/cassandra-1.2.0
Commit: e39bf7a3df66a0062716632e6a3cd28ae1a633cb
Parents: b4f2f20
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:00 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:00 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e39bf7a3/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 44188de..5963e0e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -328,7 +328,9 @@ public class SelectStatement implements CQLStatement
 {
 // Internally, we don't support exclusive bounds for slices. Instead,
 // we query one more element if necessary and exclude
-return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START) ? parameters.limit + 1 : 
parameters.limit;
+return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START)  parameters.limit != 
Integer.MAX_VALUE
+ ? parameters.limit + 1
+ : parameters.limit;
 }
 
 private CollectionByteBuffer getKeys(final ListByteBuffer variables) 
throws InvalidRequestException



[1/2] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 3479c636b - 445c4fae9


Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: 445c4fae940e8fb79b91e289fe571c0e11e142ae
Parents: 3479c63 e39bf7a
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:23 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:23 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--




[2/2] git commit: Fix overflow in SelectStatement.getLimit()

2012-11-21 Thread slebresne
Fix overflow in SelectStatement.getLimit()


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

Branch: refs/heads/cassandra-1.2
Commit: e39bf7a3df66a0062716632e6a3cd28ae1a633cb
Parents: b4f2f20
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:00 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:00 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e39bf7a3/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 44188de..5963e0e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -328,7 +328,9 @@ public class SelectStatement implements CQLStatement
 {
 // Internally, we don't support exclusive bounds for slices. Instead,
 // we query one more element if necessary and exclude
-return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START) ? parameters.limit + 1 : 
parameters.limit;
+return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START)  parameters.limit != 
Integer.MAX_VALUE
+ ? parameters.limit + 1
+ : parameters.limit;
 }
 
 private CollectionByteBuffer getKeys(final ListByteBuffer variables) 
throws InvalidRequestException



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

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/trunk 86447b7df - e15664d08


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: e15664d081a916bfdd4af6afee352b1c3cc5ac5a
Parents: 86447b7 445c4fa
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:38 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:38 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--




[3/3] git commit: Fix overflow in SelectStatement.getLimit()

2012-11-21 Thread slebresne
Fix overflow in SelectStatement.getLimit()


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

Branch: refs/heads/trunk
Commit: e39bf7a3df66a0062716632e6a3cd28ae1a633cb
Parents: b4f2f20
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:00 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:00 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e39bf7a3/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 44188de..5963e0e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -328,7 +328,9 @@ public class SelectStatement implements CQLStatement
 {
 // Internally, we don't support exclusive bounds for slices. Instead,
 // we query one more element if necessary and exclude
-return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START) ? parameters.limit + 1 : 
parameters.limit;
+return sliceRestriction != null  
!sliceRestriction.isInclusive(Bound.START)  parameters.limit != 
Integer.MAX_VALUE
+ ? parameters.limit + 1
+ : parameters.limit;
 }
 
 private CollectionByteBuffer getKeys(final ListByteBuffer variables) 
throws InvalidRequestException



[2/3] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: 445c4fae940e8fb79b91e289fe571c0e11e142ae
Parents: 3479c63 e39bf7a
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 12:38:23 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 12:38:23 2012 +0100

--
 .../cassandra/cql3/statements/SelectStatement.java |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
--




[jira] [Updated] (CASSANDRA-4871) get_paged_slice does not obey SlicePredicate

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4871:
--

 Reviewer: pkolaczk
 Priority: Minor  (was: Major)
Affects Version/s: (was: 1.1.6)
   1.1.0
Fix Version/s: (was: 1.1.6)
   1.3

 get_paged_slice does not obey SlicePredicate
 

 Key: CASSANDRA-4871
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4871
 Project: Cassandra
  Issue Type: New Feature
  Components: API, Hadoop
Affects Versions: 1.1.0
Reporter: Scott Fines
Priority: Minor
 Fix For: 1.3

 Attachments: CASSANDRA-4816.patch


 When experimenting with WideRow support, I noticed that it is not possible to 
 specify a bounding SlicePredicate. This means that, no matter what you may 
 wish, the entire Column Family will be used during a get_paged_slice call. 
 This is unfortunate, if (for example) you are attempting to do MapReduce over 
 a subset of your column range.
 get_paged_slice should support a SlicePredicate, which will bound the column 
 range over which data is returned. It seems like this SlicePredicate should 
 be optional, so that existing code is not broken--when the SlicePredicate is 
 not specified, have it default to going over the entire column range.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4705) Speculative execution for CL_ONE

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501877#comment-13501877
 ] 

Jonathan Ellis commented on CASSANDRA-4705:
---

avro is just used for upgrading from 1.0 schemas, so shouldn't need to touch 
that anymore.

Would it make more sense to have getReadLatencyRate and UpdateSampleLatencies 
into SR?  that way we could replace case statements with polymorphism.

Can you split the AbstractReadExecutor refactor out from the speculative 
execution code?  That would make it easier to isolate the changes in review.

Why does preprocess return a boolean now?

How does/should SR interact with RR?  Using ALL + RRR means we're probably 
going to do a lot of unnecessary repair writes in a high-update environment 
(i.e., it would be normal for one replica to be slightly behind others on a 
read), which is probably not what we want.  Also unclear to me what happens 
when we use RDR and do a SR when we've also requested extra digests for RR, and 
we get a data read and a digest from the same replica.

 Speculative execution for CL_ONE
 

 Key: CASSANDRA-4705
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4705
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.2.0
Reporter: Vijay
Assignee: Vijay
Priority: Minor
 Attachments: 0001-CASSANDRA-4705.patch, 0001-CASSANDRA-4705-v2.patch


 When read_repair is not 1.0, we send the request to one node for some of the 
 requests. When a node goes down or when a node is too busy the client has to 
 wait for the timeout before it can retry. 
 It would be nice to watch for latency and execute an additional request to a 
 different node, if the response is not received within average/99% of the 
 response times recorded in the past.
 CASSANDRA-2540 might be able to solve the variance when read_repair is set to 
 1.0
 1) May be we need to use metrics-core to record various Percentiles
 2) Modify ReadCallback.get to execute additional request speculatively.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4886) Remote ColumnFamilyInputFormat

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501879#comment-13501879
 ] 

Jonathan Ellis commented on CASSANDRA-4886:
---

Very confused.  What problem are you solving that 2388 would not solve, 
assuming someone implemented Jake's proposal?  What difference in behavior are 
you proposing for local vs non-local, and who chooses which behavior CFRR uses?

 Remote ColumnFamilyInputFormat
 --

 Key: CASSANDRA-4886
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4886
 Project: Cassandra
  Issue Type: Improvement
  Components: Hadoop
Affects Versions: 1.1.6
Reporter: Scott Fines
 Fix For: 1.1.6

 Attachments: CASSANDRA-4886.patch


 As written, the ColumnFamilyInputFormat does not have a great deal of fault 
 tolerance. 
 It only attempts to perform a read from a single replica, with an infinite 
 timeout. If that replica is not available, then the Task fails, and must be 
 retried on a different node.
 This is fine if the TaskTrackers are colocated with Cassandra nodes, but is 
 very fragile when this is not possible. When the Tasktrackers are remote to 
 cassandra, the same rules about clients should apply--there should be a 
 strict (configurable) timeout, and the ability to retry requests on a 
 different replica if at single request fails. 
 It seems obvious that we'd want to support both types of architecture; to do 
 that, we should probably have a configuration which allows the user to 
 specify his architecture choices explicitely.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4899) add gitignore

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4899:
--

Reviewer: brandon.williams
Priority: Trivial  (was: Major)

 add gitignore
 -

 Key: CASSANDRA-4899
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4899
 Project: Cassandra
  Issue Type: Task
Reporter: Radim Kolar
Assignee: Radim Kolar
Priority: Trivial
 Attachments: cass-gitignore.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4897) Allow tiered compaction define max sstable size

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501878#comment-13501878
 ] 

Jonathan Ellis commented on CASSANDRA-4897:
---

Ben Coverston commented on the mailing list,

bq. it appears that it will cause an infinite compaction loop if you get more 
than 4 SSTables at max size.

I respectfully decline your gracious invitation to fix it myself.

 Allow tiered compaction define max sstable size
 ---

 Key: CASSANDRA-4897
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4897
 Project: Cassandra
  Issue Type: Improvement
Reporter: Radim Kolar
 Attachments: cass-maxsize1.txt, cass-maxsize2.txt


 Lucene is doing same thing. Correctly configured max segment size will 
 recycle old data faster with less diskspace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4803) CFRR wide row iterators improvements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501886#comment-13501886
 ] 

Jonathan Ellis commented on CASSANDRA-4803:
---

Without trying it, I think it would be TApplicationException.WRONG_METHOD_NAME.

 CFRR wide row iterators improvements
 

 Key: CASSANDRA-4803
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4803
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 1.1.0
Reporter: Piotr Kołaczkowski
Assignee: Piotr Kołaczkowski
 Fix For: 1.1.7

 Attachments: 
 0004-Better-token-range-wrap-around-handling-in-CFIF-CFRR.patch, 
 0006-Code-cleanup-refactoring-in-CFRR.-Fixed-bug-with-mis.patch, 
 0007-Fallback-to-describe_splits-in-case-describe_splits_.patch


 {code}
  public float getProgress()
 {
 // TODO this is totally broken for wide rows
 // the progress is likely to be reported slightly off the actual but 
 close enough
 float progress = ((float) iter.rowsRead() / totalRowCount);
 return progress  1.0F ? 1.0F : progress;
 }
 {code}
 The problem is iter.rowsRead() does not return the number of rows read from 
 the wide row iterator, but returns number of *columns* (every row is counted 
 multiple times). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4803) CFRR wide row iterators improvements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501885#comment-13501885
 ] 

Jonathan Ellis commented on CASSANDRA-4803:
---

Is there a more specific exception we can catch besides TException?

 CFRR wide row iterators improvements
 

 Key: CASSANDRA-4803
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4803
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 1.1.0
Reporter: Piotr Kołaczkowski
Assignee: Piotr Kołaczkowski
 Fix For: 1.1.7

 Attachments: 
 0004-Better-token-range-wrap-around-handling-in-CFIF-CFRR.patch, 
 0006-Code-cleanup-refactoring-in-CFRR.-Fixed-bug-with-mis.patch, 
 0007-Fallback-to-describe_splits-in-case-describe_splits_.patch


 {code}
  public float getProgress()
 {
 // TODO this is totally broken for wide rows
 // the progress is likely to be reported slightly off the actual but 
 close enough
 float progress = ((float) iter.rowsRead() / totalRowCount);
 return progress  1.0F ? 1.0F : progress;
 }
 {code}
 The problem is iter.rowsRead() does not return the number of rows read from 
 the wide row iterator, but returns number of *columns* (every row is counted 
 multiple times). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3974) Per-CF TTL

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501891#comment-13501891
 ] 

Jonathan Ellis commented on CASSANDRA-3974:
---

Set to open: because patch has been reviewed, no need for it to keep showing up 
in Patch Available until there is a new one.

Target version 1.3: because we missed the window to make 1.2.0rc1.

 Per-CF TTL
 --

 Key: CASSANDRA-3974
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3974
 Project: Cassandra
  Issue Type: New Feature
Affects Versions: 1.2.0 beta 1
Reporter: Jonathan Ellis
Assignee: Kirk True
Priority: Minor
 Fix For: 1.3

 Attachments: 3974-v8.txt, trunk-3974.txt, trunk-3974v2.txt, 
 trunk-3974v3.txt, trunk-3974v4.txt, trunk-3974v5.txt, trunk-3974v6.txt, 
 trunk-3974v7.txt


 Per-CF TTL would allow compaction optimizations (drop an entire sstable's 
 worth of expired data) that we can't do with per-column.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3017) add a Message size limit

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501892#comment-13501892
 ] 

Jonathan Ellis commented on CASSANDRA-3017:
---

Well, make it a megabyte then... still adequate to protect against accidental 
OOM.

 add a Message size limit
 

 Key: CASSANDRA-3017
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3017
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Jonathan Ellis
Assignee: Kirk True
Priority: Minor
  Labels: lhf
 Attachments: 
 0001-use-the-thrift-max-message-size-for-inter-node-messa.patch, 
 trunk-3017.txt


 We protect the server from allocating huge buffers for malformed message with 
 the Thrift frame size (CASSANDRA-475).  But we don't have similar protection 
 for the inter-node Message objects.
 Adding this would be good to deal with malicious adversaries as well as a 
 malfunctioning cluster participant.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (CASSANDRA-4446) nodetool drain sometimes doesn't mark commitlog fully flushed

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis resolved CASSANDRA-4446.
---

Resolution: Won't Fix

This is going to stand as a known limitation with 1.0.x; so far it looks like 
it is fixed in latest 1.1.

 nodetool drain sometimes doesn't mark commitlog fully flushed
 -

 Key: CASSANDRA-4446
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4446
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.0.10
 Environment: ubuntu 10.04 64bit
 Linux HOSTNAME 2.6.32-345-ec2 #48-Ubuntu SMP Wed May 2 19:29:55 UTC 2012 
 x86_64 GNU/Linux
 sun JVM
 cassandra 1.0.10 installed from apache deb
Reporter: Robert Coli
 Attachments: 
 cassandra.1.0.10.replaying.log.after.exception.during.drain.txt


 I recently wiped a customer's QA cluster. I drained each node and verified 
 that they were drained. When I restarted the nodes, I saw the commitlog 
 replay create a memtable and then flush it. I have attached a sanitized log 
 snippet from a representative node at the time. 
 It appears to show the following :
 1) Drain begins
 2) Drain triggers flush
 3) Flush triggers compaction
 4) StorageService logs DRAINED message
 5) compaction thread excepts
 6) on restart, same CF creates a memtable
 7) and then flushes it [1]
 The columnfamily involved in the replay in 7) is the CF for which the 
 compaction thread excepted in 5). This seems to suggest a timing issue 
 whereby the exception in 5) prevents the flush in 3) from marking all the 
 segments flushed, causing them to replay after restart.
 In case it might be relevant, I did an online change of compaction strategy 
 from Leveled to SizeTiered during the uptime period preceding this drain.
 [1] Isn't commitlog replay not supposed to automatically trigger a flush in 
 modern cassandra?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4430) optional pluggable o.a.c.metrics reporters

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501897#comment-13501897
 ] 

Jonathan Ellis commented on CASSANDRA-4430:
---

Not quite sure what to make of that last comment tbh. :)

 optional pluggable o.a.c.metrics reporters
 --

 Key: CASSANDRA-4430
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4430
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Chris Burroughs
Priority: Minor

 CASSANDRA-4009  expanded the use of the metrics library which has a set of 
 reporter modules http://metrics.codahale.com/manual/core/#reporters  You can 
 report to flat files, ganglia, spit everything over http, etc.  The next step 
 is a mechanism for using those reporters with  o.a.c.metrics.  To avoid 
 bundling everything I suggest following the mx4j approach of enable only if 
 on classpath coupled with a reporter configuration file.
 Strawman file:
 {noformat}
 console:
   time: 1
   timeunit: seconds
 csv:
  - time: 1
timeunit: minutes
file: foo.csv
  - time: 10
timeunit: seconds
 file: bar.csv
 ganglia:
  - time: 30
timunit: seconds
host: server-1
port: 8649
  - time: 30
timunit: seconds
host: server-2
port: 8649
 {noformat}
  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4877) Range queries return fewer result after a lot of delete

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501900#comment-13501900
 ] 

Jonathan Ellis commented on CASSANDRA-4877:
---

+1

 Range queries return fewer result after a lot of delete
 ---

 Key: CASSANDRA-4877
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4877
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 1
Reporter: julien campan
Assignee: Sylvain Lebresne
 Fix For: 1.2.0 rc1

 Attachments: 0001-4877.patch, 
 0002-Rename-maxIsColumns-to-countCQL3Rows.patch


 Hi, I'm testing on the trunk version
 I'm using : [cqlsh 2.3.0 | Cassandra 1.2.0-beta1-SNAPSHOT | CQL spec 3.0.0 | 
 Thrift protocol 19.35.0]
 My use case is :
 I create a table
 CREATE TABLE premier (
 id int PRIMARY KEY,
 value int
 ) WITH
 comment='' AND
 caching='KEYS_ONLY' AND
 read_repair_chance=0.10 AND
 dclocal_read_repair_chance=0.00 AND
 gc_grace_seconds=864000 AND
 replicate_on_write='true' AND
 compression={'sstable_compression': 'SnappyCompressor'};
 1) I insert 10 000 000 rows (they are like id = 1 and value =1)
 2) I delete 2 000 000 rows (i use random method to choose the key value)
 3) I do select * from premier ; and my result is 7944 instead of 10 000.
 4) if if do select * from premier limit 2 ; my result is 15839 .
 So after a lot of delete, the range operator is not working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4655) Truncate operation doesn't delete rows from HintsColumnFamily.

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4655:
--

Assignee: (was: Alexey Zotov)

 Truncate operation doesn't delete rows from HintsColumnFamily.
 --

 Key: CASSANDRA-4655
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4655
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Affects Versions: 0.7.0
 Environment: Centos 6.2, Cassandra 1.1.4 (DataStax distribution), 
 three-nodes cluster.
Reporter: Alexey Zotov
Priority: Minor
  Labels: hintedhandoff, truncate
 Fix For: 1.2.1

 Attachments: cassandra-1.2-4655-hints_truncation.txt


 Steps to reproduce:
 1. Start writing of data to some column family, let name it 'MyCF'
 2. Stop 1 node
 3. Wait some time (until some data will be collected in HintsColumnFamily)
 4. Start node (HintedHandoff will be started automatically for 'MyCF')
 5. Run 'truncate' command for 'MyCF' column family from command from cli
 6. Wait until truncate will be finished
 7. You will see that 'MyCF' is not empty because HintedHandoff is copying 
 data 
 So, I suggest to clean HintsColumnFamily (for truncated column family) before 
 we had started to discard sstables. 
 I think it should be done in CompactionManager#submitTrucate() method. I can 
 try to create patch but I need to know right way of cleaning 
 HintsColumnFamily. Could you clarify it?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501917#comment-13501917
 ] 

Jonathan Ellis commented on CASSANDRA-4874:
---

You're overthinking it.  You still have that problem with fine-grained grant, 
it's just more complex.  Nor does include user with GRANT as a user with LIST 
make sense, because if you want to include users who could POTENTIALLY have 
grant, well, a user with GRANT can give LIST to anyone, not just himself.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Comment Edited] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501917#comment-13501917
 ] 

Jonathan Ellis edited comment on CASSANDRA-4874 at 11/21/12 12:37 PM:
--

You're overthinking it.  You still have that problem with fine-grained grant, 
it's just more complex.  Nor does include user with GRANT as a user with LIST 
make sense, because if you want to include users who could POTENTIALLY have 
LIST, well, a user with GRANT can give LIST to anyone, not just himself.

  was (Author: jbellis):
You're overthinking it.  You still have that problem with fine-grained 
grant, it's just more complex.  Nor does include user with GRANT as a user 
with LIST make sense, because if you want to include users who could 
POTENTIALLY have grant, well, a user with GRANT can give LIST to anyone, not 
just himself.
  
 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501925#comment-13501925
 ] 

Aleksey Yeschenko commented on CASSANDRA-4874:
--

I probably am. I'll think about it.
But, to clarify - by LIST you meant ALTER, right?

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4897) Allow tiered compaction define max sstable size

2012-11-21 Thread Radim Kolar (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501924#comment-13501924
 ] 

Radim Kolar commented on CASSANDRA-4897:


it was fixed in patch version 2.

 Allow tiered compaction define max sstable size
 ---

 Key: CASSANDRA-4897
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4897
 Project: Cassandra
  Issue Type: Improvement
Reporter: Radim Kolar
 Attachments: cass-maxsize1.txt, cass-maxsize2.txt


 Lucene is doing same thing. Correctly configured max segment size will 
 recycle old data faster with less diskspace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501936#comment-13501936
 ] 

Jonathan Ellis commented on CASSANDRA-4874:
---

To match your example, yes.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501939#comment-13501939
 ] 

Aleksey Yeschenko commented on CASSANDRA-4874:
--

[~jbellis]
Now I do think you are more right than I am.
What do you think about this option: introduce Permission.AUTHORIZE. Let users 
with AUTHORIZE on a resource GRANT and REVOKE permissions on that resource 
to/from others, but only the permissions they already have (on that resource or 
its parent, recursively), including AUTHORIZE itself? I considered this before, 
but I did overthink it back then.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: Fix CQL3 limit

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2.0 e39bf7a3d - a32eb9f7d


Fix CQL3 limit

patch by slebresne; reviewed by jbellis for CASSANDRA-4877


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

Branch: refs/heads/cassandra-1.2.0
Commit: a32eb9f7d2f2868e8154d178e96e045859e1d855
Parents: e39bf7a
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:03:32 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:03:32 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index cdd651a..60e4c94 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,7 @@
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
+ * Fix CQL3 LIMIT (CASSANDRA-4877)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/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 5963e0e..4ae2b55 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -236,10 +236,7 @@ public class SelectStatement implements CQLStatement
 IDiskAtomFilter filter = makeFilter(variables);
 ListIndexExpression expressions = getIndexExpressions(variables);
 // The LIMIT provided by the user is the number of CQL row he wants 
returned.
-// For NamesQueryFilter, this is the number of internal rows returned, 
since a NamesQueryFilter can only select one CQL row in a given internal row.
-// For SliceQueryFilter however, we want to have getRangeSlice to 
count the number of columns, not the number of keys. Then
-// SliceQueryFilter.collectReducedColumns will correctly columns 
having the same composite prefix using ColumnCounter.
-boolean maxIsColumns = filter instanceof SliceQueryFilter;
+// We want to have getRangeSlice to count the number of columns, not 
the number of keys.
 return new RangeSliceCommand(keyspace(),
  columnFamily(),
  null,
@@ -247,7 +244,7 @@ public class SelectStatement implements CQLStatement
  getKeyBounds(variables),
  expressions,
  getLimit(),
- maxIsColumns,
+ true,
  false);
 }
 
@@ -320,7 +317,7 @@ public class SelectStatement implements CQLStatement
 {
 SortedSetByteBuffer columnNames = getRequestedColumns(variables);
 

[1/2] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 445c4fae9 - a4452eeb1


Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: a4452eeb168fd081100c633f9d2914c9c8aec48a
Parents: 445c4fa a32eb9f
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:04:19 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:04:19 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


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



[2/2] git commit: Fix CQL3 limit

2012-11-21 Thread slebresne
Fix CQL3 limit

patch by slebresne; reviewed by jbellis for CASSANDRA-4877


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

Branch: refs/heads/cassandra-1.2
Commit: a32eb9f7d2f2868e8154d178e96e045859e1d855
Parents: e39bf7a
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:03:32 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:03:32 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index cdd651a..60e4c94 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,7 @@
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
+ * Fix CQL3 LIMIT (CASSANDRA-4877)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/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 5963e0e..4ae2b55 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -236,10 +236,7 @@ public class SelectStatement implements CQLStatement
 IDiskAtomFilter filter = makeFilter(variables);
 ListIndexExpression expressions = getIndexExpressions(variables);
 // The LIMIT provided by the user is the number of CQL row he wants 
returned.
-// For NamesQueryFilter, this is the number of internal rows returned, 
since a NamesQueryFilter can only select one CQL row in a given internal row.
-// For SliceQueryFilter however, we want to have getRangeSlice to 
count the number of columns, not the number of keys. Then
-// SliceQueryFilter.collectReducedColumns will correctly columns 
having the same composite prefix using ColumnCounter.
-boolean maxIsColumns = filter instanceof SliceQueryFilter;
+// We want to have getRangeSlice to count the number of columns, not 
the number of keys.
 return new RangeSliceCommand(keyspace(),
  columnFamily(),
  null,
@@ -247,7 +244,7 @@ public class SelectStatement implements CQLStatement
  getKeyBounds(variables),
  expressions,
  getLimit(),
- maxIsColumns,
+ true,
  false);
 }
 
@@ -320,7 +317,7 @@ public class SelectStatement implements CQLStatement
 {
 SortedSetByteBuffer columnNames = getRequestedColumns(variables);
 QueryProcessor.validateColumnNames(columnNames);
-return new 

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

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/trunk e15664d08 - 6a0d02c76


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: 6a0d02c761cb19f8486ea1a1dd905843524bcdb3
Parents: e15664d a4452ee
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:04:30 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:04:30 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a0d02c7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
--



[3/3] git commit: Fix CQL3 limit

2012-11-21 Thread slebresne
Fix CQL3 limit

patch by slebresne; reviewed by jbellis for CASSANDRA-4877


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

Branch: refs/heads/trunk
Commit: a32eb9f7d2f2868e8154d178e96e045859e1d855
Parents: e39bf7a
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:03:32 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:03:32 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index cdd651a..60e4c94 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,7 @@
  * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
+ * Fix CQL3 LIMIT (CASSANDRA-4877)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a32eb9f7/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 5963e0e..4ae2b55 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -236,10 +236,7 @@ public class SelectStatement implements CQLStatement
 IDiskAtomFilter filter = makeFilter(variables);
 ListIndexExpression expressions = getIndexExpressions(variables);
 // The LIMIT provided by the user is the number of CQL row he wants 
returned.
-// For NamesQueryFilter, this is the number of internal rows returned, 
since a NamesQueryFilter can only select one CQL row in a given internal row.
-// For SliceQueryFilter however, we want to have getRangeSlice to 
count the number of columns, not the number of keys. Then
-// SliceQueryFilter.collectReducedColumns will correctly columns 
having the same composite prefix using ColumnCounter.
-boolean maxIsColumns = filter instanceof SliceQueryFilter;
+// We want to have getRangeSlice to count the number of columns, not 
the number of keys.
 return new RangeSliceCommand(keyspace(),
  columnFamily(),
  null,
@@ -247,7 +244,7 @@ public class SelectStatement implements CQLStatement
  getKeyBounds(variables),
  expressions,
  getLimit(),
- maxIsColumns,
+ true,
  false);
 }
 
@@ -320,7 +317,7 @@ public class SelectStatement implements CQLStatement
 {
 SortedSetByteBuffer columnNames = getRequestedColumns(variables);
 QueryProcessor.validateColumnNames(columnNames);
-return new 

[2/3] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: a4452eeb168fd081100c633f9d2914c9c8aec48a
Parents: 445c4fa a32eb9f
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 14:04:19 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 14:04:19 2012 +0100

--
 CHANGES.txt|1 +
 .../cassandra/cql3/statements/SelectStatement.java |   11 ++---
 .../cassandra/db/AbstractColumnContainer.java  |9 +--
 .../apache/cassandra/db/CollationController.java   |5 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |8 ++--
 .../org/apache/cassandra/db/RangeSliceCommand.java |   20 
 src/java/org/apache/cassandra/db/Row.java  |   11 ++--
 .../org/apache/cassandra/db/SliceQueryPager.java   |5 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   38 +++---
 .../cassandra/db/filter/IDiskAtomFilter.java   |   12 +++--
 .../cassandra/db/filter/NamesQueryFilter.java  |   41 ++-
 .../cassandra/db/filter/SliceQueryFilter.java  |   12 -
 .../cassandra/db/index/SecondaryIndexManager.java  |4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |2 +-
 .../db/index/composites/CompositesSearcher.java|8 ++--
 .../cassandra/db/index/keys/KeysSearcher.java  |4 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |4 +-
 .../cassandra/service/RowRepairResolver.java   |6 +-
 .../org/apache/cassandra/service/StorageProxy.java |   24 +
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |2 +-
 20 files changed, 139 insertions(+), 88 deletions(-)
--


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



[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501945#comment-13501945
 ] 

Aleksey Yeschenko commented on CASSANDRA-4874:
--

This will allow to get rid of grantOption and the permission checks in grant() 
and authorize() in IAuthority implementations. I'll just add two checks to 
grant statement and revokestatement: hasAccess(AUTHORIZE, resource) and 
hasAccees(permissiionToBeGratnedOrRevoked, resource).

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501946#comment-13501946
 ] 

Aleksey Yeschenko commented on CASSANDRA-4874:
--

Limiting it to the permissions you already have at least means that you won't 
be able to re-grant the revoked permission back to yourself on your own.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501949#comment-13501949
 ] 

Aleksey Yeschenko commented on CASSANDRA-4874:
--

I previously did overthink 2.2 in 
https://issues.apache.org/jira/browse/CASSANDRA-4874?focusedCommentId=13500289page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13500289
It's not really an escalation - these two users will still be limited to the 
permissions they collectively own. So 2.2 should actually work.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4899) add gitignore

2012-11-21 Thread Radim Kolar (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501990#comment-13501990
 ] 

Radim Kolar commented on CASSANDRA-4899:


.gitignore in tree is stardard used by pretty much every project. If somebody 
would like to get some more files ignored (like for IDEA IDE which i do not 
have) then he can submit patch. Its still less work then writing .gitignore by 
hand everytime you run checkout.

 add gitignore
 -

 Key: CASSANDRA-4899
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4899
 Project: Cassandra
  Issue Type: Task
Reporter: Radim Kolar
Assignee: Radim Kolar
Priority: Trivial
 Attachments: cass-gitignore.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-2388) ColumnFamilyRecordReader fails for a given split because a host is down, even if records could reasonably be read from other replica.

2012-11-21 Thread Scott Fines (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502016#comment-13502016
 ] 

Scott Fines commented on CASSANDRA-2388:


I have two distinct use-cases where running TaskTrackers alongside Cassandra 
nodes does not accomplish our goals:

1. Joining data. We have a large data set in cassandra, true, but we have a 
*much* larger data set held in Hadoop itself (around 4 orders of magnitude 
larger in hadoop than in cassandra). We need to join the two datasets together, 
and use the output from that join to feed multiple systems, none of which are 
cassandra. Since the data in Hadoop is so much larger than that in Cassandra, 
we have to bring the Cassandra data to hadoop, not the other way around. 
Because of security concerns, we can't spread our hadoop data onto our 
cassandra nodes (even if that didn't screw with our capacity planning), so we 
have no other choice but to move the Cassandra data (in small chunks) onto 
Hadoop. Why not use HBase, you say? We needed Cassandra for its write 
performance for other problems than this one. 

1. Offline, incremental backups. We have a large volume of time-series data 
held in Cassandra, and taking nightly snapshots and moving them to our archival 
center is prohibitively slow--it turns out that moving RF copies of our entire 
dataset over a leased line every night is a pretty bad idea. Instead, I use 
MapReduce to take an incremental backup of a much smaller subset of the data, 
then move that. That way, we not only are not moving the entire data set, but 
we are also using Cassandra's consistency mechanisms to resolve all the 
replicas. The only efficient way I've found to do this is via MapReduce (we use 
the Random Partitioner), and since it's an offline backup, we need to move it 
over the network anyway--may as well use the optimized network connecting 
Hadoop and Cassandra instead of the tiny pipe connecting cassandra to our 
archival center. 

Both of these reasons dictate that we *not* run a TT alongside our Cassandra 
nodes, no matter what the *recommended* approach is. In this case, we need a 
strong, fault-tolerant CFIF to serve our purposes.



 ColumnFamilyRecordReader fails for a given split because a host is down, even 
 if records could reasonably be read from other replica.
 -

 Key: CASSANDRA-2388
 URL: https://issues.apache.org/jira/browse/CASSANDRA-2388
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 0.6
Reporter: Eldon Stegall
Assignee: Mck SembWever
Priority: Minor
  Labels: hadoop, inputformat
 Fix For: 1.1.7

 Attachments: 0002_On_TException_try_next_split.patch, 
 CASSANDRA-2388-addition1.patch, CASSANDRA-2388-extended.patch, 
 CASSANDRA-2388.patch, CASSANDRA-2388.patch, CASSANDRA-2388.patch, 
 CASSANDRA-2388.patch


 ColumnFamilyRecordReader only tries the first location for a given split. We 
 should try multiple locations for a given split.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4886) Remote ColumnFamilyInputFormat

2012-11-21 Thread Scott Fines (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502027#comment-13502027
 ] 

Scott Fines commented on CASSANDRA-4886:


This patch creates a client abstraction for accessing Cassandra during MR 
activities. There are two versions of the Client--LocalClient and RemoteClient. 

The LocalClient behaves exactly as the current CFRR does--it sends all requests 
to a single node and fails if any of those requests fail. This is ideal for 
situations when the TT is running on the same node as Cassandra. 

The RemoteClient, on the other hand, allows thrift timeouts and other errors to 
occur without immediately failing the task. Instead, when certain exceptions 
are caught, it will try the same request on the next replica of that data, and 
only fail after it has tried all replicas for that data. This is ideal when 
circumstances force you to run TTs separately from Cassandra nodes.

The default Client is the LocalClient, to maintain backwards compatibility. To 
use the RemoteClient, one would have to call

{code}
ConfigHelper.useRemoteClient(conf,true);
{code}

This is only a little different in effect from what Jake is proposing in 
CASSANDRA-2388. The main difference here is that this patch forces the user to 
explicitly require a remote mode, and it requires no changes in the current 
server interface. The proposed pattern in CASSANDRA-2388 also makes no explicit 
mention of failure modes for off-node hadoop integration, which this patch is 
designed to manage. 

Both approaches suffer the same problems with multiple datacenters--the 
RemoteClient is even worse with multiple DCs, since it will try all replicas. 
The adjustment Jake proposes sounds like it will only affect the logic in 
constructing the replica list, which would be compatible with this patch's 
approach to fault-tolerance.


 Remote ColumnFamilyInputFormat
 --

 Key: CASSANDRA-4886
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4886
 Project: Cassandra
  Issue Type: Improvement
  Components: Hadoop
Affects Versions: 1.1.6
Reporter: Scott Fines
 Fix For: 1.1.6

 Attachments: CASSANDRA-4886.patch


 As written, the ColumnFamilyInputFormat does not have a great deal of fault 
 tolerance. 
 It only attempts to perform a read from a single replica, with an infinite 
 timeout. If that replica is not available, then the Task fails, and must be 
 retried on a different node.
 This is fine if the TaskTrackers are colocated with Cassandra nodes, but is 
 very fragile when this is not possible. When the Tasktrackers are remote to 
 cassandra, the same rules about clients should apply--there should be a 
 strict (configurable) timeout, and the ability to retry requests on a 
 different replica if at single request fails. 
 It seems obvious that we'd want to support both types of architecture; to do 
 that, we should probably have a configuration which allows the user to 
 specify his architecture choices explicitely.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (CASSANDRA-4979) Stress for cql3 is broken on 1.2/trunk

2012-11-21 Thread Sylvain Lebresne (JIRA)
Sylvain Lebresne created CASSANDRA-4979:
---

 Summary: Stress for cql3 is broken on 1.2/trunk
 Key: CASSANDRA-4979
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4979
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
 Fix For: 1.2.0 rc1




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4979) Stress for cql3 is broken on 1.2/trunk

2012-11-21 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne updated CASSANDRA-4979:


Attachment: 4979.txt

 Stress for cql3 is broken on 1.2/trunk
 --

 Key: CASSANDRA-4979
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4979
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
 Fix For: 1.2.0 rc1

 Attachments: 4979.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4874) Possible authorizaton handling impovements

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502042#comment-13502042
 ] 

Jonathan Ellis commented on CASSANDRA-4874:
---

bq. Limiting it to the permissions you already have at least means that you 
won't be able to re-grant the revoked permission back to yourself on your own.

Makes sense to me.

 Possible authorizaton handling impovements
 --

 Key: CASSANDRA-4874
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4874
 Project: Cassandra
  Issue Type: Improvement
Affects Versions: 1.1.6, 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
  Labels: security
 Fix For: 1.2.0 rc1

 Attachments: 4874-4875.txt, 4874-v2.txt, 4874-v3.txt, v1-v2.diff


 I'll create another issue with my suggestions about fixing/improving 
 IAuthority interfaces. This one lists possible improvements that aren't 
 related to grant/revoke methods.
 Inconsistencies:
 - CREATE COLUMNFAMILY: P.CREATE on the KS in CQL2 vs. P.CREATE on the CF in 
 CQL3 and Thrift
 - BATCH: P.UPDATE or P.DELETE on CF in CQL2 vs. P.UPDATE in CQL3 and Thrift 
 (despite remove* in Thrift asking for P.DELETE)
 - DELETE: P.DELETE in CQL2 and Thrift vs. P.UPDATE in CQL3
 - DROP INDEX: no checks in CQL2 vs. P.ALTER on the CF in CQL3
 Other issues/suggestions
 - CQL2 DROP INDEX should require authorization
 - current permission checks are inconsistent since they are performed 
 separately by CQL2 query processor, Thrift CassandraServer and CQL3 statement 
 classes.
 We should move it to one place. SomeClassWithABetterName.authorize(Operation, 
 KS, CF, User), where operation would be a enum
 (ALTER_KEYSPACE, ALTER_TABLE, CREATE_TABLE, CREATE, USE, UPDATE etc.), CF 
 should be nullable.
 - we don't respect the hierarchy when checking for permissions, or, to be 
 more specific, we are doing it wrong. take  CQL3 INSERT as an example:
 we require P.UPDATE on the CF or FULL_ACCESS on either KS or CF. However, 
 having P.UPDATE on the KS won't allow you to perform the statement, only 
 FULL_ACCESS will do.
 I doubt this was intentional, and if it was, I say it's wrong. P.UPDATE on 
 the KS should allow you to do updates on KS's cfs.
 Examples in 
 http://www.datastax.com/dev/blog/dynamic-permission-allocation-in-cassandra-1-1
  point to it being a bug, since REVOKE UPDATE ON ks FROM omega is there.
 - currently we lack a way to set permission on cassandra/keyspaces resource. 
 I think we should be able to do it. See the following point on why.
 - currently to create a keyspace you must have a P.CREATE permission on that 
 keyspace THAT DOESN'T EVEN EXIST YET. So only a superuser can create a 
 keyspace,
 or a superuser must first grant you a permission to create it. Which doesn't 
 look right to me. P.CREATE on cassandra/keyspaces should allow you to create 
 new
 keyspaces without an explicit permission for each of them.
 - same goes for CREATE TABLE. you need P.CREATE on that not-yet-existing CF 
 of FULL_ACCESS on the whole KS. P.CREATE on the KS won't do. this is wrong.
 - since permissions don't map directly to statements, we should describe 
 clearly in the documentation what permissions are required by what cql 
 statement/thrift method.
 Full list of current permission requirements: https://gist.github.com/3978182

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4753) Timeout reporter writes hints for the local node

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4753:
--

 Reviewer: iamaleksey  (was: jbellis)
Fix Version/s: (was: 1.2.0)
   1.2.1
 Assignee: Jonathan Ellis  (was: Aleksey Yeschenko)

 Timeout reporter writes hints for the local node
 

 Key: CASSANDRA-4753
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4753
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Jonathan Ellis
 Fix For: 1.2.1

 Attachments: 4753.txt, 4753-v2.txt, 4753-v3.txt


 MessagingService.java:330 calls StorageProxy.scheduleLocalHint() without 
 checking if the local node is the target. This causes 
 StorageProxy.scheduleLocalHint to throw AssertionError sometimes.
 Got this error when some batches are timed out. This can happen because even 
 local batches now go through StorageProxy.sendMessages and aren't just 
 rm.apply()'d.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4753) Timeout reporter writes hints for the local node

2012-11-21 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-4753:
--

Priority: Minor  (was: Major)

 Timeout reporter writes hints for the local node
 

 Key: CASSANDRA-4753
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4753
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 1
Reporter: Aleksey Yeschenko
Assignee: Jonathan Ellis
Priority: Minor
 Fix For: 1.2.1

 Attachments: 4753.txt, 4753-v2.txt, 4753-v3.txt


 MessagingService.java:330 calls StorageProxy.scheduleLocalHint() without 
 checking if the local node is the target. This causes 
 StorageProxy.scheduleLocalHint to throw AssertionError sometimes.
 Got this error when some batches are timed out. This can happen because even 
 local batches now go through StorageProxy.sendMessages and aren't just 
 rm.apply()'d.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4979) Stress for cql3 is broken on 1.2/trunk

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502056#comment-13502056
 ] 

Jonathan Ellis commented on CASSANDRA-4979:
---

It's actually broken pretty deeply...  it gives explicit names to each cell for 
instance, when the more natural way to interpret make me a row with 100,000 
cells is to make a wide row for slicing.

OTOH I could understand wanting to test explicit name queries on 5-cell rows.  
Not sure how to generalize both, I think we might need more options. :(

 Stress for cql3 is broken on 1.2/trunk
 --

 Key: CASSANDRA-4979
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4979
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
 Fix For: 1.2.0 rc1

 Attachments: 4979.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4979) Stress for cql3 is broken on 1.2/trunk

2012-11-21 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502062#comment-13502062
 ] 

Sylvain Lebresne commented on CASSANDRA-4979:
-

Yes, cql3 support by stress is funky. It also only ever test compact storage, 
so it would be good to also allow testing compact storage. It would also make 
sense to allow testing the binary protocol, but the current code has thrift 
hardcoded in quite a few places. Lastly, the code is littered with code 
repetition. So imho, we should refactor the hell out of it.

But the code we have now doesn't even run with the -L3 option, and that's what 
this patch fixes.

 Stress for cql3 is broken on 1.2/trunk
 --

 Key: CASSANDRA-4979
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4979
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
 Fix For: 1.2.0 rc1

 Attachments: 4979.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4979) Stress for cql3 is broken on 1.2/trunk

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502097#comment-13502097
 ] 

Jonathan Ellis commented on CASSANDRA-4979:
---

+1

 Stress for cql3 is broken on 1.2/trunk
 --

 Key: CASSANDRA-4979
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4979
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
 Fix For: 1.2.0 rc1

 Attachments: 4979.txt




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: Fix stress for CQL3

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2.0 a32eb9f7d - e2df26b89


Fix stress for CQL3

patch by slebresne; reviewed by jbellis for CASSANDRA-4979


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

Branch: refs/heads/cassandra-1.2.0
Commit: e2df26b899d07edbacedd0a6722bc940fc48b65b
Parents: a32eb9f
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:24:36 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:24:36 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 60e4c94..da74896 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,7 @@
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
  * Fix CQL3 LIMIT (CASSANDRA-4877)
+ * Fix Stress for CQL3 (CASSANDRA-4979)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/Session.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/Session.java 
b/tools/stress/src/org/apache/cassandra/stress/Session.java
index 8b6914c..ac109a1 100644
--- a/tools/stress/src/org/apache/cassandra/stress/Session.java
+++ b/tools/stress/src/org/apache/cassandra/stress/Session.java
@@ -665,7 +665,7 @@ public class Session implements Serializable
 client.set_cql_version(3.0.0); // just to create counter cf for 
cql3
 
 client.set_keyspace(KEYSPACE_NAME);
-client.execute_cql_query(createCounterCFStatementForCQL3(), 
Compression.NONE);
+client.execute_cql3_query(createCounterCFStatementForCQL3(), 
Compression.NONE, ConsistencyLevel.ONE);
 
 if (enable_cql)
 client.set_cql_version(cqlVersion);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/StressAction.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java 
b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
index 1227fe8..b5a7e6e 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
@@ -235,7 +235,6 @@ public class StressAction extends Thread
 System.exit(-1);
 }
 
-
 output.println(e.getMessage());
 returnCode = StressAction.FAILURE;
 break;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
index 7ca4b0f..3dfd33e 100644
--- 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
+++ 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
@@ -50,10 +50,12 @@ public class CqlCounterAdder extends Operation
 {
 String counterCF = session.cqlVersion.startsWith(2) ? Counter1 
: Counter3;
 
-StringBuilder query = new StringBuilder(UPDATE 
).append(wrapInQuotesIfRequired(counterCF))
-  .append( USING 
CONSISTENCY )
-  
.append(session.getConsistencyLevel())
-   

[2/2] git commit: Fix stress for CQL3

2012-11-21 Thread slebresne
Fix stress for CQL3

patch by slebresne; reviewed by jbellis for CASSANDRA-4979


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

Branch: refs/heads/cassandra-1.2
Commit: e2df26b899d07edbacedd0a6722bc940fc48b65b
Parents: a32eb9f
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:24:36 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:24:36 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 60e4c94..da74896 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,7 @@
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
  * Fix CQL3 LIMIT (CASSANDRA-4877)
+ * Fix Stress for CQL3 (CASSANDRA-4979)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/Session.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/Session.java 
b/tools/stress/src/org/apache/cassandra/stress/Session.java
index 8b6914c..ac109a1 100644
--- a/tools/stress/src/org/apache/cassandra/stress/Session.java
+++ b/tools/stress/src/org/apache/cassandra/stress/Session.java
@@ -665,7 +665,7 @@ public class Session implements Serializable
 client.set_cql_version(3.0.0); // just to create counter cf for 
cql3
 
 client.set_keyspace(KEYSPACE_NAME);
-client.execute_cql_query(createCounterCFStatementForCQL3(), 
Compression.NONE);
+client.execute_cql3_query(createCounterCFStatementForCQL3(), 
Compression.NONE, ConsistencyLevel.ONE);
 
 if (enable_cql)
 client.set_cql_version(cqlVersion);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/StressAction.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java 
b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
index 1227fe8..b5a7e6e 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
@@ -235,7 +235,6 @@ public class StressAction extends Thread
 System.exit(-1);
 }
 
-
 output.println(e.getMessage());
 returnCode = StressAction.FAILURE;
 break;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
index 7ca4b0f..3dfd33e 100644
--- 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
+++ 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
@@ -50,10 +50,12 @@ public class CqlCounterAdder extends Operation
 {
 String counterCF = session.cqlVersion.startsWith(2) ? Counter1 
: Counter3;
 
-StringBuilder query = new StringBuilder(UPDATE 
).append(wrapInQuotesIfRequired(counterCF))
-  .append( USING 
CONSISTENCY )
-  
.append(session.getConsistencyLevel())
-  .append( SET );
+

[1/2] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 a4452eeb1 - a9deba211


Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: a9deba21100388f605f9373386d71567a069d5ef
Parents: a4452ee e2df26b
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:25:20 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:25:20 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


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



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

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/trunk 6a0d02c76 - 3bd353f91


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: 3bd353f91a0c29c9f488b6e9bcd33373348daa1e
Parents: 6a0d02c a9deba2
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:25:35 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:25:35 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


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



[2/3] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: a9deba21100388f605f9373386d71567a069d5ef
Parents: a4452ee e2df26b
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:25:20 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:25:20 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


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



[3/3] git commit: Fix stress for CQL3

2012-11-21 Thread slebresne
Fix stress for CQL3

patch by slebresne; reviewed by jbellis for CASSANDRA-4979


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

Branch: refs/heads/trunk
Commit: e2df26b899d07edbacedd0a6722bc940fc48b65b
Parents: a32eb9f
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 17:24:36 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 17:24:36 2012 +0100

--
 CHANGES.txt|1 +
 .../src/org/apache/cassandra/stress/Session.java   |2 +-
 .../org/apache/cassandra/stress/StressAction.java  |1 -
 .../stress/operations/CqlCounterAdder.java |   21 +
 .../stress/operations/CqlCounterGetter.java|   23 +--
 .../stress/operations/CqlIndexedRangeSlicer.java   |   18 +--
 .../cassandra/stress/operations/CqlInserter.java   |   19 +---
 .../stress/operations/CqlRangeSlicer.java  |   20 +
 .../cassandra/stress/operations/CqlReader.java |   17 ---
 9 files changed, 84 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 60e4c94..da74896 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,7 @@
  * Remove select arbitrary limit (CASSANDRA-4918)
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
  * Fix CQL3 LIMIT (CASSANDRA-4877)
+ * Fix Stress for CQL3 (CASSANDRA-4979)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/Session.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/Session.java 
b/tools/stress/src/org/apache/cassandra/stress/Session.java
index 8b6914c..ac109a1 100644
--- a/tools/stress/src/org/apache/cassandra/stress/Session.java
+++ b/tools/stress/src/org/apache/cassandra/stress/Session.java
@@ -665,7 +665,7 @@ public class Session implements Serializable
 client.set_cql_version(3.0.0); // just to create counter cf for 
cql3
 
 client.set_keyspace(KEYSPACE_NAME);
-client.execute_cql_query(createCounterCFStatementForCQL3(), 
Compression.NONE);
+client.execute_cql3_query(createCounterCFStatementForCQL3(), 
Compression.NONE, ConsistencyLevel.ONE);
 
 if (enable_cql)
 client.set_cql_version(cqlVersion);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/StressAction.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java 
b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
index 1227fe8..b5a7e6e 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
@@ -235,7 +235,6 @@ public class StressAction extends Thread
 System.exit(-1);
 }
 
-
 output.println(e.getMessage());
 returnCode = StressAction.FAILURE;
 break;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2df26b8/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
index 7ca4b0f..3dfd33e 100644
--- 
a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
+++ 
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
@@ -50,10 +50,12 @@ public class CqlCounterAdder extends Operation
 {
 String counterCF = session.cqlVersion.startsWith(2) ? Counter1 
: Counter3;
 
-StringBuilder query = new StringBuilder(UPDATE 
).append(wrapInQuotesIfRequired(counterCF))
-  .append( USING 
CONSISTENCY )
-  
.append(session.getConsistencyLevel())
-  .append( SET );
+StringBuilder query 

[jira] [Created] (CASSANDRA-4980) StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch

2012-11-21 Thread Yuki Morishita (JIRA)
Yuki Morishita created CASSANDRA-4980:
-

 Summary: StorageServiceClientTest/RecoveryManager2Test fail on 
1.2.0 and above branch
 Key: CASSANDRA-4980
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4980
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Yuki Morishita


Looks like change in c4cca2d8bba20a7651b956e1893727391bf5f10a (store 
schema_version to system.local) broke both StorageServiceClientTest and 
RecoveryManager2Test.
StorageServiceClientTest assert data directories are not created in client mode 
but this change actually creates data directories. RecoveryManager2Test fails 
with junit.framework.AssertionFailedError: Expecting only 1 replayed mutation, 
got 10 error and I think extra commit log also comes from this insert to 
system.local.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4980) StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502121#comment-13502121
 ] 

Jonathan Ellis commented on CASSANDRA-4980:
---

My vote would be to revert c4cca2 for 1.2.0 and try again for 1.2.1.  
[~slebresne]?

 StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch
 

 Key: CASSANDRA-4980
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4980
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Yuki Morishita

 Looks like change in c4cca2d8bba20a7651b956e1893727391bf5f10a (store 
 schema_version to system.local) broke both StorageServiceClientTest and 
 RecoveryManager2Test.
 StorageServiceClientTest assert data directories are not created in client 
 mode but this change actually creates data directories. RecoveryManager2Test 
 fails with junit.framework.AssertionFailedError: Expecting only 1 replayed 
 mutation, got 10 error and I think extra commit log also comes from this 
 insert to system.local.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (CASSANDRA-4981) Error when starting a node with vnodes while counter-add operations underway

2012-11-21 Thread Tyler Patterson (JIRA)
Tyler Patterson created CASSANDRA-4981:
--

 Summary: Error when starting a node with vnodes while counter-add 
operations underway
 Key: CASSANDRA-4981
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4981
 Project: Cassandra
  Issue Type: Bug
 Environment: 2-node cluster on ec2, ubuntu, cassandra-1.2.0 commit 
a32eb9f7d2f2868e8154d178e96e045859e1d855
Reporter: Tyler Patterson


Start both nodes, start stress on one node like this: cassandra-stress 
--replication-factor=2 --operation=COUNTER_ADD

While that is running: On the other node, kill cassandra, wait for nodetool 
status to show the node as down, and restart cassandra. I sometimes have to 
kill and restart cassandra several times to get the problem to happen.

{code}
ERROR 15:39:33,198 Exception in thread Thread[MutationStage:16,5,main]
java.lang.AssertionError
at 
org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:748)
at 
org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:762)
at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:95)
at 
org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:2426)
at 
org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:396)
at 
org.apache.cassandra.service.StorageProxy.applyCounterMutationOnLeader(StorageProxy.java:755)
at 
org.apache.cassandra.db.CounterMutationVerbHandler.doVerb(CounterMutationVerbHandler.java:53)
at 
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4981) Error when starting a node with vnodes while counter-add operations underway

2012-11-21 Thread Tyler Patterson (JIRA)

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

Tyler Patterson updated CASSANDRA-4981:
---

Description: 
Start both nodes, start stress on one node like this: cassandra-stress 
--replication-factor=2 --operation=COUNTER_ADD

While that is running: On the other node, kill cassandra, wait for nodetool 
status to show the node as down, and restart cassandra. I sometimes have to 
kill and restart cassandra several times to get the problem to happen.

I get this error several times in the log:

{code}
ERROR 15:39:33,198 Exception in thread Thread[MutationStage:16,5,main]
java.lang.AssertionError
at 
org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:748)
at 
org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:762)
at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:95)
at 
org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:2426)
at 
org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:396)
at 
org.apache.cassandra.service.StorageProxy.applyCounterMutationOnLeader(StorageProxy.java:755)
at 
org.apache.cassandra.db.CounterMutationVerbHandler.doVerb(CounterMutationVerbHandler.java:53)
at 
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{code}

  was:
Start both nodes, start stress on one node like this: cassandra-stress 
--replication-factor=2 --operation=COUNTER_ADD

While that is running: On the other node, kill cassandra, wait for nodetool 
status to show the node as down, and restart cassandra. I sometimes have to 
kill and restart cassandra several times to get the problem to happen.

{code}
ERROR 15:39:33,198 Exception in thread Thread[MutationStage:16,5,main]
java.lang.AssertionError
at 
org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:748)
at 
org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:762)
at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:95)
at 
org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:2426)
at 
org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:396)
at 
org.apache.cassandra.service.StorageProxy.applyCounterMutationOnLeader(StorageProxy.java:755)
at 
org.apache.cassandra.db.CounterMutationVerbHandler.doVerb(CounterMutationVerbHandler.java:53)
at 
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{code}


 Error when starting a node with vnodes while counter-add operations underway
 

 Key: CASSANDRA-4981
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4981
 Project: Cassandra
  Issue Type: Bug
 Environment: 2-node cluster on ec2, ubuntu, cassandra-1.2.0 commit 
 a32eb9f7d2f2868e8154d178e96e045859e1d855
Reporter: Tyler Patterson

 Start both nodes, start stress on one node like this: cassandra-stress 
 --replication-factor=2 --operation=COUNTER_ADD
 While that is running: On the other node, kill cassandra, wait for nodetool 
 status to show the node as down, and restart cassandra. I sometimes have to 
 kill and restart cassandra several times to get the problem to happen.
 I get this error several times in the log:
 {code}
 ERROR 15:39:33,198 Exception in thread Thread[MutationStage:16,5,main]
 java.lang.AssertionError
   at 
 org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:748)
   at 
 org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:762)
   at 
 org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:95)
   at 
 org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:2426)
   at 
 org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:396)
   at 
 org.apache.cassandra.service.StorageProxy.applyCounterMutationOnLeader(StorageProxy.java:755)
   at 
 org.apache.cassandra.db.CounterMutationVerbHandler.doVerb(CounterMutationVerbHandler.java:53)
   at 
 

[jira] [Updated] (CASSANDRA-4980) StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch

2012-11-21 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne updated CASSANDRA-4980:


Attachment: 0002-Clean-up-the-commit-log-before-RecoveryManager2Test.txt
0001-fix-StorageServiceClientTest.txt

I'd rather avoid that if possible.

The problem in StorageServiceClientTest is imo a bug that this commit just 
happens to reveal. Namely, that for some reason {{SS.initClient()}} calls 
updateVersionAndAnnounce. But since fat clients are supposed to not have local 
tables, they will in particular have no schema and this is useless. If for some 
weird reason we really need fat client to send a 'I have no schema' on gossip, 
let's call {{MigrationManager.passiveAnnounce(Schema.emptyVersion)}} directly 
(but I don't see why we would need that).

As for RecoveryManager2Test, it's just that this test was somehow assuming the 
commit log was empty when the test started. Which was the case because we 
almost always flush when we write the system table, but it happens that for 
writing the schemaVersion in the local table I figured flushing was overkill 
(since it's only for client sake and we don't need to flush to have it visible).

Attaching simple fixes for both problems.

 StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch
 

 Key: CASSANDRA-4980
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4980
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Yuki Morishita
 Attachments: 0001-fix-StorageServiceClientTest.txt, 
 0002-Clean-up-the-commit-log-before-RecoveryManager2Test.txt


 Looks like change in c4cca2d8bba20a7651b956e1893727391bf5f10a (store 
 schema_version to system.local) broke both StorageServiceClientTest and 
 RecoveryManager2Test.
 StorageServiceClientTest assert data directories are not created in client 
 mode but this change actually creates data directories. RecoveryManager2Test 
 fails with junit.framework.AssertionFailedError: Expecting only 1 replayed 
 mutation, got 10 error and I think extra commit log also comes from this 
 insert to system.local.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4981) Error when starting a node with vnodes while counter-add operations underway

2012-11-21 Thread Tyler Patterson (JIRA)

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

Tyler Patterson updated CASSANDRA-4981:
---

Attachment: system.log

 Error when starting a node with vnodes while counter-add operations underway
 

 Key: CASSANDRA-4981
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4981
 Project: Cassandra
  Issue Type: Bug
 Environment: 2-node cluster on ec2, ubuntu, cassandra-1.2.0 commit 
 a32eb9f7d2f2868e8154d178e96e045859e1d855
Reporter: Tyler Patterson
 Attachments: system.log


 Start both nodes, start stress on one node like this: cassandra-stress 
 --replication-factor=2 --operation=COUNTER_ADD
 While that is running: On the other node, kill cassandra, wait for nodetool 
 status to show the node as down, and restart cassandra. I sometimes have to 
 kill and restart cassandra several times to get the problem to happen.
 I get this error several times in the log:
 {code}
 ERROR 15:39:33,198 Exception in thread Thread[MutationStage:16,5,main]
 java.lang.AssertionError
   at 
 org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:748)
   at 
 org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:762)
   at 
 org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:95)
   at 
 org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:2426)
   at 
 org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:396)
   at 
 org.apache.cassandra.service.StorageProxy.applyCounterMutationOnLeader(StorageProxy.java:755)
   at 
 org.apache.cassandra.db.CounterMutationVerbHandler.doVerb(CounterMutationVerbHandler.java:53)
   at 
 org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:662)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4980) StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch

2012-11-21 Thread Yuki Morishita (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502193#comment-13502193
 ] 

Yuki Morishita commented on CASSANDRA-4980:
---

patch lgtm. +1

 StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch
 

 Key: CASSANDRA-4980
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4980
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Yuki Morishita
 Attachments: 0001-fix-StorageServiceClientTest.txt, 
 0002-Clean-up-the-commit-log-before-RecoveryManager2Test.txt


 Looks like change in c4cca2d8bba20a7651b956e1893727391bf5f10a (store 
 schema_version to system.local) broke both StorageServiceClientTest and 
 RecoveryManager2Test.
 StorageServiceClientTest assert data directories are not created in client 
 mode but this change actually creates data directories. RecoveryManager2Test 
 fails with junit.framework.AssertionFailedError: Expecting only 1 replayed 
 mutation, got 10 error and I think extra commit log also comes from this 
 insert to system.local.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Assigned] (CASSANDRA-4976) AssertionError: Wrong class type at CounterColumn.diff()

2012-11-21 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne reassigned CASSANDRA-4976:
---

Assignee: Sylvain Lebresne

 AssertionError: Wrong class type at CounterColumn.diff()
 --

 Key: CASSANDRA-4976
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4976
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Affects Versions: 1.1.6
Reporter: J.B. Langston
Assignee: Sylvain Lebresne
  Labels: counters

 Thousands of the following errors are getting logged to system.log:
 ERROR [ReadRepairStage:150152] 2012-11-15 12:31:02,815 
 AbstractCassandraDaemon.java (line 135) Exception in thread 
 Thread[ReadRepairStage:150152,5,main]
 java.lang.AssertionError: Wrong class type.
 at org.apache.cassandra.db.CounterColumn.diff(CounterColumn.java:110)
 at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:248)
 at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:342)
 at 
 org.apache.cassandra.service.RowRepairResolver.scheduleRepairs(RowRepairResolver.java:117)
 at 
 org.apache.cassandra.service.RowRepairResolver.resolve(RowRepairResolver.java:94)
 at 
 org.apache.cassandra.service.AsyncRepairCallback$1.runMayThrow(AsyncRepairCallback.java:54)
 at 
 org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
 There are also many of the following errors intermingled with the above:
 ERROR [ReadRepairStage:150158] 2012-11-15 12:30:34,148 CounterContext.java 
 (line 381) invalid counter shard detected; 
 (b29a5480-e911-11e1--ce481d6d2aff, 3, 916) and 
 (b29a5480-e911-11e1--ce481d6d2aff, 3, -1590) differ only in count; will 
 pick highest to self-heal; this indicates a bug or corruption generated a bad 
 counter shard
 I am not 100% sure whether they are related.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-4976) AssertionError: Wrong class type at CounterColumn.diff()

2012-11-21 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne updated CASSANDRA-4976:


Reviewer:   (was: slebresne)

 AssertionError: Wrong class type at CounterColumn.diff()
 --

 Key: CASSANDRA-4976
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4976
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Affects Versions: 1.1.6
Reporter: J.B. Langston
Assignee: Sylvain Lebresne
  Labels: counters

 Thousands of the following errors are getting logged to system.log:
 ERROR [ReadRepairStage:150152] 2012-11-15 12:31:02,815 
 AbstractCassandraDaemon.java (line 135) Exception in thread 
 Thread[ReadRepairStage:150152,5,main]
 java.lang.AssertionError: Wrong class type.
 at org.apache.cassandra.db.CounterColumn.diff(CounterColumn.java:110)
 at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:248)
 at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:342)
 at 
 org.apache.cassandra.service.RowRepairResolver.scheduleRepairs(RowRepairResolver.java:117)
 at 
 org.apache.cassandra.service.RowRepairResolver.resolve(RowRepairResolver.java:94)
 at 
 org.apache.cassandra.service.AsyncRepairCallback$1.runMayThrow(AsyncRepairCallback.java:54)
 at 
 org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
 There are also many of the following errors intermingled with the above:
 ERROR [ReadRepairStage:150158] 2012-11-15 12:30:34,148 CounterContext.java 
 (line 381) invalid counter shard detected; 
 (b29a5480-e911-11e1--ce481d6d2aff, 3, 916) and 
 (b29a5480-e911-11e1--ce481d6d2aff, 3, -1590) differ only in count; will 
 pick highest to self-heal; this indicates a bug or corruption generated a bad 
 counter shard
 I am not 100% sure whether they are related.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: Fix unit test failures

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2.0 e2df26b89 - 9366fb323


Fix unit test failures

patch by slebresne; reviewed by yukim for CASSANDRA-4980


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

Branch: refs/heads/cassandra-1.2.0
Commit: 9366fb32305a59822c7b914788995f2b11d92064
Parents: e2df26b
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:16:50 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:16:50 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 17b21d9..567d829 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -389,8 +389,6 @@ public class StorageService implements 
IEndpointStateChangeSubscriber, StorageSe
 {
 throw new AssertionError(e);
 }
-
-Schema.instance.updateVersionAndAnnounce();
 }
 
 public synchronized void initServer() throws ConfigurationException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
--
diff --git a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java 
b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
index c77dec3..9787c7f 100644
--- a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
+++ b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class RecoveryManager2Test extends SchemaLoader
 {
@@ -41,6 +42,9 @@ public class RecoveryManager2Test extends SchemaLoader
 /* test that commit logs do not replay flushed data */
 public void testWithFlush() throws Exception
 {
+// Flush everything that may be in the commit log now to start fresh
+FBUtilities.waitOnFutures(Table.open(Table.SYSTEM_KS).flush());
+
 CompactionManager.instance.disableAutoCompaction();
 
 // add a row to another CF so we test skipping mutations within a 
not-entirely-flushed CF



[1/2] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 a9deba211 - fb577447b


Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: fb577447bc9604dbba2a9cd83263d7c6306c0810
Parents: a9deba2 9366fb3
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:17:53 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:17:53 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--




[2/2] git commit: Fix unit test failures

2012-11-21 Thread slebresne
Fix unit test failures

patch by slebresne; reviewed by yukim for CASSANDRA-4980


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

Branch: refs/heads/cassandra-1.2
Commit: 9366fb32305a59822c7b914788995f2b11d92064
Parents: e2df26b
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:16:50 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:16:50 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 17b21d9..567d829 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -389,8 +389,6 @@ public class StorageService implements 
IEndpointStateChangeSubscriber, StorageSe
 {
 throw new AssertionError(e);
 }
-
-Schema.instance.updateVersionAndAnnounce();
 }
 
 public synchronized void initServer() throws ConfigurationException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
--
diff --git a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java 
b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
index c77dec3..9787c7f 100644
--- a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
+++ b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class RecoveryManager2Test extends SchemaLoader
 {
@@ -41,6 +42,9 @@ public class RecoveryManager2Test extends SchemaLoader
 /* test that commit logs do not replay flushed data */
 public void testWithFlush() throws Exception
 {
+// Flush everything that may be in the commit log now to start fresh
+FBUtilities.waitOnFutures(Table.open(Table.SYSTEM_KS).flush());
+
 CompactionManager.instance.disableAutoCompaction();
 
 // add a row to another CF so we test skipping mutations within a 
not-entirely-flushed CF



[3/3] git commit: Fix unit test failures

2012-11-21 Thread slebresne
Fix unit test failures

patch by slebresne; reviewed by yukim for CASSANDRA-4980


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

Branch: refs/heads/trunk
Commit: 9366fb32305a59822c7b914788995f2b11d92064
Parents: e2df26b
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:16:50 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:16:50 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 17b21d9..567d829 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -389,8 +389,6 @@ public class StorageService implements 
IEndpointStateChangeSubscriber, StorageSe
 {
 throw new AssertionError(e);
 }
-
-Schema.instance.updateVersionAndAnnounce();
 }
 
 public synchronized void initServer() throws ConfigurationException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9366fb32/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
--
diff --git a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java 
b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
index c77dec3..9787c7f 100644
--- a/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
+++ b/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class RecoveryManager2Test extends SchemaLoader
 {
@@ -41,6 +42,9 @@ public class RecoveryManager2Test extends SchemaLoader
 /* test that commit logs do not replay flushed data */
 public void testWithFlush() throws Exception
 {
+// Flush everything that may be in the commit log now to start fresh
+FBUtilities.waitOnFutures(Table.open(Table.SYSTEM_KS).flush());
+
 CompactionManager.instance.disableAutoCompaction();
 
 // add a row to another CF so we test skipping mutations within a 
not-entirely-flushed CF



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

2012-11-21 Thread slebresne
Updated Branches:
  refs/heads/trunk 3bd353f91 - f49ca707d


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: f49ca707d495bd78b94d36bc2df165649b4a5815
Parents: 3bd353f fb57744
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:18:08 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:18:08 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--




[2/3] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread slebresne
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: fb577447bc9604dbba2a9cd83263d7c6306c0810
Parents: a9deba2 9366fb3
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Wed Nov 21 20:17:53 2012 +0100
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Wed Nov 21 20:17:53 2012 +0100

--
 .../apache/cassandra/service/StorageService.java   |2 --
 .../apache/cassandra/db/RecoveryManager2Test.java  |4 
 2 files changed, 4 insertions(+), 2 deletions(-)
--




[jira] [Resolved] (CASSANDRA-4980) StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch

2012-11-21 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne resolved CASSANDRA-4980.
-

Resolution: Fixed
  Reviewer: yukim
  Assignee: Sylvain Lebresne

Committed, thanks

 StorageServiceClientTest/RecoveryManager2Test fail on 1.2.0 and above branch
 

 Key: CASSANDRA-4980
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4980
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.0 beta 2
Reporter: Yuki Morishita
Assignee: Sylvain Lebresne
 Attachments: 0001-fix-StorageServiceClientTest.txt, 
 0002-Clean-up-the-commit-log-before-RecoveryManager2Test.txt


 Looks like change in c4cca2d8bba20a7651b956e1893727391bf5f10a (store 
 schema_version to system.local) broke both StorageServiceClientTest and 
 RecoveryManager2Test.
 StorageServiceClientTest assert data directories are not created in client 
 mode but this change actually creates data directories. RecoveryManager2Test 
 fails with junit.framework.AssertionFailedError: Expecting only 1 replayed 
 mutation, got 10 error and I think extra commit log also comes from this 
 insert to system.local.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3017) add a Message size limit

2012-11-21 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502234#comment-13502234
 ] 

Brandon Williams commented on CASSANDRA-3017:
-

bq. I think this also would cause some dropped messages when FD announces that 
a node is back up and the cluster tries to replicate stuff to it, but it 
doesn't know yet that the source is a cluster member.

This shouldn't happen very often since we persist tokens and announce the range 
for bootstrap for an adequate amount of time.

If we're dealing with a truly malicious adversary however, it can easily 
advertise a generation higher than any existing token, take it over, and then 
OOM us with a large message.  It seems like the only way to prevent this is 
authentication by way of internode encryption.

 add a Message size limit
 

 Key: CASSANDRA-3017
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3017
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Jonathan Ellis
Assignee: Kirk True
Priority: Minor
  Labels: lhf
 Attachments: 
 0001-use-the-thrift-max-message-size-for-inter-node-messa.patch, 
 trunk-3017.txt


 We protect the server from allocating huge buffers for malformed message with 
 the Thrift frame size (CASSANDRA-475).  But we don't have similar protection 
 for the inter-node Message objects.
 Adding this would be good to deal with malicious adversaries as well as a 
 malfunctioning cluster participant.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3017) add a Message size limit

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502237#comment-13502237
 ] 

Jonathan Ellis commented on CASSANDRA-3017:
---

I think our main goal is to not OOM when someone hits our port with an 
incompatible client by mistake.

 add a Message size limit
 

 Key: CASSANDRA-3017
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3017
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Jonathan Ellis
Assignee: Kirk True
Priority: Minor
  Labels: lhf
 Attachments: 
 0001-use-the-thrift-max-message-size-for-inter-node-messa.patch, 
 trunk-3017.txt


 We protect the server from allocating huge buffers for malformed message with 
 the Thrift frame size (CASSANDRA-475).  But we don't have similar protection 
 for the inter-node Message objects.
 Adding this would be good to deal with malicious adversaries as well as a 
 malfunctioning cluster participant.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4880) Endless loop flushing+compacting system/schema_keyspaces and system/schema_columnfamilies

2012-11-21 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502240#comment-13502240
 ] 

Brandon Williams commented on CASSANDRA-4880:
-

+1

 Endless loop flushing+compacting system/schema_keyspaces and 
 system/schema_columnfamilies
 -

 Key: CASSANDRA-4880
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4880
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Affects Versions: 1.1.6, 1.2.0 beta 1
 Environment: Linux x86_64 3.4.9, sun-jdk 1.6.0_33
Reporter: Mina Naguib
Assignee: Pavel Yaskevich
 Fix For: 1.1.7, 1.2.0 rc1

 Attachments: CASSANDRA-4880-fix.patch, CASSANDRA-4880.patch


 After upgrading a node from 1.1.2 to 1.1.6, the startup sequence entered a 
 loop as seen here:
 http://mina.naguib.ca/misc/cassandra_116_startup_loop.txt
 Stopping and starting the node entered the same loop.
 Reverting back to 1.1.2 started successfully.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3017) add a Message size limit

2012-11-21 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502270#comment-13502270
 ] 

Brandon Williams commented on CASSANDRA-3017:
-

I suppose a megabyte would work as a default, but I think we'll need to give 
users a knob to turn here since I've heard of 700+ node clusters which would 
require nearly 3MB for tokens alone.

 add a Message size limit
 

 Key: CASSANDRA-3017
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3017
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Jonathan Ellis
Assignee: Kirk True
Priority: Minor
  Labels: lhf
 Attachments: 
 0001-use-the-thrift-max-message-size-for-inter-node-messa.patch, 
 trunk-3017.txt


 We protect the server from allocating huge buffers for malformed message with 
 the Thrift frame size (CASSANDRA-475).  But we don't have similar protection 
 for the inter-node Message objects.
 Adding this would be good to deal with malicious adversaries as well as a 
 malfunctioning cluster participant.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-4803) CFRR wide row iterators improvements

2012-11-21 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502291#comment-13502291
 ] 

Piotr Kołaczkowski commented on CASSANDRA-4803:
---

[~jbellis] right, I change it.

 CFRR wide row iterators improvements
 

 Key: CASSANDRA-4803
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4803
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 1.1.0
Reporter: Piotr Kołaczkowski
Assignee: Piotr Kołaczkowski
 Fix For: 1.1.7

 Attachments: 
 0004-Better-token-range-wrap-around-handling-in-CFIF-CFRR.patch, 
 0006-Code-cleanup-refactoring-in-CFRR.-Fixed-bug-with-mis.patch, 
 0007-Fallback-to-describe_splits-in-case-describe_splits_.patch


 {code}
  public float getProgress()
 {
 // TODO this is totally broken for wide rows
 // the progress is likely to be reported slightly off the actual but 
 close enough
 float progress = ((float) iter.rowsRead() / totalRowCount);
 return progress  1.0F ? 1.0F : progress;
 }
 {code}
 The problem is iter.rowsRead() does not return the number of rows read from 
 the wide row iterator, but returns number of *columns* (every row is counted 
 multiple times). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-3818) disabling m-a-t for fun and profit (and other ant stuff)

2012-11-21 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-3818:


Fix Version/s: (was: 1.1.7)
   1.3

 disabling m-a-t for fun and profit (and other ant stuff)
 

 Key: CASSANDRA-3818
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3818
 Project: Cassandra
  Issue Type: Bug
  Components: Core, Packaging
Affects Versions: 1.0.7
Reporter: Eric Evans
Assignee: Eric Evans
Priority: Minor
  Labels: build
 Fix For: 1.3

 Attachments: 
 ASF.LICENSE.NOT.GRANTED--v1-0001-CASSANDRA-3818-keep-init-in-init-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0002-clean-up-avro-generation-dependencies-and-dependants.txt,
  
 ASF.LICENSE.NOT.GRANTED--v1-0003-remove-useless-build-subprojects-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0004-group-test-targets-under-test-all.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0005-add-property-to-disable-maven-junk.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0006-add-property-to-disable-rat-license-header-writing.txt,
  ASF.LICENSE.NOT.GRANTED--v1-0007-don-t-needlessly-regenerate-thrift-code.txt


 It should be possible to disable maven-ant-tasks for environments with more 
 rigid dependency control, or where network access isn't available.
 Patches to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (CASSANDRA-3818) disabling m-a-t for fun and profit (and other ant stuff)

2012-11-21 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-3818:


Attachment: 3818.txt

rebased the patch for trunk (1.3) as one file-3818.txt

I inserted bogus proxy server, cassandra still builds fine (and faster).

perhaps new targets should get description attributes so they show up in ant 
-p, but otherwise lgtm.

 disabling m-a-t for fun and profit (and other ant stuff)
 

 Key: CASSANDRA-3818
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3818
 Project: Cassandra
  Issue Type: Bug
  Components: Core, Packaging
Affects Versions: 1.0.7
Reporter: Eric Evans
Assignee: Eric Evans
Priority: Minor
  Labels: build
 Fix For: 1.3

 Attachments: 3818.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0001-CASSANDRA-3818-keep-init-in-init-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0002-clean-up-avro-generation-dependencies-and-dependants.txt,
  
 ASF.LICENSE.NOT.GRANTED--v1-0003-remove-useless-build-subprojects-target.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0004-group-test-targets-under-test-all.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0005-add-property-to-disable-maven-junk.txt, 
 ASF.LICENSE.NOT.GRANTED--v1-0006-add-property-to-disable-rat-license-header-writing.txt,
  ASF.LICENSE.NOT.GRANTED--v1-0007-don-t-needlessly-regenerate-thrift-code.txt


 It should be possible to disable maven-ant-tasks for environments with more 
 rigid dependency control, or where network access isn't available.
 Patches to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-3378) Allow configuration of storage protocol socket buffer

2012-11-21 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502305#comment-13502305
 ] 

Michał Michalski commented on CASSANDRA-3378:
-

Just pondering... In the existing code there's a BufferedOutputStream with 
buffer size of 4096 bytes at first, which can be then overwritten by a stream 
with default buffer size (no specified size is passed to constructor) if 
compression is enabled. 
My concern is: if there's a reason for setting different buffer size for 
compressed and non-compressed connection by default, is this valid to apply the 
same value (provided by user in config) for both connection types? 
Shouldn't they be distinguished on a config level too? For example by 
splitting storage_send_buff_size_bytes (that's how I temporarily named this 
new param) into two options: storage_uncompressed_send_buff_size_bytes and 
storage_compressed_send_buff_size_bytes?
Or maybe we assume that for this special environment (high latency connection) 
the performance gain achieved by using larger buffer is big enough to just 
ignore the case I mentioned and use the same value in these two places in code?

 Allow configuration of storage protocol socket buffer
 -

 Key: CASSANDRA-3378
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3378
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Brandon Williams
Priority: Minor
  Labels: lhf

 Similar to rpc_[send,recv]_buff_size_in_bytes, we should expose this for high 
 latency connections.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


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

2012-11-21 Thread jbellis
Updated Branches:
  refs/heads/cassandra-1.2 fb577447b - b960b2b82
  refs/heads/cassandra-1.2.0 9366fb323 - cc166a525
  refs/heads/trunk f49ca707d - 6f5fc0a4b


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: 6f5fc0a4b28f67e2ba0c992f41eaebcca6009df7
Parents: f49ca70 b960b2b
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 15:02:26 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 15:02:26 2012 -0600

--
 .../apache/cassandra/thrift/CassandraServer.java   |  140 +++
 1 files changed, 63 insertions(+), 77 deletions(-)
--




[4/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/trunk
Commit: cc166a525bf278b6d6c89de7774ee36a526baa05
Parents: 9366fb3
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 15:00:49 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 15:01:51 2012 -0600

--
 .../apache/cassandra/thrift/CassandraServer.java   |  140 +++
 1 files changed, 63 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc166a52/src/java/org/apache/cassandra/thrift/CassandraServer.java
--
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java 
b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 393b5f1..9cebacb 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -297,9 +297,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get_slice, traceParameters);
 }
 else
@@ -310,8 +310,7 @@ public class CassandraServer implements Cassandra.Iface
 try
 {
 state().hasColumnFamilyAccess(column_parent.column_family, 
Permission.SELECT);
-return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent,
-predicate, consistency_level).get(key);
+return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent, predicate, 
consistency_level).get(key);
 }
 catch (RequestValidationException e)
 {
@@ -330,13 +329,11 @@ public class CassandraServer implements Cassandra.Iface
 {
 ListString keysList = Lists.newArrayList();
 for (ByteBuffer key : keys)
-{
 keysList.add(ByteBufferUtil.bytesToHex(key));
-}
 MapString, String traceParameters = ImmutableMap.of(keys, 
keysList.toString(),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(multiget_slice, traceParameters);
 }
 else
@@ -424,12 +421,11 @@ public class CassandraServer implements Cassandra.Iface
 public ColumnOrSuperColumn get(ByteBuffer key, ColumnPath column_path, 
ConsistencyLevel consistency_level)
 throws InvalidRequestException, NotFoundException, UnavailableException, 
TimedOutException
 {
-
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_path, column_path.toString(),
-consistency_level, consistency_level.name());
+  
column_path, column_path.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get, traceParameters);
 }
 else
@@ -457,9 +453,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  

[5/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/cassandra-1.2.0
Commit: cc166a525bf278b6d6c89de7774ee36a526baa05
Parents: 9366fb3
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 15:00:49 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 15:01:51 2012 -0600

--
 .../apache/cassandra/thrift/CassandraServer.java   |  140 +++
 1 files changed, 63 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc166a52/src/java/org/apache/cassandra/thrift/CassandraServer.java
--
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java 
b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 393b5f1..9cebacb 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -297,9 +297,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get_slice, traceParameters);
 }
 else
@@ -310,8 +310,7 @@ public class CassandraServer implements Cassandra.Iface
 try
 {
 state().hasColumnFamilyAccess(column_parent.column_family, 
Permission.SELECT);
-return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent,
-predicate, consistency_level).get(key);
+return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent, predicate, 
consistency_level).get(key);
 }
 catch (RequestValidationException e)
 {
@@ -330,13 +329,11 @@ public class CassandraServer implements Cassandra.Iface
 {
 ListString keysList = Lists.newArrayList();
 for (ByteBuffer key : keys)
-{
 keysList.add(ByteBufferUtil.bytesToHex(key));
-}
 MapString, String traceParameters = ImmutableMap.of(keys, 
keysList.toString(),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(multiget_slice, traceParameters);
 }
 else
@@ -424,12 +421,11 @@ public class CassandraServer implements Cassandra.Iface
 public ColumnOrSuperColumn get(ByteBuffer key, ColumnPath column_path, 
ConsistencyLevel consistency_level)
 throws InvalidRequestException, NotFoundException, UnavailableException, 
TimedOutException
 {
-
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_path, column_path.toString(),
-consistency_level, consistency_level.name());
+  
column_path, column_path.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get, traceParameters);
 }
 else
@@ -457,9 +453,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, 

[6/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/cassandra-1.2
Commit: cc166a525bf278b6d6c89de7774ee36a526baa05
Parents: 9366fb3
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 15:00:49 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 15:01:51 2012 -0600

--
 .../apache/cassandra/thrift/CassandraServer.java   |  140 +++
 1 files changed, 63 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc166a52/src/java/org/apache/cassandra/thrift/CassandraServer.java
--
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java 
b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 393b5f1..9cebacb 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -297,9 +297,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get_slice, traceParameters);
 }
 else
@@ -310,8 +310,7 @@ public class CassandraServer implements Cassandra.Iface
 try
 {
 state().hasColumnFamilyAccess(column_parent.column_family, 
Permission.SELECT);
-return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent,
-predicate, consistency_level).get(key);
+return multigetSliceInternal(state().getKeyspace(), 
Collections.singletonList(key), column_parent, predicate, 
consistency_level).get(key);
 }
 catch (RequestValidationException e)
 {
@@ -330,13 +329,11 @@ public class CassandraServer implements Cassandra.Iface
 {
 ListString keysList = Lists.newArrayList();
 for (ByteBuffer key : keys)
-{
 keysList.add(ByteBufferUtil.bytesToHex(key));
-}
 MapString, String traceParameters = ImmutableMap.of(keys, 
keysList.toString(),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, consistency_level.name());
+  
column_parent, column_parent.toString(),
+  predicate, 
predicate.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(multiget_slice, traceParameters);
 }
 else
@@ -424,12 +421,11 @@ public class CassandraServer implements Cassandra.Iface
 public ColumnOrSuperColumn get(ByteBuffer key, ColumnPath column_path, 
ConsistencyLevel consistency_level)
 throws InvalidRequestException, NotFoundException, UnavailableException, 
TimedOutException
 {
-
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_path, column_path.toString(),
-consistency_level, consistency_level.name());
+  
column_path, column_path.toString(),
+  
consistency_level, consistency_level.name());
 Tracing.instance().begin(get, traceParameters);
 }
 else
@@ -457,9 +453,9 @@ public class CassandraServer implements Cassandra.Iface
 if (startSessionIfRequested())
 {
 MapString, String traceParameters = ImmutableMap.of(key, 
ByteBufferUtil.bytesToHex(key),
-column_parent, column_parent.toString(),
-predicate, predicate.toString(),
-consistency_level, 

[jira] [Created] (CASSANDRA-4982) cqlsh: alter table add column with table that has collection fails

2012-11-21 Thread Dave Brosius (JIRA)
Dave Brosius created CASSANDRA-4982:
---

 Summary: cqlsh: alter table add column with table that has 
collection fails
 Key: CASSANDRA-4982
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4982
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.0 beta 2
Reporter: Dave Brosius
Assignee: Sylvain Lebresne


create keyspace collections with replication = {'class':'SimpleStrategy', 
'replication_factor':1};
use collections;
create table collections (key int primary key, aset settext);
insert into collections (key, aset) values (1, {'fee', 'fi'});
alter table collections add aaa text;
 
 
ERROR 16:52:33,792 Error occurred during processing of message.
java.lang.UnsupportedOperationException: ColumnToCollectionType should only be 
used in composite types, never alone
at 
org.apache.cassandra.db.marshal.ColumnToCollectionType.validate(ColumnToCollectionType.java:103)
at org.apache.cassandra.config.CFMetaData.validate(CFMetaData.java:1094)
at 
org.apache.cassandra.service.MigrationManager.announceColumnFamilyUpdate(MigrationManager.java:202)
at 
org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:217)
at 
org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:73)
at 
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:132)
at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:140)
at 
org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1706)
at 
org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4074)
at 
org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4062)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
at 
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:199)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[5/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/cassandra-1.2.0
Commit: ad36c8fd886843038b751a63be45a72e22f620ab
Parents: cc166a5
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:00 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:00 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java 
b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
index 3b6f69e..0608366 100644
--- a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
+++ b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
@@ -278,8 +278,10 @@ public class LazilyCompactedRowTest extends SchemaLoader
 ColumnFamilyStore cfs = table.getColumnFamilyStore(Standard1);
 
 final int ROWS_PER_SSTABLE = 10;
-for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++) {
-for (int i = 0; i  ROWS_PER_SSTABLE; i++) {
+for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++)
+{
+for (int i = 0; i  ROWS_PER_SSTABLE; i++)
+{
 ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(i % 2));
 RowMutation rm = new RowMutation(Keyspace1, key);
 rm.add(new QueryPath(Standard1, null, 
ByteBufferUtil.bytes(String.valueOf(i / 2))), ByteBufferUtil.EMPTY_BYTE_BUFFER, 
j * ROWS_PER_SSTABLE + i);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java 
b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 4dea430..0fe9757 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -260,7 +260,8 @@ public class SSTableReaderTest extends SchemaLoader
 
 DecoratedKey firstKey = null, lastKey = null;
 long timestamp = System.currentTimeMillis();
-for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++) {
+for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++)
+{
 DecoratedKey key = Util.dk(String.valueOf(i));
 if (firstKey == null)
 firstKey = key;
@@ -270,7 +271,7 @@ public class SSTableReaderTest extends SchemaLoader
 lastKey = key;
 RowMutation rm = new RowMutation(ks, key.key);
 rm.add(new QueryPath(cf, null, ByteBufferUtil.bytes(col)),
-  ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
+   ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
 rm.apply();
 }
 store.forceBlockingFlush();



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

2012-11-21 Thread jbellis
Updated Branches:
  refs/heads/cassandra-1.2 b960b2b82 - 354cb093d
  refs/heads/cassandra-1.2.0 cc166a525 - ad36c8fd8
  refs/heads/trunk 6f5fc0a4b - cf706f26c


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: cf706f26cafe81d602b2cf2fcfd9df5efa41e6c2
Parents: 6f5fc0a 354cb09
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:40 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:40 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--




[4/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/trunk
Commit: ad36c8fd886843038b751a63be45a72e22f620ab
Parents: cc166a5
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:00 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:00 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java 
b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
index 3b6f69e..0608366 100644
--- a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
+++ b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
@@ -278,8 +278,10 @@ public class LazilyCompactedRowTest extends SchemaLoader
 ColumnFamilyStore cfs = table.getColumnFamilyStore(Standard1);
 
 final int ROWS_PER_SSTABLE = 10;
-for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++) {
-for (int i = 0; i  ROWS_PER_SSTABLE; i++) {
+for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++)
+{
+for (int i = 0; i  ROWS_PER_SSTABLE; i++)
+{
 ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(i % 2));
 RowMutation rm = new RowMutation(Keyspace1, key);
 rm.add(new QueryPath(Standard1, null, 
ByteBufferUtil.bytes(String.valueOf(i / 2))), ByteBufferUtil.EMPTY_BYTE_BUFFER, 
j * ROWS_PER_SSTABLE + i);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java 
b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 4dea430..0fe9757 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -260,7 +260,8 @@ public class SSTableReaderTest extends SchemaLoader
 
 DecoratedKey firstKey = null, lastKey = null;
 long timestamp = System.currentTimeMillis();
-for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++) {
+for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++)
+{
 DecoratedKey key = Util.dk(String.valueOf(i));
 if (firstKey == null)
 firstKey = key;
@@ -270,7 +271,7 @@ public class SSTableReaderTest extends SchemaLoader
 lastKey = key;
 RowMutation rm = new RowMutation(ks, key.key);
 rm.add(new QueryPath(cf, null, ByteBufferUtil.bytes(col)),
-  ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
+   ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
 rm.apply();
 }
 store.forceBlockingFlush();



[6/6] git commit: formatting

2012-11-21 Thread jbellis
formatting


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

Branch: refs/heads/cassandra-1.2
Commit: ad36c8fd886843038b751a63be45a72e22f620ab
Parents: cc166a5
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:00 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:00 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java 
b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
index 3b6f69e..0608366 100644
--- a/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
+++ b/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
@@ -278,8 +278,10 @@ public class LazilyCompactedRowTest extends SchemaLoader
 ColumnFamilyStore cfs = table.getColumnFamilyStore(Standard1);
 
 final int ROWS_PER_SSTABLE = 10;
-for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++) {
-for (int i = 0; i  ROWS_PER_SSTABLE; i++) {
+for (int j = 0; j  (DatabaseDescriptor.getIndexInterval() * 3) / 
ROWS_PER_SSTABLE; j++)
+{
+for (int i = 0; i  ROWS_PER_SSTABLE; i++)
+{
 ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(i % 2));
 RowMutation rm = new RowMutation(Keyspace1, key);
 rm.add(new QueryPath(Standard1, null, 
ByteBufferUtil.bytes(String.valueOf(i / 2))), ByteBufferUtil.EMPTY_BYTE_BUFFER, 
j * ROWS_PER_SSTABLE + i);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad36c8fd/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java 
b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 4dea430..0fe9757 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -260,7 +260,8 @@ public class SSTableReaderTest extends SchemaLoader
 
 DecoratedKey firstKey = null, lastKey = null;
 long timestamp = System.currentTimeMillis();
-for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++) {
+for (int i = 0; i  DatabaseDescriptor.getIndexInterval(); i++)
+{
 DecoratedKey key = Util.dk(String.valueOf(i));
 if (firstKey == null)
 firstKey = key;
@@ -270,7 +271,7 @@ public class SSTableReaderTest extends SchemaLoader
 lastKey = key;
 RowMutation rm = new RowMutation(ks, key.key);
 rm.add(new QueryPath(cf, null, ByteBufferUtil.bytes(col)),
-  ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
+   ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
 rm.apply();
 }
 store.forceBlockingFlush();



[3/6] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread jbellis
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/trunk
Commit: 354cb093d279d4fdbc69648d75b5651d3646e729
Parents: b960b2b ad36c8f
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:33 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:33 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--




[2/6] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread jbellis
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: 354cb093d279d4fdbc69648d75b5651d3646e729
Parents: b960b2b ad36c8f
Author: Jonathan Ellis jbel...@apache.org
Authored: Wed Nov 21 16:45:33 2012 -0600
Committer: Jonathan Ellis jbel...@apache.org
Committed: Wed Nov 21 16:45:33 2012 -0600

--
 .../cassandra/io/LazilyCompactedRowTest.java   |6 --
 .../cassandra/io/sstable/SSTableReaderTest.java|5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--




[jira] [Commented] (CASSANDRA-3961) Make index_interval configurable per column family

2012-11-21 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502390#comment-13502390
 ] 

Jonathan Ellis commented on CASSANDRA-3961:
---

Comments on v4:

- Shouldn't need to touch avro, that's just for compatibility with 1.0
- Please observe http://wiki.apache.org/cassandra/CodeStyle
- If index interval is changed, we should regenerate it on restart instead of 
using the saved summary with the old interval


 Make index_interval configurable per column family
 --

 Key: CASSANDRA-3961
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3961
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
 Environment: Cassandra 1.0.7/unix
Reporter: Radim Kolar
Assignee: Radim Kolar
 Fix For: 1.3

 Attachments: cass-interval1.txt, cass-interval2.txt, 
 cass-interval3.txt, cass-interval4.txt


 After various experiments with mixing OLTP a OLAP workload running on single 
 cassandra cluster i discovered that lot of memory is wasted on holding index 
 samples for CF which are rarely accessed or index is not much used for CF 
 access because slices over keys are used. 
 There is per column family setting for configuring bloom filters - 
 bloom_filter_fp_chance. Please add setting index_interval configurable per CF 
 as well. If this setting is not set or it is zero, default from 
 cassandra.yaml will be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[2/6] git commit: Merge branch 'cassandra-1.2.0' into cassandra-1.2

2012-11-21 Thread yukim
Merge branch 'cassandra-1.2.0' into cassandra-1.2


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

Branch: refs/heads/cassandra-1.2
Commit: c3acf269f72b767a9eb6274f45868bb9d2aecb19
Parents: 354cb09 8c24d01
Author: Yuki Morishita yu...@apache.org
Authored: Wed Nov 21 17:06:26 2012 -0600
Committer: Yuki Morishita yu...@apache.org
Committed: Wed Nov 21 17:06:26 2012 -0600

--
 CHANGES.txt|1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   24 -
 .../cassandra/db/ColumnFamilyStoreMBean.java   |6 +-
 .../org/apache/cassandra/service/PBSPredictor.java |   10 +-
 .../cassandra/service/PBSPredictorMBean.java   |2 +-
 .../apache/cassandra/service/StorageService.java   |   84 +++
 .../cassandra/service/StorageServiceMBean.java |   25 ++---
 src/java/org/apache/cassandra/tools/NodeCmd.java   |6 +-
 src/java/org/apache/cassandra/tools/NodeProbe.java |   13 +--
 9 files changed, 104 insertions(+), 67 deletions(-)
--


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



[4/6] git commit: Remove cassandra specific exceptions from JMX interface; patch by yukim reviewed by dbrosius for CASSANDRA-4893

2012-11-21 Thread yukim
Remove cassandra specific exceptions from JMX interface; patch by yukim 
reviewed by dbrosius for CASSANDRA-4893


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

Branch: refs/heads/trunk
Commit: 8c24d019fced1bb6039310c192208721462d280a
Parents: ad36c8f
Author: Yuki Morishita yu...@apache.org
Authored: Wed Nov 21 17:05:51 2012 -0600
Committer: Yuki Morishita yu...@apache.org
Committed: Wed Nov 21 17:05:51 2012 -0600

--
 CHANGES.txt|1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   24 -
 .../cassandra/db/ColumnFamilyStoreMBean.java   |6 +-
 .../org/apache/cassandra/service/PBSPredictor.java |   10 +-
 .../cassandra/service/PBSPredictorMBean.java   |2 +-
 .../apache/cassandra/service/StorageService.java   |   84 +++
 .../cassandra/service/StorageServiceMBean.java |   25 ++---
 src/java/org/apache/cassandra/tools/NodeCmd.java   |6 +-
 src/java/org/apache/cassandra/tools/NodeProbe.java |   13 +--
 9 files changed, 104 insertions(+), 67 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c24d019/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index da74896..b7cc394 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,7 @@
  * Correctly handle prepared operation on collections (CASSANDRA-4945)
  * Fix CQL3 LIMIT (CASSANDRA-4877)
  * Fix Stress for CQL3 (CASSANDRA-4979)
+ * Remove cassandra specific exceptions from JMX interface (CASSANDRA-4893)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c24d019/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 7e4355a..9cb4c66 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -206,10 +206,17 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 }
 }
 
-public void setCompactionStrategyClass(String compactionStrategyClass) 
throws ConfigurationException
+public void setCompactionStrategyClass(String compactionStrategyClass)
 {
-metadata.compactionStrategyClass = 
CFMetaData.createCompactionStrategy(compactionStrategyClass);
-maybeReloadCompactionStrategy();
+try
+{
+metadata.compactionStrategyClass = 
CFMetaData.createCompactionStrategy(compactionStrategyClass);
+maybeReloadCompactionStrategy();
+}
+catch (ConfigurationException e)
+{
+throw new IllegalArgumentException(e.getMessage());
+}
 }
 
 public String getCompactionStrategyClass()
@@ -222,9 +229,16 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 return metadata.compressionParameters().asThriftOptions();
 }
 
-public void setCompressionParameters(MapString,String opts) throws 
ConfigurationException
+public void setCompressionParameters(MapString,String opts)
 {
-metadata.compressionParameters = CompressionParameters.create(opts);
+try
+{
+metadata.compressionParameters = 
CompressionParameters.create(opts);
+}
+catch (ConfigurationException e)
+{
+throw new IllegalArgumentException(e.getMessage());
+}
 }
 
 private ColumnFamilyStore(Table table,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c24d019/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
index 39ed703..3388b9b 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
@@ -21,8 +21,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
-import org.apache.cassandra.exceptions.ConfigurationException;
-
 /**
  * The MBean interface for ColumnFamilyStore
  */
@@ -260,7 +258,7 @@ public interface ColumnFamilyStoreMBean
  * Sets the compaction strategy by class name
  * @param className the name of the compaction 

  1   2   >