From user-return-18479-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Jul 7 01:20:12 2011 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30FC66D65 for ; Thu, 7 Jul 2011 01:20:12 +0000 (UTC) Received: (qmail 60318 invoked by uid 500); 7 Jul 2011 01:20:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 60083 invoked by uid 500); 7 Jul 2011 01:20:09 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 60075 invoked by uid 99); 7 Jul 2011 01:20:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 01:20:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a47.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 01:20:02 +0000 Received: from homiemail-a47.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTP id 56BBF28406E for ; Wed, 6 Jul 2011 18:19:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=subject :references:from:content-type:in-reply-to:message-id:date:to :content-transfer-encoding:mime-version; q=dns; s= thelastpickle.com; b=d84orJpHcso8RO+no+pFUY/IKcccD8vIagdPbUslmpg 6QKTF/+xjDsw2OVqrDljjWxz4u5//0C3ZC09z8t2BRutecWlVKwF1M8PCBwJA4zJ CS/YY2/CEWu5zPzFp2GX7k+BPmXiWoI/d2e6bjxp+uFdd1BWZtcvDGQGj9/lPsh4 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h= subject:references:from:content-type:in-reply-to:message-id:date :to:content-transfer-encoding:mime-version; s=thelastpickle.com; bh=cVveoY+AoYxdjCwL9SfNQDBSslk=; b=VGab58nDhHFBC2lFOgQaa+h1W7Dc QXi8Kzng6NN2z+aXmrPHM8R7r8G/HdfvCSAkZ2qqJ1Mcqukzb2uTXEhv4kHywuBO oc/ldWMhlJJhxrGCZL0SQxfuUwULvz4pmZ/Men8b+E9LuGeH0EEI3tlNtmz1Wobf ExQV/x7GONSRsrI= Received: from [115.189.55.21] (unknown [115.189.55.21]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTPSA id 7850628405B for ; Wed, 6 Jul 2011 18:19:40 -0700 (PDT) Subject: Re: Problems Iterating over tokens in > 0.7.5 References: From: Aaron Morton Content-Type: multipart/alternative; boundary=Apple-Mail-1-981905574 X-Mailer: iPad Mail (8J3) In-Reply-To: Message-Id: <3021EEF3-23BE-4E64-AAE8-F3A27FBAD6F3@thelastpickle.com> Date: Thu, 7 Jul 2011 13:19:37 +1200 To: "user@cassandra.apache.org" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPad Mail 8J3) --Apple-Mail-1-981905574 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii If you still have problems send through some details of where you get incorr= ect results. Cheers ----------------- Aaron Morton Freelance Cassandra Developer @aaronmorton http://www.thelastpickle.com On 6/07/2011, at 3:23 AM, Anand Somani wrote: > Hi, >=20 > Using thrift and get_range_slices call with tokenrange. Using Random Parti= onioner. Have only tried this on > 0.7.5 > Used to work in 0.6.4 or earlier version for me , but I notice that it doe= s not work for me anymore. The need is to iterate over a token range to do s= ome bookkeeping.=20 > The logic is use=20 > TokenRange from describe_ring=20 > and then for each range=20 > set the start and end token > get a batch of rows using get_range_slices > Then use the last token from the batch to set the start_token and repeat (= get the next batch). iterate until no more to get (or last from new batch is= same as last from previous batch) > Now this works when in a test I insert n records and then for iterating us= e a batch size m such that m > n. As soon as I use m < n, I get incorrect co= unt or an infinite loop where the range seems to repeat. >=20 > Anybody seen this issue or am I using it incorrectly for newer versions of= cassandra? I will also look up how this is done in Hector, but in the meant= ime if somebody has seen this behavior, please do respond. >=20 > Thanks > Anand >=20 > =20 --Apple-Mail-1-981905574 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=utf-8
If you still have problems send through some details of where you get incorrect results.

Cheers

-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton

On 6/07/2011, at 3:23 AM, Anand Somani <meatforums@gmail.com> wrote:

Hi,

Using thrift and get_range_slices call with tokenrange. Using Random Partionioner. Have only tried this on > 0.7.5
Used to work in 0.6.4 or earlier version for me , but I notice that it does not work for me anymore. The need is to iterate over a token range to do some bookkeeping.
The logic is use
  1. TokenRange from describe_ring
  2. and then for each range
    1. set the start and end token
    2. get a batch of rows using get_range_slices
    3. Then use the last token from the batch to set the start_token and repeat (get the next batch). iterate until no more to get (or last from new batch is same as last from previous batch)
Now this works when in a test I insert n records and then for iterating use a batch size m such that m > n. As soon as I use m < n, I get incorrect count or an infinite loop where the range seems to repeat.

Anybody seen this issue or am I using it incorrectly for newer versions of cassandra? I will also look up how this is done in Hector, but in the meantime if somebody has seen this behavior, please do respond.

Thanks
Anand

 
--Apple-Mail-1-981905574--