[
https://issues.apache.org/jira/browse/HBASE-1790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jonathan Gray updated HBASE-1790:
---------------------------------
Attachment: HBASE-1790-v2.patch
This adds a prefix test to stack's framework and then makes a change inside of
HRegion.nextInternal() to return the current result if there is one (once we
hit a filtered row key).
What was happening was we put the second row in the result (List<KV>), iterated
to the third, it said filter it, so we iterated the scanner, cleared the
result, and returned. So even though the second KV should have been returned,
the third KV forced a full clear of the result.
I added a check that if we just hit a new row (currentRow != row) and there is
something still in the result (!result.isEmpty()), then return w/o clearing.
I also modified prefix filter to be more stateful so that it knows once it has
passed it's prefix. Once passed the prefix, it returns filterAllRemaining() as
true, so this further cleans up the test case. Without that, when running this
at the Region level, we end up returning an empty result list on the third call
rather than the second call returning false (that we are done). Since we
actually can determine we are done in this case, because the prefix has been
passed, adding it cleans that up so we return the correct result in the second
call, and that call also returns false letting up know that there will be no
more matches.
I had to update one test (I think I actually wrote it) that tested FilterList
MUST_PASS_ONE because it was running against a key passed the prefix, and then
reversing back to the prefix. That's impossible behavior so I slightly
modified the test.
Not sure whether this is totally right but in debugging it made sense. All
tests I've run pass.
> filters are not working correctly
> ---------------------------------
>
> Key: HBASE-1790
> URL: https://issues.apache.org/jira/browse/HBASE-1790
> Project: Hadoop HBase
> Issue Type: Bug
> Components: filters
> Affects Versions: 0.20.0, 0.21.0
> Reporter: Matus Zamborsky
> Fix For: 0.20.0
>
> Attachments: HBASE-1790-v2.patch, hbase-1790.patch, testfilter.patch
>
>
> Filters used in Scanning the table are not working correctly. For example a
> table with three rows:
> 1. rowkey = adminbackslash-nb0, desc:temp = "temp"
> 2. rowkey = adminbackslash-nb1, desc:temp = "temp"
> 3. rowkey = adminkleptoman, desc:temp = "temp"
> If I scan all rows in the table without filter I get all the rows as
> expected. But applying a simple prefixfilter with parameter "adminbackslash"
> will return only first row. I searched it down to HRegion::nextInternal
> method, which will not output one passed row before denied row(by filter).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.