Re: Performance / limitations of WHERE ... IN queries

2013-04-26 Thread Thierry Templier

Thanks very much, Aaron, for your answer!

Thierry
You are effectively doing a multi get. Getting more than one row at a 
time is normally faster, but there will be a drop off point where the 
improvements slow down. Run some tests.


Also consider that each row you requests creates RF number of commands 
spread around the thread pools for the row. If one client reqrequests 
100's or 1000's then this can delay other client requests.


Cheers




Performance / limitations of WHERE ... IN queries

2013-04-25 Thread Thierry Templier

Hello,

I wonder what are the performances of WHERE ... IN queries especially 
when the number of elements in the IN grows?


Thanks very much for your help!
Thierry


Composite columns

2013-03-20 Thread Thierry Templier

Hello,

I have a question regarding composite columns. What is the way to create
and use them basing on CQL3? Are there some documentations regarding
this feature? Is it supported with both versions 1.1 and 1.2 of Cassandra?

Thanks very much for your help!
Thierry



Re: Super columns and arrays

2012-10-15 Thread Thierry Templier
Thanks very much, Viktor! Is it something that is supported from CQL3? 
If so, how can I create such column kind using CREATE TABLE?


Thierry

struct SuperColumn {
1: required binary name,
2: required listColumn columns,
}


Best regards / Pagarbiai

Viktor Jevdokimov
Senior Developer

Email: viktor.jevdoki...@adform.com
Phone: +370 5 212 3063
Fax: +370 5 261 0453

J. Jasinskio 16C,
LT-01112 Vilnius,
Lithuania



Disclaimer: The information contained in this message and attachments is intended 
solely for the attention and use of the named addressee and may be confidential. 
If you are not the intended recipient, you are reminded that the information 
remains the property of the sender. You must not use, disclose, distribute, copy, 
print or rely on this e-mail. If you have received this message in error, please 
contact the sender immediately and irrevocably delete this message and any 
copies. -Original Message-

From: Thierry Templier [mailto:thierry.templ...@restlet.com]
Sent: Friday, October 12, 2012 13:44
To: user@cassandra.apache.org
Subject: Super columns and arrays

Hello,

I wonder if it's possible to specify an array of values as a value of a super
column... If it's not possible, is there another way to do that?
Thanks very much for your help.

Thierry




Super columns and arrays

2012-10-12 Thread Thierry Templier

Hello,

I wonder if it's possible to specify an array of values as a value of a 
super column... If it's not possible, is there another way to do that?

Thanks very much for your help.

Thierry


Re: Problem when starting Cassandra 1.1.5

2012-10-08 Thread Thierry Templier

Thanks very much, Adeel! It works much better!

Thierry

Please upgrade the JAVA with 1.7.X then it will be working.


Thanks  Regards

*Adeel**Akbar*

On 10/8/2012 1:36 PM, Thierry Templier wrote:

Hello,

I would want to upgrade Cassandra to version 1.1.5 but I have a 
problem when trying to start this version:


$ ./cassandra -f
xss =  -ea -javaagent:./../lib/jamm-0.2.5.jar 
-XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1024M 
-Xmx1024M -Xmn256M -XX:+HeapDumpOnOutOfMemoryError -Xss180k

Segmentation fault

Here is the Java version I used:

$ java -version
java version 1.6.0_24
OpenJDK Runtime Environment (IcedTea6 1.11.4) 
(6b24-1.11.4-1ubuntu0.10.04.1)

OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Thanks very much for your help!
Thierry








Problem when deleting a keyspace

2012-07-30 Thread Thierry Templier

Hello,

I have a problem when trying to delete a keyspace using cqlsh. It seems 
to remain existing even after executing a drop keyspace command:


cqlsh use teststore;
cqlsh:teststore drop keyspace teststore;
cqlsh:teststoredescribe keyspace teststore;

CREATE KEYSPACE teststore WITH strategy_class = 'SimpleStrategy'
  AND strategy_options:replication_factor = '3';

USE teststore;

CREATE TABLE TestEntity (
  pk text PRIMARY KEY,
  name text
) WITH
  comment='' AND
  comparator=text AND
  read_repair_chance=0.10 AND
  gc_grace_seconds=864000 AND
  default_validation=text AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write='true' AND
  compaction_strategy_class='SizeTieredCompactionStrategy' AND
  compression_parameters:sstable_compression='SnappyCompressor';

