Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-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 13E0A97B4 for ; Thu, 24 May 2012 13:13:37 +0000 (UTC) Received: (qmail 26052 invoked by uid 500); 24 May 2012 13:13:35 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 26003 invoked by uid 500); 24 May 2012 13:13:35 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 25995 invoked by uid 99); 24 May 2012 13:13:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 13:13:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_FONT_SIZE_LARGE,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dwivedishashwat@gmail.com designates 209.85.216.41 as permitted sender) Received: from [209.85.216.41] (HELO mail-qa0-f41.google.com) (209.85.216.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 13:13:30 +0000 Received: by qabg27 with SMTP id g27so4973841qab.14 for ; Thu, 24 May 2012 06:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sGEkZjnZ4dkhsnOhaM1quNkEilScfXacHD7VlGm0iCc=; b=XGazR7I5aZ3WHmMz5mDbUW3bhSze96MTxPDDJ9cdyg1gkkclpa79Xj+ktllFlBPb1j 5jtIvcV25subl66h0ZTccuRzgVitDbnZqmksrwd51HkK3FdHQYvi19x60ge+L9K143rA gzkfiz/gKx6B3sYl/19bTcDU5mtTPmO8yQZX7LkgJwcMVfoa6ltR/odmRaxceNl5R32C Sl6Mn7jOaNmGl+7WamRSSAA9znFyubammJaNRhN4PuB7mKSogUgib0RvDPL8Ze1wtex7 W8iCLHgKiHMUncCtWaC5keqG07+NDb8oPa9XjECt4U/oisBuHMC4BLBjnWSCkBVsgTAy 1xLw== MIME-Version: 1.0 Received: by 10.224.220.13 with SMTP id hw13mr963644qab.10.1337865190228; Thu, 24 May 2012 06:13:10 -0700 (PDT) Received: by 10.229.191.7 with HTTP; Thu, 24 May 2012 06:13:10 -0700 (PDT) In-Reply-To: References: <33901703.post@talk.nabble.com> Date: Thu, 24 May 2012 18:43:10 +0530 Message-ID: Subject: Re: Pagination in hbase From: shashwat shriparv To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=20cf3074b4c66bc2bd04c0c80367 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074b4c66bc2bd04c0c80367 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Check out this link : http://www.360doc.com/content/09/1215/22/454430_11218539.shtml or you can try this also Filter filter =3D new PageFilter(15); int totalRows =3D 0; byte[] lastRow =3D null; while (true) { Scan scan =3D new Scan(); scan.setFilter(filter); if (lastRow !=3D null) { byte[] startRow =3D Bytes.add(lastRow, POSTFIX); System.out.println("start row: " + Bytes.toStringBinary(startRow)); scan.setStartRow(startRow); } ResultScanner scanner =3D table.getScanner(scan); int localRows =3D 0; Result result; while ((result =3D scanner.next()) !=3D null) { System.out.println(localRows++ + ": " + result); totalRows++; lastRow =3D result.getRow(); } scanner.close(); if (localRows =3D=3D 0) break; } System.out.println("total rows: " + totalRows); On Thu, May 24, 2012 at 6:24 PM, Srikanth P. Shreenivas < Srikanth_Shreenivas@mindtree.com> wrote: > Look at > > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#= setCaching(int) > > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#= setBatch(int) > > Regards, > Srikanth > > -----Original Message----- > From: vishnupriyaa [mailto:vpatoffice@gmail.com] > Sent: Thursday, May 24, 2012 6:21 PM > To: hbase-user@hadoop.apache.org > Subject: Pagination in hbase > > > Hi, > > In my hbase table I have around 10000 data ,need to fetch first 100 then > next 100 row like that.How can I run a java code to fetch like that, by > setting limit and offset. > > -- > View this message in context: > http://old.nabble.com/Pagination-in-hbase-tp33901703p33901703.html > Sent from the HBase User mailing list archive at Nabble.com. > > > ________________________________ > > http://www.mindtree.com/email/disclaimer.html > --=20 =E2=88=9E Shashwat Shriparv --20cf3074b4c66bc2bd04c0c80367--