From user-return-8428-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Aug 12 21:03:47 2010 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 91713 invoked from network); 12 Aug 2010 21:03:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Aug 2010 21:03:47 -0000 Received: (qmail 41553 invoked by uid 500); 12 Aug 2010 21:03:45 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 41500 invoked by uid 500); 12 Aug 2010 21:03:44 -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 41492 invoked by uid 99); 12 Aug 2010 21:03:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Aug 2010 21:03:44 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a54.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Aug 2010 21:03:36 +0000 Received: from homiemail-a54.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a54.g.dreamhost.com (Postfix) with ESMTP id 6621A3A406B for ; Thu, 12 Aug 2010 14:03:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=to:from :subject:message-id:content-type:mime-version:in-reply-to:date; q=dns; s=thelastpickle.com; b=y2z9zj8AlmVch6ER641SnJxvF8JaDO75S AnDypmOjoQ9aPPSk2HJcWkdun/ZY4KGjJ67j/Bh4Ldz2Fztx2pMJnV6xu6PCpI6N kR7q5QfNNYyveNozfwsAD7aX0xiTUnxOCtczn7v4Mb1WOZ0EjYB/bY9SdLvqhuoc acfyLtkDFg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=to :from:subject:message-id:content-type:mime-version:in-reply-to: date; s=thelastpickle.com; bh=UBwa2isseOpruNj0NNSiuKvQdSU=; b=Ra AvBpgme+hk74t51VSOqSMdsiEQ37ymA0CkgkaWuuwRRTNTsts02GkUp/yKzmICBQ FClyDd1l4s6vVNuCSoewiLJHUAC9TH6aXLKcoelNNe2qTLy8+jrCwQeL8RneN7zA kNlsRY3M0xdo5AAZO7v+KPHvv4qgdamdizb0noHyI= Received: from localhost (webms.mac.com [17.148.16.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a54.g.dreamhost.com (Postfix) with ESMTPSA id 5AD3A3A4065 for ; Thu, 12 Aug 2010 14:03:13 -0700 (PDT) To: user@cassandra.apache.org From: Aaron Morton Subject: Re: Can I retrieve specific key range from a table in RandomPartitioner? X-Mailer: MobileMe Mail (1C2644) Message-id: <8db5b4e3-dcc0-ea0f-bede-92a5d9ad8a21@me.com> Content-Type: multipart/alternative; boundary=Apple-Webmail-42--54c97a26-f584-425e-f8ee-c0952f751662 MIME-Version: 1.0 In-Reply-To: Date: Thu, 12 Aug 2010 14:03:13 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Webmail-42--54c97a26-f584-425e-f8ee-c0952f751662 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed Try setting the end key to an empty string, and then set the number of row= s to something sane and make multiple calls if needed. Or you may be able = to make your own secondary index another CF, so you do two reads: one on t= he secondary index then one of the rows you want.=0A=0AThere has been some= discussion about range slices with RP recently that may be helpful see=A0= http://www.mail-archive.com/user@cassandra.apache.org/msg05017.html=0A=0A=0A= Aaron=0A=0AOn 12 Aug, 2010,at 08:50 PM, ChingShen wrote:=0A=0AI have a key range that between 0000000000 and 0000001000, a= nd my code as below:=0A=0ASlicePredicate predicate =3D new SlicePredicate(= );=0Apredicate.setColumn_names(columns);=0AColumnParent parent =3D new Col= umnParent(columnFamily);=0AKeyRange k =3D new KeyRange(1000);=0Ak.setStart= _key(key[0]);=0Ak.setEnd_key(key[1000]);=0AList results =3D clie= nt.get_range_slices(keyspace, parent, predicate, k, ConsistencyLevel.ONE);= =A0=A0=A0 =A0=A0=A0 =0A=0AOn Thu, Aug 12, 2010 at 4:44 PM, ChingShen wrote:=0AHi all,=0A=0A=A0=A0 Can I retrieve specific = key range from a table in RandomPartitioner? Because I always got below ex= ception:=0AException in thread "main" InvalidRequestException(why:start ke= y's md5 sorts after end key's md5.=A0 this is not allowed; you probably sh= ould not specify end key at all, under RandomPartitioner)=0A=0AThanks.=0A=0A= Shen=0A=0A=0A --Apple-Webmail-42--54c97a26-f584-425e-f8ee-c0952f751662 Content-Type: multipart/related; type="text/html"; boundary=Apple-Webmail-86--54c97a26-f584-425e-f8ee-c0952f751662 --Apple-Webmail-86--54c97a26-f584-425e-f8ee-c0952f751662 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1;
Try setting the end key to an empty string, and then set the number o= f rows to something sane and make multiple calls if needed. Or you may be = able to make your own secondary index another CF, so you do two reads: one= on the secondary index then one of the rows you want.

There has been some discussion about range slices with RP recently t= hat may be helpful see http://www.mail-archive.com/user@cassandr= a.apache.org/msg05017.html


Aaron

On 12 Aug, 2010,at 08:50 PM, ChingShen <chingshenchen@gmail.c= om> wrote:

I have a ke= y range that between 0000000000 and 0000001000, and my code as below:
<= br>SlicePredicate predicate =3D new SlicePredicate();
predicate.setColu= mn_names(columns);
ColumnParent parent =3D new ColumnParent(columnFamil= y);
=0AKeyRange k =3D new KeyRange(1000);
k.setStart_key(key[0]);k.setEnd_key(key[1000]);
List<KeySlice> results =3D client.get_r= ange_slices(keyspace, parent, predicate, k, ConsistencyLevel.ONE); &n= bsp;     

=0AOn Thu= , Aug 12, 2010 at 4:44 PM, ChingShen <c= hingshenchen@gmail.com> wrote:
=0AHi all,

&nbs= p;  Can I retrieve specific key range from a table in RandomPartition= er? Because I always got below exception:
Exception in thread "main" In= validRequestException(why:start key's md5 sorts after end key's md5. = this is not allowed; you probably should not specify end key at all, unde= r RandomPartitioner)
=0A=0A
Thanks.

Shen
=0A
<= /div>

=0A
--Apple-Webmail-86--54c97a26-f584-425e-f8ee-c0952f751662-- --Apple-Webmail-42--54c97a26-f584-425e-f8ee-c0952f751662--