You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "jo sung jun (JIRA)" <ji...@apache.org> on 2011/01/20 05:11:43 UTC

[jira] Created: (HBASE-3453) How about RowPaginationFilter

How about RowPaginationFilter
-----------------------------

                 Key: HBASE-3453
                 URL: https://issues.apache.org/jira/browse/HBASE-3453
             Project: HBase
          Issue Type: Improvement
          Components: client
    Affects Versions: 0.20.6
         Environment: windows 7
            Reporter: jo sung jun
             Fix For: 0.20.6


Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
/**
	 * 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;
	}
-----------------

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


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Attachment:     (was: RowPaginationFilter.java)

> 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
>             Fix For: 0.90.0
>
>         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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "jo sung jun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jo sung jun updated HBASE-3453:
-------------------------------

    Attachment: RowPaginationFilter.java

I attach RowPaginationFilter.java

> How about RowPaginationFilter
> -----------------------------
>
>                 Key: HBASE-3453
>                 URL: https://issues.apache.org/jira/browse/HBASE-3453
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.20.6
>         Environment: windows 7
>            Reporter: jo sung jun
>             Fix For: 0.20.6
>
>         Attachments: RowPaginationFilter.java
>
>
> Hello.
> I know hbase has already PageFilter.
> But, sometime we need to get row data from specified position.
> ------------------------
> /**
> 	 * 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;
> 	}
> -----------------

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


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Description: 
{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}
-----------------

  was:
Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
<code>
/**
	 * 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>
-----------------


> How about RowPaginationFilter
> -----------------------------
>
>                 Key: HBASE-3453
>                 URL: https://issues.apache.org/jira/browse/HBASE-3453
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.20.6
>         Environment: windows 7
>            Reporter: ncanis
>             Fix For: 0.20.6
>
>         Attachments: RowPaginationFilter.java
>
>
> {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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984047#action_12984047 ] 

ncanis commented on HBASE-3453:
-------------------------------

why offset lies?, I don't understand your question. please tell me more detaily.

------------------------
if you want to get  5 count from 3position
RowPaginationFilter filter = new RowPaginationFilter(3,5);


> 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
>             Fix For: 0.90.0
>
>         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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984055#action_12984055 ] 

ncanis commented on HBASE-3453:
-------------------------------


if we use ResultScanner for paging, follow code.

(I found from googling)
http://devblog.streamy.com/2009/04/23/hbase-row-key-design-for-paging-limit-offset-queries/

that will be extremely slow. (rows are 50,0000 over)

I think we should use Filter for specified position



> 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
>             Fix For: 0.90.0
>
>         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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984479#action_12984479 ] 

ncanis commented on HBASE-3453:
-------------------------------

Thanks for reply Jonathan Gray

I understood about that, that's why we can use it when regions are only one.

is there anything to solve the issue?
like this:(db)
for example> select * from user limit 100,20   (this is common issue)

if we have table has 500,000 rows, search time will be taken too long.

What should I do?






> 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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ryan rawson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984021#action_12984021 ] 

ryan rawson commented on HBASE-3453:
------------------------------------

thanks for the code!

I have a question, what happens if the offset lies in the next region?

> 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.20.6
>         Environment: windows 7
>            Reporter: ncanis
>             Fix For: 0.20.6
>
>         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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984578#action_12984578 ] 

ncanis commented on HBASE-3453:
-------------------------------

Thanks Ryan

I finished.
performace was good.

table has 15,000 rows. (and table has index table for column)
1. using old scan : 312ms
2. using start rowKey : 89ms

It works. Thanks.

> 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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "jo sung jun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jo sung jun updated HBASE-3453:
-------------------------------

    Description: 
Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
<code>
/**
	 * 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>
-----------------

  was:
Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
/**
	 * 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;
	}
-----------------


> How about RowPaginationFilter
> -----------------------------
>
>                 Key: HBASE-3453
>                 URL: https://issues.apache.org/jira/browse/HBASE-3453
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.20.6
>         Environment: windows 7
>            Reporter: jo sung jun
>             Fix For: 0.20.6
>
>         Attachments: RowPaginationFilter.java
>
>
> Hello.
> I know hbase has already PageFilter.
> But, sometime we need to get row data from specified position.
> ------------------------
> <code>
> /**
> 	 * 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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "jo sung jun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jo sung jun updated HBASE-3453:
-------------------------------

    Description: 
Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
<code>
/**
	 * 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>
-----------------

  was:
Hello.
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

------------------------
<code>
/**
	 * 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>
-----------------


> How about RowPaginationFilter
> -----------------------------
>
>                 Key: HBASE-3453
>                 URL: https://issues.apache.org/jira/browse/HBASE-3453
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.20.6
>         Environment: windows 7
>            Reporter: jo sung jun
>             Fix For: 0.20.6
>
>         Attachments: RowPaginationFilter.java
>
>
> Hello.
> I know hbase has already PageFilter.
> But, sometime we need to get row data from specified position.
> ------------------------
> <code>
> /**
> 	 * 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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Description: 
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

{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}
-----------------

  was:
{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}
-----------------

     Issue Type: Wish  (was: Improvement)

> 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.20.6
>         Environment: windows 7
>            Reporter: ncanis
>             Fix For: 0.20.6
>
>         Attachments: RowPaginationFilter.java
>
>
> I know hbase has already PageFilter.
> But, sometime we need to get row data from specified position.
> {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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Attachment: RowPaginationFilter.java

I converted RowPaginationFilter.java to hbase 0.90.0

Congratulations on HBase 0.90.0 release!
I am really happy about that. :)

> 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
>             Fix For: 0.90.0
>
>         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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Gray updated HBASE-3453:
---------------------------------

    Fix Version/s:     (was: 0.90.0)

0.90.0 already released

> 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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Affects Version/s:     (was: 0.20.6)
                       0.90.1
        Fix Version/s:     (was: 0.20.6)
                       0.90.0

> 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
>             Fix For: 0.90.0
>
>         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.


[jira] Updated: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ncanis updated HBASE-3453:
--------------------------

    Description: 
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}
-----------------

  was:
I know hbase has already PageFilter.
But, sometime we need to get row data from specified position.

{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}
-----------------


> 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.20.6
>         Environment: windows 7
>            Reporter: ncanis
>             Fix For: 0.20.6
>
>         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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ryan rawson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984575#action_12984575 ] 

ryan rawson commented on HBASE-3453:
------------------------------------

hey,

a common tactic is for the http layer/client to store the last
previous retrieved row so when people hit 'next' the code can start
from there, and you retrieve PAGE_SIZE+1 to know the 'next' row id.

good luck!


> 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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ryan rawson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984493#action_12984493 ] 

ryan rawson commented on HBASE-3453:
------------------------------------

at this point we do not have distributed filter state, that is as a
scanner skips between regions, each region gets a new instantiation of
the filter.

while it's really attractive to have the DB handle this for you, most
of the scalable designs i've heard do not use the offset/limit of the
database.  Even the mysql implementation is not very efficient because
it must do the entire query every time and use internal counters to
skip (while still incurring the io overhead).  HBase is similar, but
the twist of our regions prevents this from effectively working in all
cases.


> 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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984499#action_12984499 ] 

ncanis commented on HBASE-3453:
-------------------------------

Thanks ryan rawson,
but google gmail has paging.(bigtable)

in gmail, we can click previos and next page.


> 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.


[jira] Commented: (HBASE-3453) How about RowPaginationFilter

Posted by "ncanis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984574#action_12984574 ] 

ncanis commented on HBASE-3453:
-------------------------------

to ryan rawson

you're right.
most
of the scalable designs don't use offset,limit

gmail of google also doesn't have paging, just using prev/next

If we want to implement like gmail list, we must know start row key.(clients know last rowkey. :) )

so, I'm working to solve paging problem.

-----------------
for example

1. search(byte[] startRow, String col, byte[] value)   : clients know last startRow value in their list.
2. find out column position in col index table.
3. I set start rowkey = Bytes.add(si.getValue(),startRow);
4. add PageFilter
5. run getIndexedScanner
6. done.

Thanks a lot  for your help.

I deprecated RowPaginationFilter




> 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.