deleting keys

2011-07-05 Thread karim abbouh
i use  get_range_slice to get the list of keys,
then i call  client.remove(keyspace, key, columnFamily, timestamp, 
ConsistencyLevel.ALL);
to delete the record
but i still have the keys.
why?
can i do it otherwise?


Re : Re : Re : get_range_slices result

2011-06-30 Thread karim abbouh
what i want is that i get the records in the same order wich they were inserted.
how can i get this using any type of comparator type
if there is a code java for this it can be useful.




De : aaron morton aa...@thelastpickle.com
À : user@cassandra.apache.org
Envoyé le : Mardi 28 Juin 2011 12h40
Objet : Re: Re : Re : get_range_slices result


First thing is you really should upgrade from 0.6, the current release is 0.8. 

Info on time uuid's
http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java

If you are using a higher level client like Hector or Pelops it will take care 
of encoding for you. 

Cheers


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

On 28 Jun 2011, at 22:20, karim abbouh wrote:

can i have an example for using    TimeUUIDType   as comparator in a client  
java code.





De : karim abbouh karim_...@yahoo.fr
À : user@cassandra.apache.org user@cassandra.apache.org
Envoyé le : Lundi 27 Juin 2011 17h59
Objet : Re : Re : get_range_slices result


i used TimeUUIDType as type in storage-conf.xml file

 ColumnFamily Name=table CompareWith=TimeUUIDType /


and i used it as comparator in my java code,
but in the execution i get exception : 

Erreur --java.io.UnsupportedEncodingException: TimeUUIDType




how can i write it?


BR





De : David Boxenhorn da...@citypath.com
À : user@cassandra.apache.org
Cc : karim abbouh karim_...@yahoo.fr
Envoyé le : Vendredi 24 Juin 2011 11h25
Objet : Re: Re : get_range_slices result

You can get the best of both worlds by repeating the key in a column,
and creating a secondary index on that column.

On Fri, Jun 24, 2011 at 1:16 PM, Sylvain Lebresne sylv...@datastax.com wrote:
 On Fri, Jun 24, 2011 at 10:21 AM, karim abbouh karim_...@yahoo.fr wrote:
 i want get_range_slices() function returns records sorted(orded) 
 by the
 key(rowId) used during the insertion.
 is
 it possible?

 You will have to use the OrderPreservingPartitioner. This is no
 without inconvenience however.
 See for instance
 http://wiki.apache.org/cassandra/StorageConfiguration#line-100 or
 http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
 that give more details on the pros and cons (the short version being
 that the main advantage of
 OrderPreservingPartitioner is what you're asking for, but it's main
 drawback is that load-balancing
 the cluster will likely be very very hard).

 In general the advice is to stick with RandomPartitioner and design a
 data
 model that avoids
 needing
 range slices (or at least needing that the result is sorted). This is
 very often not too hard and more
 efficient, and much more simpler than to deal with the load balancing
 problems of OrderPreservingPartitioner.

 --
 Sylvain


 
 De : aaron morton aa...@thelastpickle.com
 À : user@cassandra.apache.org
 Envoyé le : Jeudi 23 Juin 2011 20h30
 Objet : Re: get_range_slices result

 Not sure what your question is.
 Does this help ? http://wiki.apache.org/cassandra/FAQ#range_rp
 Cheers
 -
 Aaron Morton
 Freelance Cassandra Developer
 @aaronmorton
 http://www.thelastpickle.com
 On 23 Jun 2011, at 21:59, karim abbouh wrote:

 how can get_range_slices() function returns sorting key ?
 BR











Re : Re : get_range_slices result

2011-06-28 Thread karim abbouh
can i have an example for using    TimeUUIDType   as comparator in a client  
java code.




De : karim abbouh karim_...@yahoo.fr
À : user@cassandra.apache.org user@cassandra.apache.org
Envoyé le : Lundi 27 Juin 2011 17h59
Objet : Re : Re : get_range_slices result


i used TimeUUIDType as type in storage-conf.xml file

 ColumnFamily Name=table CompareWith=TimeUUIDType /

and i used it as comparator in my java code,
but in the execution i get exception : 

Erreur --java.io.UnsupportedEncodingException: TimeUUIDType


how can i write it?

BR




De : David Boxenhorn da...@citypath.com
À : user@cassandra.apache.org
Cc : karim abbouh karim_...@yahoo.fr
Envoyé le : Vendredi 24 Juin 2011 11h25
Objet : Re: Re : get_range_slices result

You can get the best of both worlds by repeating the key in a column,
and creating a secondary index on that column.

