[jira] [Created] (CASSANDRA-5537) Reduce Empty Map allocations in Directory.SSTableLister

2013-05-06 Thread Dave Brosius (JIRA)
Dave Brosius created CASSANDRA-5537:
---

 Summary: Reduce Empty Map allocations in Directory.SSTableLister
 Key: CASSANDRA-5537
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5537
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Priority: Trivial
 Fix For: 2.0
 Attachments: 5537.txt

SSTableLister allocates HashMaps consistently that are very often not used.

See output: http://pastebin.com/Ky4hUn5X

Format is

Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed

The snapshot is taken after the size of the collection hasn't changed for 5 
seconds.

Postpone creation of hashmap until you need 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] [Updated] (CASSANDRA-5537) Reduce Empty Map allocations in Directory.SSTableLister

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-5537:


Attachment: 5537.txt

 Reduce Empty Map allocations in Directory.SSTableLister
 ---

 Key: CASSANDRA-5537
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5537
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5537.txt


 SSTableLister allocates HashMaps consistently that are very often not used.
 See output: http://pastebin.com/Ky4hUn5X
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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] [Created] (CASSANDRA-5538) Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints

2013-05-06 Thread Dave Brosius (JIRA)
Dave Brosius created CASSANDRA-5538:
---

 Summary: Reduce Empty Map allocations in 
StorageProxy.sendToHintedEndpoints
 Key: CASSANDRA-5538
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5538
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0
 Attachments: 5538.txt

StorageProxy.sendToHintedEndpoints allocates HashMaps consistently that are 
very often not used.

See output: http://pastebin.com/jEaBxz1h

Format is
Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed

The snapshot is taken after the size of the collection hasn't changed for 5 
seconds.

Postpone creation of hashmap until you need 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] [Assigned] (CASSANDRA-5537) Reduce Empty Map allocations in Directory.SSTableLister

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius reassigned CASSANDRA-5537:
---

Assignee: Dave Brosius

 Reduce Empty Map allocations in Directory.SSTableLister
 ---

 Key: CASSANDRA-5537
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5537
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5537.txt


 SSTableLister allocates HashMaps consistently that are very often not used.
 See output: http://pastebin.com/Ky4hUn5X
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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] [Updated] (CASSANDRA-5538) Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-5538:


Attachment: 5538.txt

 Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints
 --

 Key: CASSANDRA-5538
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5538
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5538.txt


 StorageProxy.sendToHintedEndpoints allocates HashMaps consistently that are 
 very often not used.
 See output: http://pastebin.com/jEaBxz1h
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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


git commit: Fix repair hanging silently on an unexpected error

2013-05-06 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 0637b8674 - 45e6d912c


Fix repair hanging silently on an unexpected error

patch by yukim; reviewed by slebresne for CASSANDRA-5229


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

Branch: refs/heads/cassandra-1.2
Commit: 45e6d912cca3de66a3af02e9df2c3484992d0a2e
Parents: 0637b86
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Mon May 6 09:07:31 2013 +0200
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Mon May 6 09:07:31 2013 +0200

--
 CHANGES.txt|1 +
 .../cassandra/streaming/IncomingStreamReader.java  |6 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/45e6d912/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4376a25..4bdfb91 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,7 @@
(CASSANDRA-5531)
  * cqlsh: add CLUSTERING ORDER BY support to DESCRIBE (CASSANDRA-5528)
  * Add custom secondary index support to CQL3 (CASSANDRA-5484)
+ * Fix repair hanging silently on unexpected error (CASSANDRA-5229)
 Merged from 1.1
  * Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393)
  * Use allocator information to improve memtable memory usage estimate

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45e6d912/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
--
diff --git a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java 
b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
index 8036afd..0b058fc 100644
--- a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
@@ -127,6 +127,12 @@ public class IncomingStreamReader
 retry();
 throw ex;
 }
+catch (RuntimeException e)
+{
+// if we encountered unexpected exception, fail this session
+session.close(false);
+throw e;
+}
 }
 
 session.closeIfFinished();



git commit: Fix Ec2Snitch regression introduced by CASSANDRA-5171

2013-05-06 Thread slebresne
Updated Branches:
  refs/heads/cassandra-1.2 45e6d912c - 59bd0e716


Fix Ec2Snitch regression introduced by CASSANDRA-5171

patch by vijay2win; reviewed by driftx and arya for CASSANDRA-5432


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

Branch: refs/heads/cassandra-1.2
Commit: 59bd0e7169c5fabc0e734ccbbbcd6964709577d0
Parents: 45e6d91
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Mon May 6 09:14:34 2013 +0200
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Mon May 6 09:14:34 2013 +0200

--
 CHANGES.txt|1 +
 .../org/apache/cassandra/locator/Ec2Snitch.java|   15 ---
 .../cassandra/net/OutboundTcpConnectionPool.java   |2 ++
 3 files changed, 3 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4bdfb91..1abfc65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,7 @@
  * cqlsh: add CLUSTERING ORDER BY support to DESCRIBE (CASSANDRA-5528)
  * Add custom secondary index support to CQL3 (CASSANDRA-5484)
  * Fix repair hanging silently on unexpected error (CASSANDRA-5229)
+ * Fix Ec2Snitch regression introduced by CASSANDRA-5171 (CASSANDRA-5432)
 Merged from 1.1
  * Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393)
  * Use allocator information to improve memtable memory usage estimate

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/src/java/org/apache/cassandra/locator/Ec2Snitch.java
--
diff --git a/src/java/org/apache/cassandra/locator/Ec2Snitch.java 
b/src/java/org/apache/cassandra/locator/Ec2Snitch.java
index f36449d..a28e2a6 100644
--- a/src/java/org/apache/cassandra/locator/Ec2Snitch.java
+++ b/src/java/org/apache/cassandra/locator/Ec2Snitch.java
@@ -23,13 +23,11 @@ import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.URL;
-import java.util.Map;
 
 import com.google.common.base.Charsets;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.db.SystemTable;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.gms.ApplicationState;
 import org.apache.cassandra.gms.EndpointState;
@@ -46,7 +44,6 @@ public class Ec2Snitch extends AbstractNetworkTopologySnitch
 protected static final String ZONE_NAME_QUERY_URL = 
http://169.254.169.254/latest/meta-data/placement/availability-zone;;
 private static final String DEFAULT_DC = UNKNOWN-DC;
 private static final String DEFAULT_RACK = UNKNOWN-RACK;
-private MapInetAddress, MapString, String savedEndpoints;
 protected String ec2zone;
 protected String ec2region;
 
@@ -96,13 +93,7 @@ public class Ec2Snitch extends AbstractNetworkTopologySnitch
 return ec2zone;
 EndpointState state = 
Gossiper.instance.getEndpointStateForEndpoint(endpoint);
 if (state == null || state.getApplicationState(ApplicationState.RACK) 
== null)
-{
-if (savedEndpoints == null)
-savedEndpoints = SystemTable.loadDcRackInfo();
-if (savedEndpoints.containsKey(endpoint))
-return savedEndpoints.get(endpoint).get(rack);
 return DEFAULT_RACK;
-}
 return state.getApplicationState(ApplicationState.RACK).value;
 }
 
@@ -112,13 +103,7 @@ public class Ec2Snitch extends 
AbstractNetworkTopologySnitch
 return ec2region;
 EndpointState state = 
Gossiper.instance.getEndpointStateForEndpoint(endpoint);
 if (state == null || state.getApplicationState(ApplicationState.DC) == 
null)
-{
-if (savedEndpoints == null)
-savedEndpoints = SystemTable.loadDcRackInfo();
-if (savedEndpoints.containsKey(endpoint))
-return savedEndpoints.get(endpoint).get(data_center);
 return DEFAULT_DC;
-}
 return state.getApplicationState(ApplicationState.DC).value;
 }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index 88cad5b..1bc1893 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ 

[1/3] git commit: Fix repair hanging silently on an unexpected error

2013-05-06 Thread slebresne
Updated Branches:
  refs/heads/trunk 35633503d - 32c3b6e52


Fix repair hanging silently on an unexpected error

patch by yukim; reviewed by slebresne for CASSANDRA-5229


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

Branch: refs/heads/trunk
Commit: 45e6d912cca3de66a3af02e9df2c3484992d0a2e
Parents: 0637b86
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Mon May 6 09:07:31 2013 +0200
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Mon May 6 09:07:31 2013 +0200

--
 CHANGES.txt|1 +
 .../cassandra/streaming/IncomingStreamReader.java  |6 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/45e6d912/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4376a25..4bdfb91 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,7 @@
(CASSANDRA-5531)
  * cqlsh: add CLUSTERING ORDER BY support to DESCRIBE (CASSANDRA-5528)
  * Add custom secondary index support to CQL3 (CASSANDRA-5484)
