cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@riptano.com>
Subject Re: How to get all rows inserted
Date Tue, 19 Oct 2010 22:33:16 GMT
I don't think I understand what you're trying to do. Do you want to page
over the whole column
family X rows at a time?  Does it matter if the rows are in order?

- Tyler

On Tue, Oct 19, 2010 at 5:22 PM, Robert <keyboard.operator@gmail.com> wrote:

> I have a similar question.  Is there a way to divide this into multiple
> requests?  I am using Cassandra v0.6.4, RandomPartitioner, and the pycassa
> library.
>
> Can I use get_range_slices with a start_token=0, and then recalculate the
> token from the last value key returned until it equals it loops around the
> entire ring?
>
> cheers,
> --Robert
>
> On Tue, Oct 19, 2010 at 2:02 PM, Aaron Morton <aaron@thelastpickle.com>wrote:
>
>> KeyRange as a count on it, the default is 100.
>>
>> For the ordering, double check you are using the OrderPreserving
>> partitioner It it's still out of order send an example.
>>
>> Cheers
>> Aaron
>>
>> On 20 Oct, 2010,at 09:39 AM, Wicked J <wickedj2010@gmail.com> wrote:
>>
>> Hi,
>> I inserted 500 rows (records) in Cassandra and I'm using the following
>> code to retrieve all the inserted rows. However, I'm able to get only 100
>> rows (in a random order). I'm using Cassandra v0.6.4 with OrderPreserving
>> Partition on a single node/instance.
>> How can I get all the rows inserted? i.e. the other 400 rows.
>>
>> Thanks
>>
>> == Code ==
>>
>> KeyRange keyRange = new KeyRange();
>> keyRange.start_key = start; //1
>> keyRange.end_key = end; //500
>>
>> SliceRange sliceRange = new SliceRange();
>> sliceRange.setStart(new byte[]{});
>> sliceRange.setFinish(new byte[]{});
>>
>> SlicePredicate slicePredicate = new SlicePredicate();
>> slicePredicate.setSlice_range(sliceRange);
>>
>> ColumnParent columnParent = new ColumnParent(COLUMN_FAMILY);
>> keySlices = client.get_range_slices(KEYSPACE, columnParent,
>> slicePredicate, keyRange, ConsistencyLevel.ONE);
>> System.out.println("Key Slice Size="+keySlices.size());
>>
>>
>>
>>
>

Mime
View raw message