Return-Path: Delivered-To: apmail-hadoop-hbase-issues-archive@minotaur.apache.org Received: (qmail 89066 invoked from network); 13 Apr 2010 21:16:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 21:16:15 -0000 Received: (qmail 21020 invoked by uid 500); 13 Apr 2010 21:16:15 -0000 Delivered-To: apmail-hadoop-hbase-issues-archive@hadoop.apache.org Received: (qmail 20977 invoked by uid 500); 13 Apr 2010 21:16:15 -0000 Mailing-List: contact hbase-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hbase-issues@hadoop.apache.org Received: (qmail 20904 invoked by uid 99); 13 Apr 2010 21:16:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 21:16:15 +0000 X-ASF-Spam-Status: No, hits=-1280.8 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 21:16:13 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3DLFr4M009490 for ; Tue, 13 Apr 2010 17:15:53 -0400 (EDT) Message-ID: <9452251.73611271193353690.JavaMail.jira@thor> Date: Tue, 13 Apr 2010 17:15:53 -0400 (EDT) From: "Jonathan Gray (JIRA)" To: hbase-issues@hadoop.apache.org Subject: [jira] Commented: (HBASE-2438) Addition of a Column Pagination Filter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856619#action_12856619 ] Jonathan Gray commented on HBASE-2438: -------------------------------------- Patch looks pretty good. One problem I see is that when you deserialize you set page and pageSize, but the offset (which is used) is not calculated like it is in the non-empty constructor. So looks like this will break once serialized (if I read the code correctly). Is there a way we can also have a unit test which would show that? Also, in the main filter call: {noformat} + public ReturnCode filterKeyValue(KeyValue v) + { + ReturnCode code = (count < offset || count >= offset + pageSize) ? ReturnCode.SKIP : ReturnCode.INCLUDE; + count++; + return code; + } {noformat} This code is a bit hard to read. Also, once you are passed the offset + pageSize, shouldn't you be sending the ReturnCode.NEXT_ROW since you don't want to include anything more in the current row? Count isn't used once you get passed the offset either so maybe this could be rewritten more like: {noformat} + public ReturnCode filterKeyValue(KeyValue v) + { + if(count >= offset + pageSize) { + return ReturnCode.NEXT_ROW; + } + ReturnCode code = count < offset ? ReturnCode.SKIP : ReturnCode.INCLUDE; + count++; + return code; + } {noformat} Good stuff guys. > Addition of a Column Pagination Filter > -------------------------------------- > > Key: HBASE-2438 > URL: https://issues.apache.org/jira/browse/HBASE-2438 > Project: Hadoop HBase > Issue Type: New Feature > Components: filters > Affects Versions: 0.20.3 > Reporter: Paul Kist > Attachments: hbase-2438-0.20.3.patch > > Original Estimate: 8h > Remaining Estimate: 8h > > Client applications may need to do pagination, depending on the number of columns returned, it may be more efficient to perform pagination algorithms at the database level (similar to SQL's LIMIT and OFFSET). This will be an additional filter taking two parameters: > - page > - pageSize > For every row, that gets returned, only a subset of columns are returned based on page and pageSize > If the page / pageSize column goes over the limits, then no results are returned from the filter. > A practical example for using a filter like this may be for folks doing Row-based indexing with Hbase. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira