[
https://issues.apache.org/jira/browse/HBASE-18160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16099598#comment-16099598
]
Anoop Sam John commented on HBASE-18160:
----------------------------------------
Thanks for fixing the comments and sorry for the delay.
bq.Let's call it: The Minimal Step Rule.
I like that name. :-)
So in case of OR filter we need a min step rule and in case of AND it has to be
max step rule.
In case of OR
{code}
case INCLUDE_AND_NEXT_COL:
444 if (rc != ReturnCode.INCLUDE) {
445 rc = ReturnCode.INCLUDE_AND_NEXT_COL;
446 }
{code}
What if SKIP being other filter's return? We need to return skip only
Lets document the order of return values wrt steps. I mean wrt our min step or
max step rules.
Can u pls make a private method or so which takes prev return and cur filter
return and apply the step and return a final value? So that we can avoid if
cases code repeat in switch cases. (For OR and AND)
> Fix incorrect logic in FilterList.filterKeyValue
> -------------------------------------------------
>
> Key: HBASE-18160
> URL: https://issues.apache.org/jira/browse/HBASE-18160
> Project: HBase
> Issue Type: Sub-task
> Reporter: Zheng Hu
> Assignee: Zheng Hu
> Attachments: HBASE-18160.branch-1.1.v1.patch,
> HBASE-18160.branch-1.v1.patch, HBASE-18160.v1.patch, HBASE-18160.v2.patch,
> HBASE-18160.v2.patch, HBASE-18160.v3.patch
>
>
> As HBASE-17678 said, there are two problems in FilterList.filterKeyValue
> implementation:
> 1. FilterList did not consider INCLUDE_AND_SEEK_NEXT_ROW case( seems like
> INCLUDE_AND_SEEK_NEXT_ROW is a newly added case, and the dev forgot to
> consider FilterList), So if a user use INCLUDE_AND_SEEK_NEXT_ROW in his own
> Filter and wrapped by a FilterList, it'll throw an
> IllegalStateException("Received code is not valid.").
> 2. For FilterList with MUST_PASS_ONE, if filter-A in filter list return
> INCLUDE and filter-B in filter list return INCLUDE_AND_NEXT_COL, the
> FilterList will return INCLUDE_AND_NEXT_COL finally. According to the
> mininal step rule , It's incorrect. (filter list with MUST_PASS_ONE choose
> the mininal step among filters in filter list. Let's call it: The Mininal
> Step Rule).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)