+ * Fix repair hanging silently on unexpected error (CASSANDRA-5229)
 Merged from 1.1
  * Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393)
  * Use allocator information to improve memtable memory usage estimate

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45e6d912/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
--
diff --git a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java 
b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
index 8036afd..0b058fc 100644
--- a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
@@ -127,6 +127,12 @@ public class IncomingStreamReader
 retry();
 throw ex;
 }
+catch (RuntimeException e)
+{
+// if we encountered unexpected exception, fail this session
+session.close(false);
+throw e;
+}
 }
 
 session.closeIfFinished();



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

2013-05-06 Thread slebresne
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/32c3b6e5
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32c3b6e5
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32c3b6e5

Branch: refs/heads/trunk
Commit: 32c3b6e526e191532358730f0d4d9dfbf1aa7b0e
Parents: 3563350 59bd0e7
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Mon May 6 09:16:07 2013 +0200
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Mon May 6 09:16:07 2013 +0200

--
 CHANGES.txt|2 ++
 .../org/apache/cassandra/locator/Ec2Snitch.java|   15 ---
 .../cassandra/net/OutboundTcpConnectionPool.java   |2 ++
 .../cassandra/streaming/IncomingStreamReader.java  |6 ++
 4 files changed, 10 insertions(+), 15 deletions(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c3b6e5/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
--



[2/3] git commit: Fix Ec2Snitch regression introduced by CASSANDRA-5171

2013-05-06 Thread slebresne
Fix Ec2Snitch regression introduced by CASSANDRA-5171

patch by vijay2win; reviewed by driftx and arya for CASSANDRA-5432


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

Branch: refs/heads/trunk
Commit: 59bd0e7169c5fabc0e734ccbbbcd6964709577d0
Parents: 45e6d91
Author: Sylvain Lebresne sylv...@datastax.com
Authored: Mon May 6 09:14:34 2013 +0200
Committer: Sylvain Lebresne sylv...@datastax.com
Committed: Mon May 6 09:14:34 2013 +0200

--
 CHANGES.txt|1 +
 .../org/apache/cassandra/locator/Ec2Snitch.java|   15 ---
 .../cassandra/net/OutboundTcpConnectionPool.java   |2 ++
 3 files changed, 3 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4bdfb91..1abfc65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,7 @@
  * cqlsh: add CLUSTERING ORDER BY support to DESCRIBE (CASSANDRA-5528)
  * Add custom secondary index support to CQL3 (CASSANDRA-5484)
  * Fix repair hanging silently on unexpected error (CASSANDRA-5229)
+ * Fix Ec2Snitch regression introduced by CASSANDRA-5171 (CASSANDRA-5432)
 Merged from 1.1
  * Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393)
  * Use allocator information to improve memtable memory usage estimate

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/src/java/org/apache/cassandra/locator/Ec2Snitch.java
--
diff --git a/src/java/org/apache/cassandra/locator/Ec2Snitch.java 
b/src/java/org/apache/cassandra/locator/Ec2Snitch.java
index f36449d..a28e2a6 100644
--- a/src/java/org/apache/cassandra/locator/Ec2Snitch.java
+++ b/src/java/org/apache/cassandra/locator/Ec2Snitch.java
@@ -23,13 +23,11 @@ import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.URL;
-import java.util.Map;
 
 import com.google.common.base.Charsets;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.db.SystemTable;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.gms.ApplicationState;
 import org.apache.cassandra.gms.EndpointState;
@@ -46,7 +44,6 @@ public class Ec2Snitch extends AbstractNetworkTopologySnitch
 protected static final String ZONE_NAME_QUERY_URL = 
http://169.254.169.254/latest/meta-data/placement/availability-zone;;
 private static final String DEFAULT_DC = UNKNOWN-DC;
 private static final String DEFAULT_RACK = UNKNOWN-RACK;
-private MapInetAddress, MapString, String savedEndpoints;
 protected String ec2zone;
 protected String ec2region;
 
@@ -96,13 +93,7 @@ public class Ec2Snitch extends AbstractNetworkTopologySnitch
 return ec2zone;
 EndpointState state = 
Gossiper.instance.getEndpointStateForEndpoint(endpoint);
 if (state == null || state.getApplicationState(ApplicationState.RACK) 
== null)
-{
-if (savedEndpoints == null)
-savedEndpoints = SystemTable.loadDcRackInfo();
-if (savedEndpoints.containsKey(endpoint))
-return savedEndpoints.get(endpoint).get(rack);
 return DEFAULT_RACK;
-}
 return state.getApplicationState(ApplicationState.RACK).value;
 }
 
@@ -112,13 +103,7 @@ public class Ec2Snitch extends 
AbstractNetworkTopologySnitch
 return ec2region;
 EndpointState state = 
Gossiper.instance.getEndpointStateForEndpoint(endpoint);
 if (state == null || state.getApplicationState(ApplicationState.DC) == 
null)
-{
-if (savedEndpoints == null)
-savedEndpoints = SystemTable.loadDcRackInfo();
-if (savedEndpoints.containsKey(endpoint))
-return savedEndpoints.get(endpoint).get(data_center);
 return DEFAULT_DC;
-}
 return state.getApplicationState(ApplicationState.DC).value;
 }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59bd0e71/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index 88cad5b..1bc1893 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -132,6 +132,8 @@ 

Git Push Summary

2013-05-06 Thread slebresne
Updated Tags:  refs/tags/1.2.5-tentative [deleted] de9854170


Git Push Summary

2013-05-06 Thread slebresne
Updated Tags:  refs/tags/1.2.5-tentative [created] 59bd0e716


[jira] [Commented] (CASSANDRA-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Cyril Scetbon (JIRA)

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

Cyril Scetbon commented on CASSANDRA-4421:
--

Can we consider this code as functional but not efficient ? 

 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-5539) add custom prompt for cqlsh

2013-05-06 Thread Cyril Scetbon (JIRA)
Cyril Scetbon created CASSANDRA-5539:


 Summary: add custom prompt for cqlsh
 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial


Here is the pull request for the patch 
https://github.com/apache/cassandra/pull/16

--
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-5388) Unit tests fail due to ant/junit problem

2013-05-06 Thread Antoine Levy-Lambert (JIRA)

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

Antoine Levy-Lambert commented on CASSANDRA-5388:
-

Can you check whether it helps if you replace the 
c:\Users\Ryan\git\cassandra3\build\lib\jars\junit-4.6.jar by a junit-4.11.jar ?

Also, can you build the current ant 1.9.1-alpha from source by checking it out 
from subversion ? There are instructions on this page : 
http://ant.apache.org/manual/install.html#buildingant

Alternatively, you can use the file 
[ant1.9.1-alpha.tgz|http://people.apache.org/~antoine/dist/ant1.9.1-alpha.tgz]  
 


 Unit tests fail due to ant/junit problem
 

 Key: CASSANDRA-5388
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5388
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Windows 7 or Linux
 java 1.7.0_17
 ant 1.9.0
Reporter: Ryan McGuire

 Intermittently, but more often than not I get the following error when 
 running 'ant test' on Windows 7 (also encountered on Linux now):
 {code}
 BUILD FAILED
 c:\Users\Ryan\git\cassandra3\build.xml:1121: The following error occurred 
 while executing this line:
 c:\Users\Ryan\git\cassandra3\build.xml:1064: Using loader 
 AntClassLoader[C:\Program 
 Files\Java\apache-ant-1.9.0\lib\ant-launcher.jar;c:\Program 
 Files\Java\apache-ant-1.9.0\lib\ant.jar;c:\Program 
 Files\Java\apache-ant-1.9.0\lib\ant-junit.jar;c:\Program 
 

[jira] [Commented] (CASSANDRA-5075) CQL Add support for AS keyword in select

2013-05-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-5075:
-

I'd prefer separating the aliasing from the other RawSelector. We pretty much 
always need to call getUnaliased() first to retrieve the real selector, so 
having AliasedSelector and the other selector being of the same type feels 
error prone for no advantages. Instead, I would typically rename the current 
RawSelector interface to say Selectable, and then make RawSelector be a pair 
of a Selectable and a (potentially null) alias. Anecdotally this would also 
avoid adding new methods to ColumnIdentifier which bugs me for some reason.

Nit: could be nice to throw a specific aliases are not supported in x 
clause message if someone uses an alias in a WHERE or ORDER BY clause.


 CQL Add support for AS keyword in select
 

 Key: CASSANDRA-5075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5075
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Alexandr Kulik
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 2.0


 It would be nice to have support of AS keyword in select statement. It would 
 allow to use jpa frameworks without writing custom sql/cql's. 

--
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-5075) CQL Add support for AS keyword in select

2013-05-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-5075:
--

Makes sense. Will update soonish.

 CQL Add support for AS keyword in select
 

 Key: CASSANDRA-5075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5075
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Alexandr Kulik
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 2.0


 It would be nice to have support of AS keyword in select statement. It would 
 allow to use jpa frameworks without writing custom sql/cql's. 

--
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-5540) Concurrent secondary index updates remove rows from the index