Is there something else to do in order to actually delete the keyspace?
Thanks very much for your help!
Thierry


Introspecting table with CQL3

2012-07-30 Thread Thierry Templier

Hello,

I wonder if it's possible to have access to metadata regarding a 
table/column family (its column names, types...) using CQL3.


Thanks very much for your help!
Thierry


Getting stats of keyspaces

2012-07-16 Thread Thierry Templier

Hello,

I wonder if it's possible to get statistics for a keyspace like its 
size, size of each column family it contains. It's something I'd like 
from a request...


Thanks very much for your help.
Thierry


Re: Enable CQL3 from Astyanax

2012-07-16 Thread Thierry Templier

Hello Aaron,

I try to simulate a composition relationship within a single column 
family / table (for example, an entity and its fields). I dynamically 
add columns the contained elements.


Let's take an example. Here is my table definition with CQL 3:

CREATE TABLE Entity (
id varchar,
name varchar,
PRIMARY KEY (id)
);

If I want to store an entity with its two fields, I'll have the 
following fields:


id: myentityid
name: myentityname
fields.0.id: myfield1id
fields.0.name: myfield1name
fields.1.id: myfield2id
fields.1.name: myfield2name

When accessing Cassandra data through Astyanax, I get all fields on a 
load operation but not from a CQL3 request.


Thanks very much for your help.
Thierry


Can you provide an example ?

select * should return all the columns from the CF.

Cheers


Re: Enable CQL3 from Astyanax

2012-07-04 Thread Thierry Templier

Thanks Aaron.

I wonder if it's possible to obtain columns from a CQL 3 select query 
(with a select *) that aren't defined in the create table. These fields 
are present when all attributes are loaded but not when using CQL3. Is 
it the normal behavior? Thanks very much!


Thierry


Thanks for contributing.

I'm behind the curve on CQL 3, but here is a post about some of the 
changes http://www.datastax.com/dev/blog/whats-new-in-cql-3-0


Cheers


-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 28/06/2012, at 2:30 AM, Thierry Templier wrote:


Hello Aaron,

I created an issue on the Astyanax github for this problem. I added a 
fix to support CQL3 in the tool.

See the link https://github.com/Netflix/astyanax/issues/75.

Thierry


Had a quick look, the current master does not appear to support it.

Cheers







Re: ClassCastException during Cassandra server startup

2012-07-02 Thread Thierry Templier

Hello Yuki,

Could you give me hints about where to find these files. I have a look 
in the installation folder of Cassandra and in the /var/lib/cassandra 
folder?


Thanks very much for your help.
Thierry
That was bug in 1.1.1 and fixed in 
https://issues.apache.org/jira/browse/CASSANDRA-4331.
Workaround is deleting the key cache files for your index CFs should 
fix this.



Yuki


ClassCastException during Cassandra server startup

2012-06-29 Thread Thierry Templier

Hello,

When I start the Cassandra server, some exceptions occur:

INFO 10:22:16,014 reading saved cache 
/var/lib/cassandra/saved_caches/apispark-CellMessage-KeyCache
 INFO 10:22:16,016 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage-hd-2 
(498 bytes)
 INFO 10:22:16,016 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage-hd-1 
(635 bytes)
 INFO 10:22:16,041 Creating new index : 
ColumnDefinition{name=76657273696f6e, 
validator=org.apache.cassandra.db.marshal.UTF8Type, index_type=KEYS, 
index_name='cellmessage_version'}
 INFO 10:22:16,045 reading saved cache 
/var/lib/cassandra/saved_caches/apispark-CellMessage.cellmessage_version-KeyCache
 INFO 10:22:16,066 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage.cellmessage_version-hd-2 
(349 bytes)
 INFO 10:22:16,066 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage.cellmessage_version-hd-1 
(401 bytes)

ERROR 10:22:16,068 Exception in thread Thread[SSTableBatchOpen:1,5,main]
java.lang.ClassCastException: java.math.BigInteger cannot be cast to 
java.nio.ByteBuffer

