incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Shook <jsh...@gmail.com>
Subject Re: Range search on keys not working?
Date Wed, 02 Jun 2010 14:17:23 GMT
Can you clarify what you mean by 'random between nodes' ?

On Wed, Jun 2, 2010 at 8:15 AM, David Boxenhorn <david@lookin2.com> wrote:
> I see. But we could make this work if the random partitioner was random only
> between nodes, but was still ordered within each node. (Or if there were
> another partitioner that did this.) That way we could get everything we need
> from each node separately. The results would not be ordered, but they would
> be correct.
>
> On Wed, Jun 2, 2010 at 4:09 PM, Sylvain Lebresne <sylvain@yakaz.com> wrote:
>>
>> > So why do the "start" and "finish" range parameters exist?
>>
>> Because especially if you want to iterate over all your key (which as
>> stated by Ben above
>> is the only meaningful way to use get_range_slices() with the random
>> partitionner), you'll
>> want to paginate that. And that's where the 'start' and 'finish' are
>> useful (to be fair,
>> the 'finish' part is not so useful in practice with the random
>> partitioner).
>>
>> --
>> Sylvain
>>
>> >
>> > On Wed, Jun 2, 2010 at 3:53 PM, Ben Browning <ben324@gmail.com> wrote:
>> >>
>> >> Martin,
>> >>
>> >> On Wed, Jun 2, 2010 at 8:34 AM, Dr. Martin Grabmüller
>> >> <Martin.Grabmueller@eleven.de> wrote:
>> >> > I think you can specify an end key, but it should be a key which does
>> >> > exist
>> >> > in your column family.
>> >>
>> >>
>> >> Logically, it doesn't make sense to ever specify an end key with
>> >> random partitioner. If you specified a start key of "aaa" and and end
>> >> key of "aac" you might get back as results "aaa", "zfc", "hik", etc.
>> >> And, even if you have a key of "aab" it might not show up. Key ranges
>> >> only make sense with order-preserving partitioner. The only time to
>> >> ever use a key range with random partitioner is when you want to
>> >> iterate over all keys in the CF.
>> >>
>> >> Ben
>> >>
>> >>
>> >> > But maybe I'm off the track here and someone else here knows more
>> >> > about
>> >> > this
>> >> > key range stuff.
>> >> >
>> >> > Martin
>> >> >
>> >> > ________________________________
>> >> > From: David Boxenhorn [mailto:david@lookin2.com]
>> >> > Sent: Wednesday, June 02, 2010 2:30 PM
>> >> > To: user@cassandra.apache.org
>> >> > Subject: Re: Range search on keys not working?
>> >> >
>> >> > In other words, I should check the values as I iterate, and stop
>> >> > iterating
>> >> > when I get out of range?
>> >> >
>> >> > I'll try that!
>> >> >
>> >> > On Wed, Jun 2, 2010 at 3:15 PM, Dr. Martin Grabmüller
>> >> > <Martin.Grabmueller@eleven.de> wrote:
>> >> >>
>> >> >> When not using OOP, you should not use something like 'CATEGORY/'
as
>> >> >> the
>> >> >> end key.
>> >> >> Use the empty string as the end key and limit the number of returned
>> >> >> keys,
>> >> >> as you did with
>> >> >> the 'max' value.
>> >> >>
>> >> >> If I understand correctly, the end key is used to generate an end
>> >> >> token
>> >> >> by
>> >> >> hashing it, and
>> >> >> there is not the same correspondence between 'CATEGORY' and
>> >> >> 'CATEGORY/'
>> >> >> as
>> >> >> for
>> >> >> hash('CATEGORY') and hash('CATEGORY/').
>> >> >>
>> >> >> At least, this was the explanation I gave myself when I had the
same
>> >> >> problem.
>> >> >>
>> >> >> The solution is to iterate through the keys by always using the
last
>> >> >> key
>> >> >> returned as the
>> >> >> start key for the next call to get_range_slices, and the to drop
the
>> >> >> first
>> >> >> element from
>> >> >> the result.
>> >> >>
>> >> >> HTH,
>> >> >>   Martin
>> >> >>
>> >> >> ________________________________
>> >> >> From: David Boxenhorn [mailto:david@lookin2.com]
>> >> >> Sent: Wednesday, June 02, 2010 2:01 PM
>> >> >> To: user@cassandra.apache.org
>> >> >> Subject: Re: Range search on keys not working?
>> >> >>
>> >> >> The previous thread where we discussed this is called, "key is
>> >> >> sorted?"
>> >> >>
>> >> >>
>> >> >> On Wed, Jun 2, 2010 at 2:56 PM, David Boxenhorn <david@lookin2.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> I'm not using OPP. But I was assured on earlier threads (I
asked
>> >> >>> several
>> >> >>> times to be sure) that it would work as stated below: the results
>> >> >>> would not
>> >> >>> be ordered, but they would be correct.
>> >> >>>
>> >> >>> On Wed, Jun 2, 2010 at 2:51 PM, Torsten Curdt <tcurdt@vafer.org>
>> >> >>> wrote:
>> >> >>>>
>> >> >>>> Sounds like you are not using an order preserving partitioner?
>> >> >>>>
>> >> >>>> On Wed, Jun 2, 2010 at 13:48, David Boxenhorn <david@lookin2.com>
>> >> >>>> wrote:
>> >> >>>> > Range search on keys is not working for me. I was
assured in
>> >> >>>> > earlier
>> >> >>>> > threads
>> >> >>>> > that range search would work, but the results would
not be
>> >> >>>> > ordered.
>> >> >>>> >
>> >> >>>> > I'm trying to get all the rows that start with "CATEGORY."
>> >> >>>> >
>> >> >>>> > I'm doing:
>> >> >>>> >
>> >> >>>> > String start = "CATEGORY.";
>> >> >>>> > .
>> >> >>>> > .
>> >> >>>> > .
>> >> >>>> > keyspace.getSuperRangeSlice(columnParent, slicePredicate,
start,
>> >> >>>> > "CATEGORY/", max)
>> >> >>>> > .
>> >> >>>> > .
>> >> >>>> > .
>> >> >>>> >
>> >> >>>> > in a loop, setting start to the last key each time
- but I'm
>> >> >>>> > getting
>> >> >>>> > rows
>> >> >>>> > that don't start with "CATEGORY."!!
>> >> >>>> >
>> >> >>>> > How do I get all rows that start with "CATEGORY."?
>> >> >>>
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>

Mime
View raw message