2013-05-06 Thread Alexei Bakanov (JIRA)
Alexei Bakanov created CASSANDRA-5540:
-

 Summary: Concurrent secondary index updates remove rows from the 
index
 Key: CASSANDRA-5540
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5540
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.4
Reporter: Alexei Bakanov


Existing rows disappear from secondary index when doing simultaneous updates of 
a row with the same secondary index value.

Here is a little pycassa script that reproduces a bug. The script inserts 4 
rows with same secondary index value, reads those rows back and check that 
there are 4 of them.
Please run two instances of the script simultaneously in two separate terminals 
in order to simulate concurrent updates:

-scrpit.py START-
import pycassa
from pycassa.index import *

pool = pycassa.ConnectionPool('ks123')
cf = pycassa.ColumnFamily(pool, 'cf1')

while True:
for rowKey in xrange(4):
cf.insert(str(rowKey), {'indexedColumn': 'indexedValue'})

index_expression = create_index_expression('indexedColumn', 'indexedValue')
index_clause = create_index_clause([index_expression])
rows = cf.get_indexed_slices(index_clause)
length = len(list(rows))
if length == 4:
pass
else:
print 'found just %d rows out of 4' % length

pool.dispose()

---script.py FINISH---

---schema cli start---
create keyspace ks123
  with placement_strategy = 'NetworkTopologyStrategy'
  and strategy_options = {datacenter1 : 1}
  and durable_writes = true;

use ks123;

create column family cf1
  with column_type = 'Standard'
  and comparator = 'AsciiType'
  and default_validation_class = 'AsciiType'
  and key_validation_class = 'AsciiType'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and populate_io_cache_on_flush = false
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
{column_name : 'indexedColumn',
validation_class : AsciiType,
index_name : 'INDEX1',
index_type : 0}]
  and compression_options = {'sstable_compression' : 
'org.apache.cassandra.io.compress.SnappyCompressor'};
---schema cli finish---

Test cluster created with 'ccm create --cassandra-version 1.2.4 --nodes 1 
--start testUpdate'

--
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-5540) Concurrent secondary index updates remove rows from the index

2013-05-06 Thread Alexei Bakanov (JIRA)

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

Alexei Bakanov updated CASSANDRA-5540:
--

Description: 
Existing rows disappear from secondary index when doing simultaneous updates of 
a row with the same secondary index value.

Here is a little pycassa script that reproduces a bug. The script inserts 4 
rows with same secondary index value, reads those rows back and check that 
there are 4 of them.
Please run two instances of the script simultaneously in two separate terminals 
in order to simulate concurrent updates:
{code}
-scrpit.py START-
import pycassa
from pycassa.index import *

pool = pycassa.ConnectionPool('ks123')
cf = pycassa.ColumnFamily(pool, 'cf1')

while True:
for rowKey in xrange(4):
cf.insert(str(rowKey), {'indexedColumn': 'indexedValue'})

index_expression = create_index_expression('indexedColumn', 'indexedValue')
index_clause = create_index_clause([index_expression])
rows = cf.get_indexed_slices(index_clause)
length = len(list(rows))
if length == 4:
pass
else:
print 'found just %d rows out of 4' % length

pool.dispose()

---script.py FINISH---

---schema cli start---
create keyspace ks123
  with placement_strategy = 'NetworkTopologyStrategy'
  and strategy_options = {datacenter1 : 1}
  and durable_writes = true;

use ks123;

create column family cf1
  with column_type = 'Standard'
  and comparator = 'AsciiType'
  and default_validation_class = 'AsciiType'
  and key_validation_class = 'AsciiType'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and populate_io_cache_on_flush = false
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
{column_name : 'indexedColumn',
validation_class : AsciiType,
index_name : 'INDEX1',
index_type : 0}]
  and compression_options = {'sstable_compression' : 
'org.apache.cassandra.io.compress.SnappyCompressor'};
---schema cli finish---
{code}
Test cluster created with 'ccm create --cassandra-version 1.2.4 --nodes 1 
--start testUpdate'

  was:
Existing rows disappear from secondary index when doing simultaneous updates of 
a row with the same secondary index value.

Here is a little pycassa script that reproduces a bug. The script inserts 4 
rows with same secondary index value, reads those rows back and check that 
there are 4 of them.
Please run two instances of the script simultaneously in two separate terminals 
in order to simulate concurrent updates:

-scrpit.py START-
import pycassa
from pycassa.index import *

pool = pycassa.ConnectionPool('ks123')
cf = pycassa.ColumnFamily(pool, 'cf1')

while True:
for rowKey in xrange(4):
cf.insert(str(rowKey), {'indexedColumn': 'indexedValue'})

index_expression = create_index_expression('indexedColumn', 'indexedValue')
index_clause = create_index_clause([index_expression])
rows = cf.get_indexed_slices(index_clause)
length = len(list(rows))
if length == 4:
pass
else:
print 'found just %d rows out of 4' % length

pool.dispose()

---script.py FINISH---

---schema cli start---
create keyspace ks123
  with placement_strategy = 'NetworkTopologyStrategy'
  and strategy_options = {datacenter1 : 1}
  and durable_writes = true;

use ks123;

create column family cf1
  with column_type = 'Standard'
  and comparator = 'AsciiType'
  and default_validation_class = 'AsciiType'
  and key_validation_class = 'AsciiType'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and populate_io_cache_on_flush = false
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
{column_name : 'indexedColumn',
validation_class : AsciiType,
index_name : 'INDEX1',
index_type : 0}]
  and compression_options = {'sstable_compression' : 
'org.apache.cassandra.io.compress.SnappyCompressor'};
---schema cli finish---

Test cluster created with 'ccm create --cassandra-version 1.2.4 --nodes 1 
--start testUpdate'


 Concurrent secondary index updates remove rows from the index
 -

 Key: CASSANDRA-5540
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5540
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.4
Reporter: Alexei Bakanov

 Existing rows disappear from secondary index when doing simultaneous updates 
 of a row with the same secondary index value.
 Here is a 

[jira] [Commented] (CASSANDRA-5538) Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5538:
---

nice work, +1.

It looks like this basically optimizes local writes, right?  ISTM that the 
next-most-common case will be single, local datacenter.  Can we optimize for 
that with a SingletonMap instead of a full hashmap?

Wrinkle is I'm not entirely sure the best way to ask, are multiple DCs 
involved.  Brute force: add a Snitch.isMultiDC method (did you see multiple 
DCs when you initialized yourself); downside is I'm not sure how to do this 
for EC2Snitch; might just have to assume True.

Less coupling: pre-iterate the targets and track last-seen datacenter and 
compare; downside is one, possibly two hash lookups per target, then a string 
compare, and in the case we're trying to optimize for we do the most 
comparisons.

So maybe brute force is the way to go unless you have a better idea.  Okay to 
break that out into a separate ticket if you'd rather.

 Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints
 --

 Key: CASSANDRA-5538
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5538
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5538.txt


 StorageProxy.sendToHintedEndpoints allocates HashMaps consistently that are 
 very often not used.
 See output: http://pastebin.com/jEaBxz1h
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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-5537) Reduce Empty Map allocations in Directory.SSTableLister

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5537:
---

It's basically only used on startup, right?  I think I'm okay with slightly 
clearer code at the expense of unneeded allocation in that case.

 Reduce Empty Map allocations in Directory.SSTableLister
 ---

 Key: CASSANDRA-5537
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5537
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5537.txt


 SSTableLister allocates HashMaps consistently that are very often not used.
 See output: http://pastebin.com/Ky4hUn5X
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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-5539) add custom prompt for cqlsh

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5539:
---

Is there a way to fetch a pull request?

 add custom prompt for cqlsh
 ---

 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial
  Labels: cqlsh
   Original Estimate: 0.5h
  Remaining Estimate: 0.5h

 Here is the pull request for the patch 
 https://github.com/apache/cassandra/pull/16

--
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-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-4421:
---

Elaborate?

 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Cyril Scetbon (JIRA)

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

Cyril Scetbon commented on CASSANDRA-4421:
--

I'm talking about the patches provided by Alex Liu. If it works (not tested and 
it's part of the question) can we use it until it's more efficient with the use 
of native paging ?

 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Cyril Scetbon (JIRA)

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

Cyril Scetbon edited comment on CASSANDRA-4421 at 5/6/13 1:01 PM:
--