at org.apache.cassandra.db.marshal.UTF8Type.compare(UTF8Type.java:27)
at org.apache.cassandra.dht.LocalToken.compareTo(LocalToken.java:45)
at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:89)
at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:38)
at java.util.TreeMap.getEntry(TreeMap.java:345)
at java.util.TreeMap.containsKey(TreeMap.java:226)
at java.util.TreeSet.contains(TreeSet.java:234)
at 
org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:396)
at 
org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:187)
at 
org.apache.cassandra.io.sstable.SSTableReader$1.run(SSTableReader.java:225)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:636)
ERROR 10:22:16,071 Exception in thread Thread[SSTableBatchOpen:2,5,main]
java.lang.ClassCastException: java.math.BigInteger cannot be cast to 
java.nio.ByteBuffer

at org.apache.cassandra.db.marshal.UTF8Type.compare(UTF8Type.java:27)
at org.apache.cassandra.dht.LocalToken.compareTo(LocalToken.java:45)
at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:89)
at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:38)
at java.util.TreeMap.getEntry(TreeMap.java:345)
at java.util.TreeMap.containsKey(TreeMap.java:226)
at java.util.TreeSet.contains(TreeSet.java:234)
at 
org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:396)
at 
org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:187)
at 
org.apache.cassandra.io.sstable.SSTableReader$1.run(SSTableReader.java:225)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:636)

Here is the definition of the related table CellMessage:

CREATE TABLE CellMessage (
  id text PRIMARY KEY,
  type text,
  version text,
  content text,
  title text,
  generated text,
  date text
) WITH
  comment='' AND
  comparator=text AND
  read_repair_chance=0.10 AND
  gc_grace_seconds=864000 AND
  default_validation=text AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write='true' AND
  compaction_strategy_class='SizeTieredCompactionStrategy' AND
  compression_parameters:sstable_compression='SnappyCompressor';

CREATE INDEX cellmessage_version ON CellMessage (version);

Such errors occur for most tables I defined...

Thanks very much for your help!
Thierry


Re: ClassCastException during Cassandra server startup

2012-06-29 Thread Thierry Templier

Hello,

My problem seems to occur after a server restart. As a matter of fact, 
if I clean the data, create a new keyspace and and its structure with 
cqlsh, I can use the database correctly (both with cqlsh and a Java 
application with Astyanax). If I stop the server and restart it, I have 
my problem and then my requests don't work anymore (for example, 
requests with where clause).


Thanks for your help!
Thierry


Hello,

When I start the Cassandra server, some exceptions occur:

INFO 10:22:16,014 reading saved cache 
/var/lib/cassandra/saved_caches/apispark-CellMessage-KeyCache
 INFO 10:22:16,016 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage-hd-2 
(498 bytes)
 INFO 10:22:16,016 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage-hd-1 
(635 bytes)
 INFO 10:22:16,041 Creating new index : 
ColumnDefinition{name=76657273696f6e, 
validator=org.apache.cassandra.db.marshal.UTF8Type, index_type=KEYS, 
index_name='cellmessage_version'}
 INFO 10:22:16,045 reading saved cache 
/var/lib/cassandra/saved_caches/apispark-CellMessage.cellmessage_version-KeyCache
 INFO 10:22:16,066 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage.cellmessage_version-hd-2 
(349 bytes)
 INFO 10:22:16,066 Opening 
/var/lib/cassandra/data/apispark/CellMessage/apispark-CellMessage.cellmessage_version-hd-1 
(401 bytes)

ERROR 10:22:16,068 Exception in thread Thread[SSTableBatchOpen:1,5,main]
java.lang.ClassCastException: java.math.BigInteger cannot be cast to 
java.nio.ByteBuffer

at org.apache.cassandra.db.marshal.UTF8Type.compare(UTF8Type.java:27)
at org.apache.cassandra.dht.LocalToken.compareTo(LocalToken.java:45)
at 
org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:89)
at 
org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:38)

at java.util.TreeMap.getEntry(TreeMap.java:345)
at java.util.TreeMap.containsKey(TreeMap.java:226)
at java.util.TreeSet.contains(TreeSet.java:234)
at 
org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:396)
at 
org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:187)
at 
org.apache.cassandra.io.sstable.SSTableReader$1.run(SSTableReader.java:225)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:636)
ERROR 10:22:16,071 Exception in thread Thread[SSTableBatchOpen:2,5,main]
java.lang.ClassCastException: java.math.BigInteger cannot be cast to 
java.nio.ByteBuffer

at org.apache.cassandra.db.marshal.UTF8Type.compare(UTF8Type.java:27)
at org.apache.cassandra.dht.LocalToken.compareTo(LocalToken.java:45)
at 
org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:89)
at 
org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:38)

