Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-3453

How about RowPaginationFilter

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.90.1
    • None
    • Client
    • None
    • windows 7

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

      -----------------

      Attachments

        Activity

          People

            Unassigned Unassigned
            ncanis ncanis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: