You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Joshua Partogi <jo...@gmail.com> on 2011/02/23 08:11:02 UTC

Is it possible to get list of row keys?

Hi,

Assuming the application does not know the list of keys that is stored
inside cassandra, how would it be possible to get list of row keys?
This list of row keys is going to be used to get a range of slices.

Thank you for your help.

-- 
http://twitter.com/jpartogi

Re: Is it possible to get list of row keys?

Posted by Ching-Cheng Chen <cc...@evidentsoftware.com>.
You can use the setRowCount() method to specify how many keys to return per
call.
By default is 100.

Beware don't set it too high since it might cause OOM.

And underline code will pre-allocate an array list with size you speify in
setRowCount().   So you might get a OOM if
you used something like Interger.MAX.

Regards,

Chen

www.evidentsoftware.com

On Wed, Feb 23, 2011 at 2:24 AM, Roshan Dawrani <ro...@gmail.com>wrote:

> Does it help:
> https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/RangeSlicesQueryTest.java
>
>
> <https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/RangeSlicesQueryTest.java>It
> uses setReturnKeysOnly()...
>
> Same for index queries in:
> https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/IndexedSlicesQueryTest.java
>
> I think it will not return all keys from the ColumnFamily at one shot (as
> with rows)
>
> So, if you want all, you will need to keep paging forward and collecting
> the keys.
>
> On Wed, Feb 23, 2011 at 12:41 PM, Joshua Partogi <jo...@gmail.com>wrote:
>
>> Hi,
>>
>> Assuming the application does not know the list of keys that is stored
>> inside cassandra, how would it be possible to get list of row keys?
>> This list of row keys is going to be used to get a range of slices.
>>
>> Thank you for your help.
>>
>> --
>> http://twitter.com/jpartogi
>>
>
>
>
> --
> Roshan
> Blog: http://roshandawrani.wordpress.com/
> Twitter: @roshandawrani <http://twitter.com/roshandawrani>
> Skype: roshandawrani
>
>

Re: Is it possible to get list of row keys?

Posted by Roshan Dawrani <ro...@gmail.com>.
Does it help:
https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/RangeSlicesQueryTest.java

<https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/RangeSlicesQueryTest.java>It
uses setReturnKeysOnly()...

Same for index queries in:
https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/IndexedSlicesQueryTest.java

I think it will not return all keys from the ColumnFamily at one shot (as
with rows)

So, if you want all, you will need to keep paging forward and collecting the
keys.

On Wed, Feb 23, 2011 at 12:41 PM, Joshua Partogi <jo...@gmail.com>wrote:

> Hi,
>
> Assuming the application does not know the list of keys that is stored
> inside cassandra, how would it be possible to get list of row keys?
> This list of row keys is going to be used to get a range of slices.
>
> Thank you for your help.
>
> --
> http://twitter.com/jpartogi
>



-- 
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani <http://twitter.com/roshandawrani>
Skype: roshandawrani

Re: Is it possible to get list of row keys?

Posted by Joshua Partogi <jo...@gmail.com>.
Hi Buddha system

It is updated.

Kind regards,
Joshua.

On Thu, Feb 24, 2011 at 12:41 PM, buddhasystem <po...@bnl.gov> wrote:
>
> Is your data updated or large chunks are read-only?
> --
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Is-it-possible-to-get-list-of-row-keys-tp6055419p6058764.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>



-- 
http://twitter.com/jpartogi

Re: Is it possible to get list of row keys?

Posted by buddhasystem <po...@bnl.gov>.
Is your data updated or large chunks are read-only?
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Is-it-possible-to-get-list-of-row-keys-tp6055419p6058764.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.