On Fri, Jun 24, 2011 at 1:16 PM, Sylvain Lebresne sylv...@datastax.com wrote:
 On Fri, Jun 24, 2011 at 10:21 AM, karim abbouh karim_...@yahoo.fr wrote:
 i want get_range_slices() function returns records sorted(orded)  by the
 key(rowId) used during the insertion.
 is
 it possible?

 You will have to use the OrderPreservingPartitioner. This is no
 without inconvenience however.
 See for instance
 http://wiki.apache.org/cassandra/StorageConfiguration#line-100 or
 http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
 that give more details on the pros and cons (the short version being
 that the main advantage of
 OrderPreservingPartitioner is what you're asking for, but it's main
 drawback is that load-balancing
 the cluster will likely be very very hard).

 In general the advice is to stick with RandomPartitioner and design a
 data model that avoids
 needing
 range slices (or at least needing that the result is sorted). This is
 very often not too hard and more
 efficient, and much more simpler than to deal with the load balancing
 problems of OrderPreservingPartitioner.

 --
 Sylvain


 
 De : aaron morton aa...@thelastpickle.com
 À : user@cassandra.apache.org
 Envoyé le : Jeudi 23 Juin 2011 20h30
 Objet : Re: get_range_slices result

 Not sure what your question is.
 Does this help ? http://wiki.apache.org/cassandra/FAQ#range_rp
 Cheers
 -
 Aaron Morton
 Freelance Cassandra Developer
 @aaronmorton
 http://www.thelastpickle.com
 On 23 Jun 2011, at 21:59, karim abbouh wrote:

 how can get_range_slices() function returns sorting key ?
 BR






Re : Re : get_range_slices result

2011-06-27 Thread karim abbouh
i used TimeUUIDType as type in storage-conf.xml file

 ColumnFamily Name=table CompareWith=TimeUUIDType /

and i used it as comparator in my java code,
but in the execution i get exception : 

Erreur --java.io.UnsupportedEncodingException: TimeUUIDType


how can i write it?

BR




De : David Boxenhorn da...@citypath.com
À : user@cassandra.apache.org
Cc : karim abbouh karim_...@yahoo.fr
Envoyé le : Vendredi 24 Juin 2011 11h25
Objet : Re: Re : get_range_slices result

You can get the best of both worlds by repeating the key in a column,
and creating a secondary index on that column.

On Fri, Jun 24, 2011 at 1:16 PM, Sylvain Lebresne sylv...@datastax.com wrote:
 On Fri, Jun 24, 2011 at 10:21 AM, karim abbouh karim_...@yahoo.fr wrote:
 i want get_range_slices() function returns records sorted(orded)  by the
 key(rowId) used during the insertion.
 is it possible?

 You will have to use the OrderPreservingPartitioner. This is no
 without inconvenience however.
 See for instance
 http://wiki.apache.org/cassandra/StorageConfiguration#line-100 or
 http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
 that give more details on the pros and cons (the short version being
 that the main advantage of
 OrderPreservingPartitioner is what you're asking for, but it's main
 drawback is that load-balancing
 the cluster will likely be very very hard).

 In general the advice is to stick with RandomPartitioner and design a
 data model that avoids needing
 range slices (or at least needing that the result is sorted). This is
 very often not too hard and more
 efficient, and much more simpler than to deal with the load balancing
 problems of OrderPreservingPartitioner.

 --
 Sylvain


 
 De : aaron morton aa...@thelastpickle.com
 À : user@cassandra.apache.org
 Envoyé le : Jeudi 23 Juin 2011 20h30
 Objet : Re: get_range_slices result

 Not sure what your question is.
 Does this help ? http://wiki.apache.org/cassandra/FAQ#range_rp
 Cheers
 -
 Aaron Morton
 Freelance Cassandra Developer
 @aaronmorton
 http://www.thelastpickle.com
 On 23 Jun 2011, at 21:59, karim abbouh wrote:

 how can get_range_slices() function returns sorting key ?
 BR






Re : get_range_slices result

2011-06-24 Thread karim abbouh
i want get_range_slices() function returns records sorted(orded)  by the 
key(rowId) used during the insertion.
is it possible?




De : aaron morton aa...@thelastpickle.com
À : user@cassandra.apache.org
Envoyé le : Jeudi 23 Juin 2011 20h30
Objet : Re: get_range_slices result


Not sure what your question is. 

Does this help ? http://wiki.apache.org/cassandra/FAQ#range_rp

Cheers


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

On 23 Jun 2011, at 21:59, karim abbouh wrote:

how can get_range_slices() function returns sorting key ?
BR


get_range_slices result

2011-06-23 Thread karim abbouh
how can get_range_slices() function returns sorting key ?
BR


Re : last record rowId

2011-06-17 Thread karim abbouh
is there any way to remember the keys (rowId) inserted in cassandra database?
B.R




De : Jonathan Ellis jbel...@gmail.com
À : user@cassandra.apache.org
Cc : karim abbouh karim_...@yahoo.fr
Envoyé le : Mercredi 15 Juin 2011 18h05
Objet : Re: last record rowId