at java.util.TreeMap.getEntry(TreeMap.java:345)
at java.util.TreeMap.containsKey(TreeMap.java:226)
at java.util.TreeSet.contains(TreeSet.java:234)
at 
org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:396)
at 
org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:187)
at 
org.apache.cassandra.io.sstable.SSTableReader$1.run(SSTableReader.java:225)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:636)

Here is the definition of the related table CellMessage:

CREATE TABLE CellMessage (
  id text PRIMARY KEY,
  type text,
  version text,
  content text,
  title text,
  generated text,
  date text
) WITH
  comment='' AND
  comparator=text AND
  read_repair_chance=0.10 AND
  gc_grace_seconds=864000 AND
  default_validation=text AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write='true' AND
  compaction_strategy_class='SizeTieredCompactionStrategy' AND
  compression_parameters:sstable_compression='SnappyCompressor';

CREATE INDEX cellmessage_version ON CellMessage (version);

Such errors occur for most tables I defined...

Thanks very much for your help!
Thierry





Re: ClassCastException during Cassandra server startup

2012-06-29 Thread Thierry Templier

Thanks very much, Yuki, for your answer!

Thierry
That was bug in 1.1.1 and fixed in 
https://issues.apache.org/jira/browse/CASSANDRA-4331.
Workaround is deleting the key cache files for your index CFs should 
fix this.



Yuki


Re: Enable CQL3 from Astyanax

2012-06-27 Thread Thierry Templier

Hello Aaron,

Thanks very much for your answer!

Could you give me some hints on how implement that? So I could 
contribute a patch for that.


After having a look at the Astyanax code, I saw that CQL is executed in 
the ThriftColumnFamilyQueryImpl class based on the 
org.apache.cassandra.thrift.Cassandra.Client class and its 
execute_cql_query method. Which class from Cassandra do I need to use 
for CQL3? I'll go on investigating this aspect.


Cheers,
Thierry


Had a quick look, the current master does not appear to support it.

Cheers

-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 26/06/2012, at 7:46 AM, Thierry Templier wrote:


Hello,

How can I enable CQL3 support in Astyanax? Thanks very much for your 
help!


Thierry







Re: Enable CQL3 from Astyanax

2012-06-27 Thread Thierry Templier

Hello Aaron,

I created an issue on the Astyanax github for this problem. I added a 
fix to support CQL3 in the tool.

See the link https://github.com/Netflix/astyanax/issues/75.

Thierry


Had a quick look, the current master does not appear to support it.

Cheers


Migrate keyspace from version 1.0.8 to 1.1.1

2012-06-25 Thread Thierry Templier

Hello,

What is the correct way to migrate a keyspace version 1.0.8 to 1.1.1? Is 
there a documentation on this subject?


Thanks for your help.
Thierry


Re: cqlsh commands

2012-06-25 Thread Thierry Templier

Hello Paul,

I thought but I can't reproduce the problem anymore... Don't know what 
really happens.


Thanks very much for your message!
Thierry
What do you mean when you say you can't display the related 
documentations using the help command?  What does cqlsh do instead?  I 
don't know about any bugs in that area.


p




Enable CQL3 from Astyanax

2012-06-25 Thread Thierry Templier

Hello,

How can I enable CQL3 support in Astyanax? Thanks very much for your help!

Thierry


No lowercase with CQL when using create table

2012-06-20 Thread Thierry Templier

Hello,

I'm using CQL 3 to create column families within a keyspace with 
Cassandra 1.1.1. Column families are
created but all names (column families and their column definitions) are 
in lowercase. Is it possible to prevent

from this behavior?

Thanks very much for your help.
Thierry


cqlsh commands

2012-06-20 Thread Thierry Templier

Hello,

I'm using cqlsh tool to create column families and it works fine. 
However I don't know how to use the following commands:


Documented commands (type help topic):

ASSUME  CAPTURE  DESC  DESCRIBE  EXIT  HELP  SELECT  SHOW  SOURCE  USE

Moreover I can't display the related documentations using the help command.

Thanks very much for your help.
Thierry


Re: No lowercase with CQL when using create table

2012-06-20 Thread Thierry Templier

Thanks very much, Sylvain, for the hints.
Thierry
Yes, you have to use double quotes in CQL3 to force the case of an 
identifier (so CREATE TABLE FooBar rather than CREATE TABLE FooBar). 
-- Sylvain