incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karim abbouh <karim_...@yahoo.fr>
Subject Re : Re : get_range_slices result
Date Tue, 28 Jun 2011 10:20:44 GMT
can i have an example for using    TimeUUIDType   as comparator in a client  java code.



________________________________
De : karim abbouh <karim_rbt@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 <david@citypath.com>
À : user@cassandra.apache.org
Cc : karim abbouh <karim_rbt@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 <sylvain@datastax.com> wrote:
> On Fri, Jun 24, 2011 at 10:21 AM, karim abbouh <karim_rbt@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 <aaron@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
>>
>>
>>
>>
>
Mime
View raw message