I'm talking about the patches provided by Alex Liu. If it works (not tested and 
it's part of the question) can we use it until it's more efficient with the use 
of native paging ? Do I make a bad supposition about the lack of performance of 
this paging strategy ?

  was (Author: cscetbon):
I'm talking about the patches provided by Alex Liu. If it works (not tested 
and it's part of the question) can we use it until it's more efficient with the 
use of native paging ?
  
 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-5539) add custom prompt for cqlsh

2013-05-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-5539:
-

bq. Is there a way to fetch a pull request?

I'm not aware of one, I think that's really a github thing. But you can add the 
origin remote and fetch the commit itself.

 add custom prompt for cqlsh
 ---

 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial
  Labels: cqlsh
   Original Estimate: 0.5h
  Remaining Estimate: 0.5h

 Here is the pull request for the patch 
 https://github.com/apache/cassandra/pull/16

--
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-4131) Integrate Hive support to be in core cassandra

2013-05-06 Thread Oliver Zhou (JIRA)

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

Oliver Zhou commented on CASSANDRA-4131:


Hi Dmitry,

I try your build with cassandra 1.2.3/hive 0.9.0, I have a issue that I always 
get the duplicated records in Hive.

Cassandra column family:
CREATE COLUMN FAMILY users
WITH comparator = UTF8Type
AND key_validation_class=UTF8Type
AND column_metadata = [
{column_name: full_name, validation_class: UTF8Type}
{column_name: email, validation_class: UTF8Type}
{column_name: state, validation_class: UTF8Type}
{column_name: gender, validation_class: UTF8Type}
{column_name: birth_year, validation_class: LongType}
];

Hive Table:
CREATE EXTERNAL TABLE IF NOT EXISTS
users (key string, full_name string)
STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'
WITH SERDEPROPERTIES (cassandra.columns.mapping = :key,users:full_name , 
cassandra.cf.name = users)
TBLPROPERTIES (cassandra.ks.name = ks33);

Hive Query:
select * from users;
always return duplicated rows (one row appears twice)

select count(1) from users;
return 2 but exactly I only insert one row.

Do you have any idea why this happen?

 Integrate Hive support to be in core cassandra
 --

 Key: CASSANDRA-4131
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4131
 Project: Cassandra
  Issue Type: Improvement
Reporter: Jeremy Hanna
Assignee: Edward Capriolo
  Labels: hadoop, hive

 The standalone hive support (at https://github.com/riptano/hive) would be 
 great to have in-tree so that people don't have to go out to github to 
 download it and wonder if it's a left-for-dead external shim.

--
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: reduce unused empty map creation in the local writes (sendToHintedEndpoints) case patch by dbrosius reviewed by jbellis for CASSANDRA-5538

2013-05-06 Thread dbrosius
Updated Branches:
  refs/heads/trunk 32c3b6e52 - 3c06ff0a8


reduce unused empty map creation in the local writes (sendToHintedEndpoints) 
case
patch by dbrosius reviewed by jbellis for CASSANDRA-5538


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

Branch: refs/heads/trunk
Commit: 3c06ff0a8ee64742416c4b8a5ec083ea5a390e34
Parents: 32c3b6e
Author: Dave Brosius dbros...@apache.org
Authored: Mon May 6 09:39:35 2013 -0400
Committer: Dave Brosius dbros...@apache.org
Committed: Mon May 6 09:39:35 2013 -0400

--
 .../org/apache/cassandra/service/StorageProxy.java |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3c06ff0a/src/java/org/apache/cassandra/service/StorageProxy.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java 
b/src/java/org/apache/cassandra/service/StorageProxy.java
index 58fa6e3..684bd10 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -692,7 +692,7 @@ public class StorageProxy implements StorageProxyMBean
 throws OverloadedException
 {
 // Multimap that holds onto all the messages and addresses meant for a 
specific datacenter
-MapString, MultimapMessageOut, InetAddress dcMessages = new 
HashMapString, MultimapMessageOut, InetAddress();
+MapString, MultimapMessageOut, InetAddress dcMessages = null;
 
 for (InetAddress destination : targets)
 {
@@ -720,10 +720,12 @@ public class StorageProxy implements StorageProxyMBean
 logger.trace(insert writing key  + 
ByteBufferUtil.bytesToHex(rm.key()) +  to  + destination);
 
 String dc = 
DatabaseDescriptor.getEndpointSnitch().getDatacenter(destination);
-MultimapMessageOut, InetAddress messages = 
dcMessages.get(dc);
+MultimapMessageOut, InetAddress messages = (dcMessages 
!= null) ? dcMessages.get(dc) : null;
 if (messages == null)
 {
 messages = HashMultimap.create();
+if (dcMessages == null)
+dcMessages = new HashMapString, 
MultimapMessageOut, InetAddress();
 dcMessages.put(dc, messages);
 }
 
@@ -740,7 +742,8 @@ public class StorageProxy implements StorageProxyMBean
 }
 }
 
-sendMessages(localDataCenter, dcMessages, responseHandler);
+if (dcMessages != null)
+sendMessages(localDataCenter, dcMessages, responseHandler);
 }
 
 public static FutureVoid submitHint(final RowMutation mutation,



[jira] [Commented] (CASSANDRA-5538) Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius commented on CASSANDRA-5538:
-

Fixed the local writes case with commit 
3c06ff0a8ee64742416c4b8a5ec083ea5a390e34 to trunk.

 Reduce Empty Map allocations in StorageProxy.sendToHintedEndpoints
 --

 Key: CASSANDRA-5538
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5538
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5538.txt


 StorageProxy.sendToHintedEndpoints allocates HashMaps consistently that are 
 very often not used.
 See output: http://pastebin.com/jEaBxz1h
 Format is
 Type Date SourceLine CollectionSize NumBuckets NumBucketsUsed
 The snapshot is taken after the size of the collection hasn't changed for 5 
 seconds.
 Postpone creation of hashmap until you need 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-5539) add custom prompt for cqlsh

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5539:
---

Cyril, sounds like it would simplify things if you could attach a patch here.

 add custom prompt for cqlsh
 ---

 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial
  Labels: cqlsh
   Original Estimate: 0.5h
  Remaining Estimate: 0.5h

 Here is the pull request for the patch 
 https://github.com/apache/cassandra/pull/16

--
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-5539) add custom prompt for cqlsh

2013-05-06 Thread Cyril Scetbon (JIRA)

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

Cyril Scetbon commented on CASSANDRA-5539:
--

Here is the patch from github : 
https://github.com/cscetbon/cassandra/commit/8814ae6d9c665db9ece43688b40066e111c25809.patch

 add custom prompt for cqlsh
 ---

 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial
  Labels: cqlsh
   Original Estimate: 0.5h
  Remaining Estimate: 0.5h

 Here is the pull request for the patch 
 https://github.com/apache/cassandra/pull/16

--
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-5539) add custom prompt for cqlsh

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-5539:
--

Reviewer: iamaleksey

 add custom prompt for cqlsh
 ---

 Key: CASSANDRA-5539
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5539
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Cyril Scetbon
Priority: Trivial
  Labels: cqlsh
   Original Estimate: 0.5h
  Remaining Estimate: 0.5h

 Here is the pull request for the patch 
 https://github.com/apache/cassandra/pull/16

--
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-5149) Respect slice count even if column expire mid-request

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-5149:
--

Fix Version/s: (was: 2.0)
   2.1
 Assignee: (was: Aleksey Yeschenko)

 Respect slice count even if column expire mid-request
 -

 Key: CASSANDRA-5149
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5149
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 0.7.0
Reporter: Sylvain Lebresne
 Fix For: 2.1


 This is a follow-up of CASSANDRA-5099.
 If a column expire just while a slice query is performed, it is possible for 
 replicas to count said column as live but to have the coordinator seeing it 
 as dead when building the final result. The effect that the query might 
 return strictly less columns that the requested slice count even though there 
 is some live columns matching the slice predicate but not returned in the 
 result.

--
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-5149) Respect slice count even if column expire mid-request

2013-05-06 Thread Jeremiah Jordan (JIRA)

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

Jeremiah Jordan commented on CASSANDRA-5149:


Does CASSANDRA-4415 make this a non-issue (as long as it deals with this)?  To 
me, this might as well just be won't fix, and you have to make the extra 
query and see if you only get one column back.  I guess there is an edge case 
where you could just get one column, and there really are more, but its been 
this way since 0.7, so meh.

 Respect slice count even if column expire mid-request
 -

 Key: CASSANDRA-5149
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5149
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 0.7.0
Reporter: Sylvain Lebresne
 Fix For: 2.1


 This is a follow-up of CASSANDRA-5099.
 If a column expire just while a slice query is performed, it is possible for 
 replicas to count said column as live but to have the coordinator seeing it 
 as dead when building the final result. The effect that the query might 
 return strictly less columns that the requested slice count even though there 
 is some live columns matching the slice predicate but not returned in the 
 result.

