From cassandra-user-return-430-apmail-incubator-cassandra-user-archive=incubator.apache.org@incubator.apache.org Thu Aug 13 01:22:22 2009 Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 86300 invoked from network); 13 Aug 2009 01:22:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Aug 2009 01:22:22 -0000 Received: (qmail 74489 invoked by uid 500); 13 Aug 2009 01:22:28 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 74470 invoked by uid 500); 13 Aug 2009 01:22:28 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 74461 invoked by uid 99); 13 Aug 2009 01:22:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 01:22:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of langram@gmail.com designates 209.85.221.192 as permitted sender) Received: from [209.85.221.192] (HELO mail-qy0-f192.google.com) (209.85.221.192) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 01:22:20 +0000 Received: by mail-qy0-f192.google.com with SMTP id 30so377205qyk.32 for ; Wed, 12 Aug 2009 18:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=WyEt6CTYqGuvtr9ReoHHAvGQ26vTGDNwC2Q57Y00/kk=; b=Bs/DgNUgBkxUoNR/h+y4QwxYe4ugMZ4NdC8gJqC/jAXmXYVNJjpkYj1X83+Wx9cEzR uh0UNV3YCQWJmpHGA9r7uNYIbseVJja4/czHzjlYIPYtGUV0j0fvnEMOQXyg8tHeGtnR AymhmYI90nUeD2WG1cnKoJUnoH7vyrg81ca1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tUUv4KK7YAD4PP32cy4YrXe1s6bGf8kIH2SHOETf+T2TfJ8Zv4hOUI6wnJI5yzYnQw xfPok0oRKIXkVAcNIeYQXtGU6rAuEcXbtu0gTM6efiJWfXXNEfSxBRg+jOgrZEKY2bPe ERTstAnU2+UPqYDTH2H20MsGBdci2UJ4wJqvg= MIME-Version: 1.0 Received: by 10.229.3.12 with SMTP id 12mr646387qcl.98.1250126520222; Wed, 12 Aug 2009 18:22:00 -0700 (PDT) In-Reply-To: References: <3bb1d9610908112037v17b852ev9dc0b8798969061a@mail.gmail.com> Date: Thu, 13 Aug 2009 09:22:00 +0800 Message-ID: <3bb1d9610908121822n5a3dbd8csfc43f1d3e9758de7@mail.gmail.com> Subject: Re: New thrift api question. From: Tangram Liu To: cassandra-user@incubator.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your reply. But I really don't want to use a ugly "next" button or just only capable return 100 results in 10 pages. I just can't understan= d why cassandra's new api remove this useful feature and replace with the new one. Pagination is an extremely common use case scenario in web app programming. almost every web app need =93one to many=94 data model. when the =93many=94= part is too many to fit in one page, paginate is the best way to resolve it. in mos= t case, we don't need query or sort the result in a complicated way. we just need save them in time or alphabetic order, view first 20 records and provide an paginator at the bottom for the others. this is one reason why enhanced key-value(pure k-v db is too sample and relational db is too comprehensive, we need something between them) database coming popular recent year. i think one of the most basic function the enhanced k-v db should provide is the capability to define 'one to many' relationship(many to many relationship can build with two 'one to many' list). the old api can build 'one to many' list in a very sample way - just use 'one' part as key, and 'many' part as a list of columns which sort in time or alphabetic order and paginate them with start and count parameters. with new api i just can't figure out how to build it. could anyone here tell me why new api abandon the old design? how to build 'one to many' relationship in a effective way with new api? what data model should i use? thank? 2009/8/13 Jonathan Ellis > The easy way is to just show one page of results and have a Next > button that uses start=3Dlast one from current page. > > The slightly harder way if you want to show say 10 links to the next > 10 pages is, you have to select 10 pages worth of data and manually > offset into that. > > -Jonathan > > On Tue, Aug 11, 2009 at 10:37 PM, Tangram Liu wrote: > > Hi, there! I'm new to cassandra. and I think it fascinating. > > > > I got a question here: > > > > image a simple blog host app base on cassandra with the following data > > model: > > > > > > > > > > > > > > > > for each new blog article, insert with blog name as the key, article > title > > as the column name and article content as value. > > > > here is the question: how can i build a blog paginator with new api? > > > > with old api, i can simple use get_slice to get what i want(start=3Dpag= e > > offset, count=3D row per page). but new api, however, change the start > > parameter type from int to string. how can i build a paginate function > with > > new api? >