You're better served using UUIDs than numeric row IDs for surrogate
keys.  (Of course natural keys work fine too.)

On Wed, Jun 15, 2011 at 9:16 AM, Utku Can Topçu u...@topcu.gen.tr wrote:
 As far as I can tell, this functionality doesn't exist.

 However you can use such a method to insert the rowId into another column
 within a seperate row, and request the latest column.
 I think this would work for you. However every insert would need a get
 request, which I think would be performance issue somehow.

 Regards,
 Utku

 On Wed, Jun 15, 2011 at 11:14 AM, karim abbouh karim_...@yahoo.fr wrote:

 in my java application,when we try to insert we should all the time know
 the last rowId
 in order the insert the new record in rowId+1,so for that we should save
 this rowId in a file
 is there other way to know the last record rowId?
 thanks
 B.R





-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

client API

2011-06-16 Thread karim abbouh
i use jdk1.6 to install and launch cassandra in a linux platform,but can i use 
jdk1.5 for my cassandra Client ?


last record rowId

2011-06-15 Thread karim abbouh
in my java application,when we try to insert we should all the time know the 
last rowId
in order the insert the new record in rowId+1,so for that we should save this 
rowId in a file
is there other way to know the last record rowId?
thanks
B.R


Re : pb deletion

2011-05-31 Thread karim abbouh
i see that the problem happens when i try to remove records from my application 
but these records were created before from CLI.
is there a explication for this?




De : Peter Schuller peter.schul...@infidyne.com
À : user@cassandra.apache.org
Envoyé le : Vendredi 27 Mai 2011 19h05
Objet : Re: pb deletion

 i use cassandra database replicated in two servers,when want to delete a 
 record using this line :
 client.remove(keyspace, sKey, new ColumnPath(columnFamily), timestamp, 
 ConsistencyLevel.ONE);

 but when i check,i see that the record still exist!

Are you using a real timestamp such that the deletion is stamped
higher than the insertion?

--
/ Peter Schuller

pb deletion

2011-05-27 Thread karim abbouh
i use cassandra database replicated in two servers,when want to delete a record 
using this line :
client.remove(keyspace, sKey, new ColumnPath(columnFamily), timestamp, 
ConsistencyLevel.ONE);

but when i check,i see that the record still exist!
any idea

BR

Re : selecting data

2011-05-20 Thread karim abbouh
is there a way to set  for a column of the same key a set of value ?





De : Watanabe Maki watanabe.m...@gmail.com
À : user@cassandra.apache.org user@cassandra.apache.org
Envoyé le : Jeu 19 mai 2011, 17h 38min 39s
Objet : Re: selecting data


Cassandra is not a RDBMS. Only you can do is search on a key, or you need full 
scan.
You need to design your schema carefully as your application needs.



On 2011/05/20, at 1:11, karim abbouh karim_...@yahoo.fr wrote:


i'm new using cassandra database,
i want to get data as in relationnel database:
select * from table where field=value;
i see using CLI we have just the followings commands :
get ksp.cf['key']  Get a slice of 
columns.
get ksp.cf['key']['super']   Get a slice of sub 
columns.
get  ksp.cf['key']['col'] Get a column 
value.
get ksp.cf['key']['super']['col']  Get a sub column 
value.

is there a way for that.
i think using java API is possible.
cassandra version : 6.0.12


thanks for help





Re : Re : selecting data

2011-05-20 Thread karim abbouh
a storage-conf.xml is read just at the starting of cassandra?
is there a way to add a column family dynamically?

BR





De : karim abbouh karim_...@yahoo.fr
À : user@cassandra.apache.org
Envoyé le : Ven 20 mai 2011, 12h 48min 54s
Objet : Re : selecting data


is there a way to set  for a column of the same key a set of value ?





De : Watanabe Maki watanabe.m...@gmail.com
À : user@cassandra.apache.org user@cassandra.apache.org
Envoyé le : Jeu 19 mai 2011, 17h 38min 39s
Objet : Re: selecting data


Cassandra is not a RDBMS. Only you can do is search on a key, or you need full 
scan.
You need  to design your schema carefully as your application needs.



On 2011/05/20, at 1:11, karim abbouh karim_...@yahoo.fr wrote:


i'm new using cassandra database,
i want to get data as in relationnel database:
select * from table where field=value;
i see using CLI we have just the followings commands :
get ksp.cf['key']  Get a slice of 
columns.
get  ksp.cf['key']['super']   Get a slice of sub 
columns.
get  ksp.cf['key']['col'] Get a column 
value.
get ksp.cf['key']['super']['col']  Get a sub column 
value.

is there a way for that.
i think using java API is possible.
cassandra version : 6.0.12


thanks for help