--
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-5149) Respect slice count even if column expire mid-request

2013-05-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-5149:
-

bq. Does CASSANDRA-4415 make this a non-issue

I don't know. I think we'll only ever going to return less than asked columns 
if there is less than asked columns seems a reasonably semantic to have, and 
we fail that here with TTL. And even if CASSANDRA-4415 ends up hiding the 
problem, it's still a performance issue, because if you can't rely on the 
semantic above, you'll almost always have to do one more query than would be 
enough just to be sure (which is what getCount() does for thrift today).

So, without saying this is a big or pressing issue, I'm -1 on wont fixing it 
in the long run.

 Respect slice count even if column expire mid-request
 -

 Key: CASSANDRA-5149
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5149
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 0.7.0
Reporter: Sylvain Lebresne
 Fix For: 2.1


 This is a follow-up of CASSANDRA-5099.
 If a column expire just while a slice query is performed, it is possible for 
 replicas to count said column as live but to have the coordinator seeing it 
 as dead when building the final result. The effect that the query might 
 return strictly less columns that the requested slice count even though there 
 is some live columns matching the slice predicate but not returned in the 
 result.

--
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-5349) Add binary protocol support for bind variables to non-prepared statements

2013-05-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-5349:
-

lgtm, +1

 Add binary protocol support for bind variables to non-prepared statements
 -

 Key: CASSANDRA-5349
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5349
 Project: Cassandra
  Issue Type: Task
  Components: API
Affects Versions: 1.2.0
Reporter: Jonathan Ellis
Assignee: Marcus Eriksson
Priority: Minor
  Labels: cql, protocol
 Fix For: 2.0

 Attachments: 0001-5349-v3.patch, 
 0001-CASSANDRA-5349-binary-protocol-support-for-binding-v.patch, 
 0001-CASSANDRA-5349.patch


 Currently, the binary protocol allows requests as string or [prepared 
 statement] id + bind vars.  Allowing string + bind vars as well would 
 simplify life for users with one-off statements and not have to choose 
 between adding boilerplate for PS, and having to manually escape parameters, 
 which is particularly painful for binary data.

--
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-5075) CQL Add support for AS keyword in select

2013-05-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-5075:
--

Pushed the updated branch. Can you have another look please?

 CQL Add support for AS keyword in select
 

 Key: CASSANDRA-5075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5075
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Alexandr Kulik
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 2.0


 It would be nice to have support of AS keyword in select statement. It would 
 allow to use jpa frameworks without writing custom sql/cql's. 

--
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-5075) CQL Add support for AS keyword in select

2013-05-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-5075:
-

lgtm, +1

 CQL Add support for AS keyword in select
 

 Key: CASSANDRA-5075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5075
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Alexandr Kulik
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 2.0


 It would be nice to have support of AS keyword in select statement. It would 
 allow to use jpa frameworks without writing custom sql/cql's. 

--
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-4180) Single-pass compaction for LCR

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-4180:
---

Minor rebase to https://github.com/jbellis/cassandra/commits/4180-6

 Single-pass compaction for LCR
 --

 Key: CASSANDRA-4180
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4180
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Sylvain Lebresne
Assignee: Jonathan Ellis
  Labels: compaction
 Fix For: 2.0

 Attachments: scrub-error.txt


 LazilyCompactedRow reads all data twice to compact a row which is obviously 
 inefficient. The main reason we do that is to compute the row header. 
 However, CASSANDRA-2319 have removed the main part of that row header. What 
 remains is the size in bytes and the number of columns, but it should be 
 relatively simple to remove those, which would then remove the need for the 
 two-phase compaction.

--
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: add support for bind variables to non-prepared statements.

2013-05-06 Thread marcuse
Updated Branches:
  refs/heads/trunk 3c06ff0a8 - df723af8a


add support for bind variables to non-prepared statements.

patch by marcuse, reviewed by pcmanus for CASSANDRA-5349


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

Branch: refs/heads/trunk
Commit: df723af8a6c04536abd2b4a48cd101f3b2e96746
Parents: 3c06ff0
Author: Marcus Eriksson marc...@spotify.com
Authored: Mon May 6 21:03:26 2013 +0200
Committer: Marcus Eriksson marc...@spotify.com
Committed: Mon May 6 21:03:26 2013 +0200

--
 doc/native_protocol_v2.spec|   16 +-
 .../org/apache/cassandra/cql3/QueryProcessor.java  |   12 +++-
 .../apache/cassandra/transport/SimpleClient.java   |7 ++
 .../cassandra/transport/messages/QueryMessage.java |   44 +--
 4 files changed, 68 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/df723af8/doc/native_protocol_v2.spec
--
diff --git a/doc/native_protocol_v2.spec b/doc/native_protocol_v2.spec
index ad14929..a765700 100644
--- a/doc/native_protocol_v2.spec
+++ b/doc/native_protocol_v2.spec
@@ -263,8 +263,13 @@ Table of Contents
 
 4.1.4. QUERY
 
-  Performs a CQL query. The body of the message consists of a CQL query as a 
[long
-  string] followed by the [consistency] for the operation.
+  Performs a CQL query. The body of the message must be:
+queryconsistency[nvalue_1...value_n]
+  where:
+- query the query, [long string].
+- consistency is the [consistency] level for the operation.
+- optional: n [short], the number of following values.
+- optional: value_1...value_n are [bytes] to use for bound variables 
in the query.
 
   Note that the consistency is ignored by some queries (USE, CREATE, ALTER,
   TRUNCATE, ...).
@@ -638,3 +643,10 @@ Table of Contents
   executed if the provide prepared statement ID is not known by
   this host. The rest of the ERROR message body will be [short
   bytes] representing the unknown ID.
+
+8. Changes from v1
+  * Protocol is versioned to allow old client connects to a newer server, if a 
newer
+client connects to an older server, it needs to check if it gets a
+ProtocolException on connection and try connecting with a lower version.
+  * A query can now have bind variables even though the statement is not
+prepared. (see Section 4.1.4)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/df723af8/src/java/org/apache/cassandra/cql3/QueryProcessor.java
--
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java 
b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index 61b0b50..f7aebff 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -134,11 +134,17 @@ public class QueryProcessor
 public static ResultMessage process(String queryString, ConsistencyLevel 
cl, QueryState queryState)
 throws RequestExecutionException, RequestValidationException
 {
+return process(queryString, Collections.ByteBufferemptyList(), cl, 
queryState);
+}
+
+public static ResultMessage process(String queryString, ListByteBuffer 
variables, ConsistencyLevel cl, QueryState queryState)
+throws RequestExecutionException, RequestValidationException
+{
 logger.trace(CQL QUERY: {}, queryString);
 CQLStatement prepared = getStatement(queryString, 
queryState.getClientState()).statement;
-if (prepared.getBoundsTerms()  0)
-throw new InvalidRequestException(Cannot execute query with bind 
variables);
-return processStatement(prepared, cl, queryState, 
Collections.ByteBufferemptyList());
+if (prepared.getBoundsTerms() != variables.size())
+throw new InvalidRequestException(Invalid amount of bind 
variables);
+return processStatement(prepared, cl, queryState, variables);
 }
 
 public static UntypedResultSet process(String query, ConsistencyLevel cl) 
throws RequestExecutionException

http://git-wip-us.apache.org/repos/asf/cassandra/blob/df723af8/src/java/org/apache/cassandra/transport/SimpleClient.java
--
diff --git a/src/java/org/apache/cassandra/transport/SimpleClient.java 
b/src/java/org/apache/cassandra/transport/SimpleClient.java
index 4caac61..993a490 100644
--- a/src/java/org/apache/cassandra/transport/SimpleClient.java
+++ 

[jira] [Created] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)
Dave Brosius created CASSANDRA-5541:
---

 Summary: Reduce Empty Map allocations in RowMutation 
(modifications)
 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0


The constructor 

public RowMutation(String table, ByteBuffer key)

was generation tons of empty HashMaps that were unused, on the order of 160,000 
of them in about a minute.

delay creating the map until you need 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] [Updated] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-5541:


Attachment: 5541.txt

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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] [Updated] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-5541:


Attachment: (was: 5541.txt)

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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] [Updated] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius updated CASSANDRA-5541:


Attachment: 5541.txt

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5541:
---

This one is not intuitive to me, what code is creating empty RowMutations?

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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] [Comment Edited] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis edited comment on CASSANDRA-5541 at 5/6/13 7:44 PM:
---

This one is not intuitive to me, what code is creating empty RowMutations?  If 
we can just not do that, or maybe create a re-usable emptyRowMutation object, 
that might be preferable.

  was (Author: jbellis):
This one is not intuitive to me, what code is creating empty RowMutations?
  
 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5541:
---

I'll also note that a Builder pattern instead of mutating the RMs directly 
would clean this up nicely and allow using a more memory-efficient ImmutableMap 
for when we really do have multiple entries.  (I converted a few hot spots to 
use the RowMutation constructor that creates a SingletonMap as a baby step 
towards this a while back, but there's a ton of code that uses the old {{add}} 
methods.)

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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-5540) Concurrent secondary index updates remove rows from the index

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5540:
---

Hmm.  It looks like this can happen when multiple inserts happen at the same 
timestamp, since we delete the existing entry with its own timestamp.  But if 
the replacement has the same timestamp, then the tombstone wins the tie.

Any clever ideas to fix this [~beobal]?

 Concurrent secondary index updates remove rows from the index
 -

 Key: CASSANDRA-5540
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5540
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.4
Reporter: Alexei Bakanov

 Existing rows disappear from secondary index when doing simultaneous updates 
 of a row with the same secondary index value.
 Here is a little pycassa script that reproduces a bug. The script inserts 4 
 rows with same secondary index value, reads those rows back and check that 
 there are 4 of them.
 Please run two instances of the script simultaneously in two separate 
 terminals in order to simulate concurrent updates:
 {code}
 -scrpit.py START-
 import pycassa
 from pycassa.index import *
 pool = pycassa.ConnectionPool('ks123')
 cf = pycassa.ColumnFamily(pool, 'cf1')
 while True:
 for rowKey in xrange(4):
 cf.insert(str(rowKey), {'indexedColumn': 'indexedValue'})
 index_expression = create_index_expression('indexedColumn', 
 'indexedValue')
 index_clause = create_index_clause([index_expression])
 rows = cf.get_indexed_slices(index_clause)
 length = len(list(rows))
 if length == 4:
 pass
 else:
 print 'found just %d rows out of 4' % length
 pool.dispose()
 ---script.py FINISH---
 ---schema cli start---
 create keyspace ks123
   with placement_strategy = 'NetworkTopologyStrategy'
   and strategy_options = {datacenter1 : 1}
   and durable_writes = true;
 use ks123;
 create column family cf1
   with column_type = 'Standard'
   and comparator = 'AsciiType'
   and default_validation_class = 'AsciiType'
   and key_validation_class = 'AsciiType'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and populate_io_cache_on_flush = false
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and column_metadata = [
 {column_name : 'indexedColumn',
 validation_class : AsciiType,
 index_name : 'INDEX1',
 index_type : 0}]
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 ---schema cli finish---
 {code}
 Test cluster created with 'ccm create --cassandra-version 1.2.4 --nodes 1 
 --start testUpdate'

--
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: Add alias support to SELECT statement

2013-05-06 Thread aleksey
Updated Branches:
  refs/heads/trunk df723af8a - 08df0b860


Add alias support to SELECT statement

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-5075


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

Branch: refs/heads/trunk
Commit: 08df0b8604cd34c4f1fb384f9f6eaba86203d116
Parents: df723af
Author: Aleksey Yeschenko alek...@apache.org
Authored: Mon May 6 23:11:52 2013 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Mon May 6 23:11:52 2013 +0300

--
 CHANGES.txt|1 +
 NEWS.txt   |5 +
 bin/cqlsh  |2 +-
 doc/cql3/CQL.textile   |   13 +-
 pylib/cqlshlib/cql3handling.py |4 +-
 .../apache/cassandra/cql3/ColumnIdentifier.java|5 +-
 src/java/org/apache/cassandra/cql3/Cql.g   |   30 ++-
 src/java/org/apache/cassandra/cql3/ResultSet.java  |5 +-
 .../cassandra/cql3/statements/RawSelector.java |   48 +
 .../cassandra/cql3/statements/SelectStatement.java |  171 +++
 .../cassandra/cql3/statements/Selectable.java  |   69 ++
 .../cassandra/cql3/statements/Selection.java   |   64 +++---
 12 files changed, 236 insertions(+), 181 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/08df0b86/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 3bb2a71..60accb1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -40,6 +40,7 @@
  * Reenable ALTER TABLE DROP with new semantics (CASSANDRA-3919)
  * Add binary protocol versioning (CASSANDRA-5436)
  * Swap THshaServer for TThreadedSelectorServer (CASSANDRA-5530)
+ * Add alias support to SELECT statement (CASSANDRA-5075)
 
 
 1.2.5

http://git-wip-us.apache.org/repos/asf/cassandra/blob/08df0b86/NEWS.txt
--
diff --git a/NEWS.txt b/NEWS.txt
index c4a57c6..4256095 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -55,6 +55,11 @@ Operations
 - CAS uses gc_grace_seconds to determine how long to keep unused paxos
   state around for, or a minimum of three hours.
 
+Features
+
+- Alias support has been added to CQL3 SELECT statement. Refer to
+  CQL3 documentation (http://cassandra.apache.org/doc/cql3/CQL.html) for 
details.
+
 
 1.2.5
 =

http://git-wip-us.apache.org/repos/asf/cassandra/blob/08df0b86/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 919c030..cac9e28 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -32,7 +32,7 @@ exit 1
 from __future__ import with_statement
 
 description = CQL Shell for Apache Cassandra
-version = 3.0.1
+version = 3.0.2
 
 from StringIO import StringIO
 from itertools import groupby

http://git-wip-us.apache.org/repos/asf/cassandra/blob/08df0b86/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 4c0522d..b131f8f 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -580,9 +580,9 @@ bc(syntax)..
   ( ALLOW FILTERING )?
 
 select-clause ::= selection-list
-  | COUNT '(' ( '*' | '1' ) ')'
+  | COUNT '(' ( '*' | '1' ) ')' (AS identifier)?
 
-selection-list ::= selector ( ',' selector )*
+selection-list ::= selector (AS identifier)? ( ',' selector (AS 
identifier)? )*
| '*'
 
 selector ::= identifier
@@ -604,6 +604,8 @@ __Sample:__
 bc(sample).. 
 SELECT name, occupation FROM users WHERE userid IN (199, 200, 207);
 
+SELECT name AS user_name, occupation AS user_occupation FROM users;
+
 SELECT time, value
 FROM events
 WHERE event_type = 'myEvent'
@@ -611,6 +613,9 @@ WHERE event_type = 'myEvent'
   AND time = 2012-01-01
 
 SELECT COUNT(*) FROM users;
+
+SELECT COUNT(*) AS user_count FROM users;
+
 p. 
 The @SELECT@ statements reads one or more columns for one or more rows in a 
table. It returns a result-set of rows, where each row contains the collection 
of columns corresponding to the query.
 
@@ -620,6 +625,8 @@ The @select-clause@ determines which columns needs to be 
queried and returned
 
 A @selector@ is either a column name to retrieve, or a @function@ of one 
or multiple column names. The functions allows are the same that for @term@ 
and are describe in the function section:#function. In addition to these 
generic functions, the @WRITETIME@ (resp. @TTL@) function allows to select the 
timestamp of when the 

[jira] [Commented] (CASSANDRA-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius commented on CASSANDRA-5541:
-

the first 'bunch' of them are coming from CommitLogReplayer. I'll try to figure 
out how to collect what they are after several thousand go by.

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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-5075) CQL Add support for AS keyword in select

2013-05-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-5075:
--

Thanks. Committed in 08df0b8604cd34c4f1fb384f9f6eaba86203d116, will resolve 
once the dtest is done and pushed.

 CQL Add support for AS keyword in select
 

 Key: CASSANDRA-5075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5075
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Alexandr Kulik
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 2.0


 It would be nice to have support of AS keyword in select statement. It would 
 allow to use jpa frameworks without writing custom sql/cql's. 

--
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-5542) BulkLoader is broken in trunk

2013-05-06 Thread Yuki Morishita (JIRA)
Yuki Morishita created CASSANDRA-5542:
-

 Summary: BulkLoader is broken in trunk
 Key: CASSANDRA-5542
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5542
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 2.0
Reporter: Yuki Morishita


After CASSANDRA-5015 and CASSANDRA-5521, we need CFMetaData to open 
SSTable(Reader), especially to get bloom_filter_fp_chance and index_interval.

When using bulkloader, CFMetaData is not available, so we cannot open SSTable 
to be streamed.

--
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-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-5541:
--

Attachment: 5541-v2.txt

Ah, that makes sense.

Looking at uses of RM.isEmpty, this is one of two places we expect to possibly 
create empty RM.  Looks like the easiest fix would be to move the lazy-allocate 
into CLR -- this is the approach taken already in 
CassandraServer.createMutationList.

v2 attached w/ that approach.

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt, 5541-v2.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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] [Updated] (CASSANDRA-5536) ColumnFamilyInputFormat demands OrderPreservingPartitioner when specifying InputRange with tokens

