incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Re : get_range_slices result
Date Fri, 24 Jun 2011 10:16:20 GMT
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