hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-5664) CP hooks in Scan flow for fast forward when filter filters out a row
Date Fri, 28 Sep 2012 06:43:08 GMT

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

Anoop Sam John commented on HBASE-5664:
---------------------------------------

This can be useful when the secondary index implementation is done. [HBASE-2038?]
Suppose we have 2 conditions on the scan based on 2 columns. Only we have one index on the
1st column. This index can give me some rowkeys. Using a wrapper for the RegionScanner and
using reseek() I can seek to correct rows. Now after data fetch the filter needs to be applied
on that as the second column condition check also to happen. And here if this check filters
out the row we need to make a seek to the next row as found from the index data(which is on
the one column)
In HRegion#nextInternal(int limit) we have
while (true) {
....
if (results.isEmpty() || filterRow()) {
            // this seems like a redundant step - we already consumed the row
            // there're no left overs.
            // the reasons for calling this method are:
            // 1. reset the filters.
            // 2. provide a hook to fast forward the row (used by subclasses)
            boolean moreRows = nextRow(currentRow);
			...
}
My idea is to give a CP hook here so that from that user can make a reseek()
Otherwise the normal code flow while() loop will take the next row from the table and apply
filter and so on and we wont get the advantage of the index data
[~andrew.purtell@gmail.com] Can you please comment on this?

We have a patch for this adding the new hook which we have used internally
                
> CP hooks in Scan flow for fast forward when filter filters out a row
> --------------------------------------------------------------------
>
>                 Key: HBASE-5664
>                 URL: https://issues.apache.org/jira/browse/HBASE-5664
>             Project: HBase
>          Issue Type: Improvement
>          Components: Coprocessors
>    Affects Versions: 0.92.1
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 0.96.0
>
>
> In HRegion.nextInternal(int limit, String metric)
> 	We have while(true) loop so as to fetch a next result which satisfies filter condition.
When Filter filters out the current fetched row we call nextRow(byte [] currentRow) before
going with the next row.
> {code}	
> if (results.isEmpty() || filterRow()) {
>             // this seems like a redundant step - we already consumed the row
>             // there're no left overs.
>             // the reasons for calling this method are:
>             // 1. reset the filters.
>             // 2. provide a hook to fast forward the row (used by subclasses)
>             nextRow(currentRow);
> {code}
> // 2. provide a hook to fast forward the row (used by subclasses)
> We can provide same feature of fast forward support for the CP also.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message