hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Gray (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-3453) How about RowPaginationFilter
Date Thu, 20 Jan 2011 16:43:43 GMT

    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984270#action_12984270
] 

Jonathan Gray commented on HBASE-3453:
--------------------------------------

The code there is returning all the rows back to the client rather than using a server-side
filter.  You won't need to scan every row, but you will need to scan past {{offset}} number
of rows.  Your filter will behave the same way but will prevent the offset lines from being
sent back to the client, which is good.

The issue is as Ryan points out.  Filters do not currently work between regions, so if your
offset or page jumps between regions, it will not work.

> How about RowPaginationFilter
> -----------------------------
>
>                 Key: HBASE-3453
>                 URL: https://issues.apache.org/jira/browse/HBASE-3453
>             Project: HBase
>          Issue Type: Wish
>          Components: client
>    Affects Versions: 0.90.1
>         Environment: windows 7
>            Reporter: ncanis
>         Attachments: RowPaginationFilter.java
>
>
> I know hbase has already PageFilter.
> But, sometime we need to get row data from specified position.
> * only for newbie:
>   If you want to write custom Filter, you also add filter class to an hbase server classpath.
> {code:title=RowPaginationFilter|borderStyle=solid}
> /**
> 	 * Constructor that takes a maximum page size.
> 	 * 
> 	 * get row from offset to offset+limit ( offset<= row<=offset+limit )
> 	 * @param offset start position
> 	 * @param limit count from offset position
> 	 */
> 	public RowPaginationFilter(final int offset, final int limit) {
> 		this.offset = offset;
> 		this.limit = limit;
> 	}
> 	//true to exclude row, false to include row.
> 	@Override
> 	public boolean filterRow() {	
> 	
> 		boolean isExclude = this.rowsAccepted < this.offset || this.rowsAccepted>=this.limit+this.offset;
> 		rowsAccepted++;
> 		return isExclude;
> 	}
> {code}
> -----------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message