hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammad Tariq <donta...@gmail.com>
Subject Re: Pagination with HBase - getting previous page of data
Date Fri, 25 Jan 2013 05:12:32 GMT
Hello sir,

      While paging through, store the startkey of the current page of 25
in a separate byte[]. Now, if you want to come back to this page when you
are at the next page do a range query where  startkey would be the rowkey
you had stored earlier and the endkey would be the startrowkey  of  current
page. You have to store just one rowkey each time you show a page using
which you could come back to this page when you are at the next page.

However, this approach will fail in a case where your user would like to go
to a particular previous page.

Warm Regards,

On Fri, Jan 25, 2013 at 10:28 AM, Vijay Ganesan <vijay@scaligent.com> wrote:

> I'm displaying rows of data from a HBase table in a data grid UI. The grid
> shows 25 rows at a time i.e. it is paginated. User can click on
> Next/Previous to paginate through the data 25 rows at a time. I can
> implement Next easily by setting a HBase
> org.apache.hadoop.hbase.filter.PageFilter and setting startRow on the
> org.apache.hadoop.hbase.client.Scan to be the row id of the next batch's
> row that is sent to the UI with the previous batch. However, I can't seem
> to be able to do the same with Previous. I can set the endRow on the Scan
> to be the row id of the last row of the previous batch but since HBase
> Scans are always in the forward direction, there is no way to set a
> PageFilter that can get 25 rows ending at a particular row. The only option
> seems to be to get *all* rows up to the end row and filter out all but the
> last 25 in the caller, which seems very inefficient. Any ideas on how this
> can be done efficiently?
> --
> -Vijay

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message