2013-05-06 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-5536:
--

Attachment: 5536-v2.txt

Analysis LGTM, v2 attached with a bit more cleanup.

 ColumnFamilyInputFormat demands OrderPreservingPartitioner when specifying 
 InputRange with tokens
 -

 Key: CASSANDRA-5536
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5536
 Project: Cassandra
  Issue Type: Bug
  Components: Hadoop
Affects Versions: 1.2.3
Reporter: Lanny Ripple
 Attachments: 5536-v2.txt, cassandra-1.2.3-5536.txt


 When ColumnFamilyInputFormat starts getting splits (via getSplits(...) 
 [ColumnFamilyInputFormat.java:101]) it checks to see if a `jobKeyRange` has 
 been set.  If it has been set it attempts to set the `jobRange`.  However the 
 if block (ColumnFamilyInputFormat.java:124) looks to see if the `jobKeyRange` 
 has tokens but asserts that the OrderPreservingPartitioner must be in use.
 This if block should be looking for keys (not tokens).  Code further down 
 (ColumnFamilyInputFormat.java:147) already manages the range if tokens are 
 used but can never be reached.

--
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-5543) Ant issues when building gen-cql2-grammar

2013-05-06 Thread Joaquin Casares (JIRA)
Joaquin Casares created CASSANDRA-5543:
--

 Summary: Ant issues when building gen-cql2-grammar
 Key: CASSANDRA-5543
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5543
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.3
Reporter: Joaquin Casares


Below are the commands and outputs that were returned.

The first `ant` command fails on gen-cql2-grammar, but if I don't run `ant 
realclean` then it works fine after a second pass.

{CODE}
ubuntu@ip-10-196-153-29:~/.ccm/repository/1.2.3$ ant realclean
Buildfile: /home/ubuntu/.ccm/repository/1.2.3/build.xml

clean:
   [delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/build/test
   [delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/build/classes
   [delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/src/gen-java
   [delete] Deleting: /home/ubuntu/.ccm/repository/1.2.3/build/internode.avpr

realclean:
   [delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/build

BUILD SUCCESSFUL
Total time: 0 seconds
{CODE}

{CODE}
ubuntu@ip-10-196-153-29:~/.ccm/repository/1.2.3$ ant
Buildfile: /home/ubuntu/.ccm/repository/1.2.3/build.xml

maven-ant-tasks-localrepo:

maven-ant-tasks-download:
 [echo] Downloading Maven ANT Tasks...
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build
  [get] Getting: 
http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
  [get] To: 
/home/ubuntu/.ccm/repository/1.2.3/build/maven-ant-tasks-2.1.3.jar

maven-ant-tasks-init:
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/lib

maven-declare-dependencies:

maven-ant-tasks-retrieve-build:
[artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2-sources.jar from 
repository central at http://repo1.maven.org/maven2



[artifact:dependencies] [INFO] Unable to find resource 
'hsqldb:hsqldb:java-source:sources:1.8.0.10' in repository java.net2 
(http://download.java.net/maven/2)
[artifact:dependencies] Building ant file: 
/home/ubuntu/.ccm/repository/1.2.3/build/build-dependencies.xml
 [copy] Copying 45 files to 
/home/ubuntu/.ccm/repository/1.2.3/build/lib/jars
 [copy] Copying 35 files to 
/home/ubuntu/.ccm/repository/1.2.3/build/lib/sources

init:
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/classes/main
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/classes/thrift
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/test/lib
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/test/classes
[mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/src/gen-java

check-avro-generate:

avro-interface-generate-internode:
 [echo] Generating Avro internode code...

avro-generate:

build-subprojects:

check-gen-cli-grammar:

gen-cli-grammar:
 [echo] Building Grammar 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cli/Cli.g  

check-gen-cql2-grammar:

gen-cql2-grammar:
 [echo] Building Grammar 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g  ...
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as IDENT using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as K_KEY using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as QMARK using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as FLOAT using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as STRING_LITERAL using multiple alternatives: 
1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as INTEGER using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input
 [java] warning(200): 
/home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
 Decision can match input such as UUID using multiple alternatives: 1, 2
 [java] As a result, alternative(s) 2 were disabled for that input

[jira] [Updated] (CASSANDRA-5543) Ant issues when building gen-cql2-grammar

2013-05-06 Thread Joaquin Casares (JIRA)

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

Joaquin Casares updated CASSANDRA-5543:
---

Priority: Trivial  (was: Major)

 Ant issues when building gen-cql2-grammar
 -

 Key: CASSANDRA-5543
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5543
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.2.3
Reporter: Joaquin Casares
Priority: Trivial

 Below are the commands and outputs that were returned.
 The first `ant` command fails on gen-cql2-grammar, but if I don't run `ant 
 realclean` then it works fine after a second pass.
 {CODE}
 ubuntu@ip-10-196-153-29:~/.ccm/repository/1.2.3$ ant realclean
 Buildfile: /home/ubuntu/.ccm/repository/1.2.3/build.xml
 clean:
[delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/build/test
[delete] Deleting directory 
 /home/ubuntu/.ccm/repository/1.2.3/build/classes
[delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/src/gen-java
[delete] Deleting: /home/ubuntu/.ccm/repository/1.2.3/build/internode.avpr
 realclean:
[delete] Deleting directory /home/ubuntu/.ccm/repository/1.2.3/build
 BUILD SUCCESSFUL
 Total time: 0 seconds
 {CODE}
 {CODE}
 ubuntu@ip-10-196-153-29:~/.ccm/repository/1.2.3$ ant
 Buildfile: /home/ubuntu/.ccm/repository/1.2.3/build.xml
 maven-ant-tasks-localrepo:
 maven-ant-tasks-download:
  [echo] Downloading Maven ANT Tasks...
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build
   [get] Getting: 
 http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
   [get] To: 
 /home/ubuntu/.ccm/repository/1.2.3/build/maven-ant-tasks-2.1.3.jar
 maven-ant-tasks-init:
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/lib
 maven-declare-dependencies:
 maven-ant-tasks-retrieve-build:
 [artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2-sources.jar from 
 repository central at http://repo1.maven.org/maven2
 
 [artifact:dependencies] [INFO] Unable to find resource 
 'hsqldb:hsqldb:java-source:sources:1.8.0.10' in repository java.net2 
 (http://download.java.net/maven/2)
 [artifact:dependencies] Building ant file: 
 /home/ubuntu/.ccm/repository/1.2.3/build/build-dependencies.xml
  [copy] Copying 45 files to 
 /home/ubuntu/.ccm/repository/1.2.3/build/lib/jars
  [copy] Copying 35 files to 
 /home/ubuntu/.ccm/repository/1.2.3/build/lib/sources
 init:
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/classes/main
 [mkdir] Created dir: 
 /home/ubuntu/.ccm/repository/1.2.3/build/classes/thrift
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/test/lib
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/build/test/classes
 [mkdir] Created dir: /home/ubuntu/.ccm/repository/1.2.3/src/gen-java
 check-avro-generate:
 avro-interface-generate-internode:
  [echo] Generating Avro internode code...
 avro-generate:
 build-subprojects:
 check-gen-cli-grammar:
 gen-cli-grammar:
  [echo] Building Grammar 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cli/Cli.g  
 
 check-gen-cql2-grammar:
 gen-cql2-grammar:
  [echo] Building Grammar 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g  
 ...
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as IDENT using multiple alternatives: 1, 2
  [java] As a result, alternative(s) 2 were disabled for that input
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as K_KEY using multiple alternatives: 1, 2
  [java] As a result, alternative(s) 2 were disabled for that input
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as QMARK using multiple alternatives: 1, 2
  [java] As a result, alternative(s) 2 were disabled for that input
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as FLOAT using multiple alternatives: 1, 2
  [java] As a result, alternative(s) 2 were disabled for that input
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as STRING_LITERAL using multiple 
 alternatives: 1, 2
  [java] As a result, alternative(s) 2 were disabled for that input
  [java] warning(200): 
 /home/ubuntu/.ccm/repository/1.2.3/src/java/org/apache/cassandra/cql/Cql.g:479:20:
  Decision can match input such as INTEGER using multiple alternatives: 1, 2
  [java] As a result, 

[jira] [Commented] (CASSANDRA-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Alex Liu (JIRA)

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

Alex Liu commented on CASSANDRA-4421:
-

It does a few extra CQL requests to get to the next page/CF rows. Other than 
that it's efficient on thrift server. 

Because that native paging could keep using the same connection and internally 
keep reading the data where page it's, native auto paging could be a more 
efficient. 

I don't know how difficult to implement the native auto paging and the time 
line. When it's available, we can add a new CQL native reader, so user can have 
choice to use this one and the new native reader.

 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-4421) Support cql3 table definitions in Hadoop InputFormat

2013-05-06 Thread Alex Liu (JIRA)

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

Alex Liu edited comment on CASSANDRA-4421 at 5/7/13 12:10 AM:
--

It does a few extra CQL requests to get to the next page/CF rows. Other than 
that it's efficient on thrift server. 

Because that native paging could keep using the same connection and internally 
keep reading the data where page it's, native auto paging could be more 
efficient. 

I don't know how difficult to implement the native auto paging and the time 
line. When it's available, we can add a new CQL native reader, so user can have 
choice to use this one and the new native reader.

  was (Author: alexliu68):
It does a few extra CQL requests to get to the next page/CF rows. Other 
than that it's efficient on thrift server. 

Because that native paging could keep using the same connection and internally 
keep reading the data where page it's, native auto paging could be a more 
efficient. 

I don't know how difficult to implement the native auto paging and the time 
line. When it's available, we can add a new CQL native reader, so user can have 
choice to use this one and the new native reader.
  
 Support cql3 table definitions in Hadoop InputFormat
 

 Key: CASSANDRA-4421
 URL: https://issues.apache.org/jira/browse/CASSANDRA-4421
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Affects Versions: 1.1.0
 Environment: Debian Squeeze
Reporter: bert Passek
  Labels: cql3
 Fix For: 1.2.5


 Hello,
 i faced a bug while writing composite column values and following validation 
 on server side.
 This is the setup for reproduction:
 1. create a keyspace
 create keyspace test with strategy_class = 'SimpleStrategy' and 
 strategy_options:replication_factor = 1;
 2. create a cf via cql (3.0)
 create table test1 (
 a int,
 b int,
 c int,
 primary key (a, b)
 );
 If i have a look at the schema in cli i noticed that there is no column 
 metadata for columns not part of primary key.
 create column family test1
   with column_type = 'Standard'
   and comparator = 
 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)'
   and default_validation_class = 'UTF8Type'
   and key_validation_class = 'Int32Type'
   and read_repair_chance = 0.1
   and dclocal_read_repair_chance = 0.0
   and gc_grace = 864000
   and min_compaction_threshold = 4
   and max_compaction_threshold = 32
   and replicate_on_write = true
   and compaction_strategy = 
 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
   and caching = 'KEYS_ONLY'
   and compression_options = {'sstable_compression' : 
 'org.apache.cassandra.io.compress.SnappyCompressor'};
 Please notice the default validation class: UTF8Type
 Now i would like to insert value  127 via cassandra client (no cql, part of 
 mr-jobs). Have a look at the attachement.
 Batch mutate fails:
 InvalidRequestException(why:(String didn't validate.) [test][test1][1:c] 
 failed validation)
 A validator for column value is fetched in 
 ThriftValidation::validateColumnData which returns always the default 
 validator which is UTF8Type as described above (The ColumnDefinition for 
 given column name c is always null)
 In UTF8Type there is a check for
 if (b  127)
return false;
 Anyway, maybe i'm doing something wrong, but i used cql 3.0 for table 
 creation. I assigned data types to all columns, but i can not set values for 
 a composite column because the default validation class is used.
 I think the schema should know the correct validator even for composite 
 columns. The usage of the default validation class does not make sense.
 Best Regards 
 Bert Passek

--
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-5541) Reduce Empty Map allocations in RowMutation (modifications)

2013-05-06 Thread Dave Brosius (JIRA)

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

Dave Brosius commented on CASSANDRA-5541:
-

yes much better. +1

 Reduce Empty Map allocations in RowMutation (modifications)
 ---

 Key: CASSANDRA-5541
 URL: https://issues.apache.org/jira/browse/CASSANDRA-5541
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Affects Versions: 2.0
Reporter: Dave Brosius
Assignee: Dave Brosius
Priority: Trivial
 Fix For: 2.0

 Attachments: 5541.txt, 5541-v2.txt


 The constructor 
 public RowMutation(String table, ByteBuffer key)
 was generation tons of empty HashMaps that were unused, on the order of 
 160,000 of them in about a minute.
 delay creating the map until you need 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


git commit: don't declare throwing exceptions that aren't thrown

2013-05-06 Thread dbrosius
Updated Branches:
  refs/heads/trunk 08df0b860 - f1c9bc612


don't declare throwing exceptions that aren't thrown


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

Branch: refs/heads/trunk
Commit: f1c9bc612e2df5ffacec0debedb2021f1a9171e7
Parents: 08df0b8
Author: Dave Brosius dbros...@apache.org
Authored: Tue May 7 01:47:03 2013 -0400
Committer: Dave Brosius dbros...@apache.org
Committed: Tue May 7 01:47:03 2013 -0400

--
 src/java/org/apache/cassandra/cli/CliMain.java |2 +-
 src/java/org/apache/cassandra/cql/CFPropDefs.java  |2 +-
 .../cassandra/cql/CreateColumnFamilyStatement.java |4 ++--
 .../apache/cassandra/cql/DropIndexStatement.java   |2 +-
 .../org/apache/cassandra/cql/QueryProcessor.java   |4 +---
 src/java/org/apache/cassandra/cql3/KSPropDefs.java |2 +-
 .../statements/CreateColumnFamilyStatement.java|4 ++--
 .../cql3/statements/DropIndexStatement.java|2 +-
 .../org/apache/cassandra/db/BatchlogManager.java   |2 +-
 .../cassandra/db/ColumnFamilySerializer.java   |2 +-
 src/java/org/apache/cassandra/db/DefsTable.java|5 ++---
 .../apache/cassandra/db/HintedHandOffManager.java  |2 +-
 src/java/org/apache/cassandra/db/Table.java|8 
 .../cassandra/db/compaction/PrecompactedRow.java   |   13 +++--
 .../apache/cassandra/db/compaction/Scrubber.java   |2 +-
 .../apache/cassandra/hadoop/BulkRecordWriter.java  |6 +++---
 .../cassandra/hadoop/pig/CassandraStorage.java |2 +-
 .../io/sstable/SSTableIdentityIterator.java|2 +-
 .../apache/cassandra/io/sstable/SSTableLoader.java |6 +++---
 .../cassandra/net/IncomingTcpConnection.java   |2 +-
 .../apache/cassandra/service/StorageService.java   |4 ++--
 .../org/apache/cassandra/streaming/StreamIn.java   |2 +-
 .../cassandra/thrift/TCustomServerSocket.java  |1 -
 .../org/apache/cassandra/tools/BulkLoader.java |2 +-
 src/java/org/apache/cassandra/tools/NodeCmd.java   |4 ++--
 src/java/org/apache/cassandra/tools/NodeProbe.java |   12 ++--
 .../cassandra/tools/SSTableMetadataViewer.java |2 +-
 test/unit/org/apache/cassandra/cli/CliTest.java|2 +-
 28 files changed, 46 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1c9bc61/src/java/org/apache/cassandra/cli/CliMain.java
--
diff --git a/src/java/org/apache/cassandra/cli/CliMain.java 
b/src/java/org/apache/cassandra/cli/CliMain.java
index 3f6ef02..1452f6a 100644
--- a/src/java/org/apache/cassandra/cli/CliMain.java
+++ b/src/java/org/apache/cassandra/cli/CliMain.java
@@ -198,7 +198,7 @@ public class CliMain
 completer.setCandidateStrings(strs);
 }
 
-public static void processStatement(String query) throws 
CharacterCodingException, ClassNotFoundException, TException, 
TimedOutException, NotFoundException, InvalidRequestException, 
NoSuchFieldException, UnavailableException, IllegalAccessException, 
InstantiationException
+public static void processStatement(String query) throws 
CharacterCodingException, TException, TimedOutException, NotFoundException, 
InvalidRequestException, NoSuchFieldException, UnavailableException, 
IllegalAccessException, InstantiationException
 {
 cliClient.executeCLIStatement(query);
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1c9bc61/src/java/org/apache/cassandra/cql/CFPropDefs.java
--
diff --git a/src/java/org/apache/cassandra/cql/CFPropDefs.java 
b/src/java/org/apache/cassandra/cql/CFPropDefs.java
index f3b434b..82485fc 100644
--- a/src/java/org/apache/cassandra/cql/CFPropDefs.java
+++ b/src/java/org/apache/cassandra/cql/CFPropDefs.java
@@ -236,7 +236,7 @@ public class CFPropDefs {
 }
 
 // Return a property value, typed as a Boolean
-public Boolean getPropertyBoolean(String key, Boolean defaultValue) throws 
InvalidRequestException
+public Boolean getPropertyBoolean(String key, Boolean defaultValue)
 {
 String value = properties.get(key);
 return (value == null) ? defaultValue : 
value.toLowerCase().matches((1|true|yes));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1c9bc61/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java 
b/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
index