[
https://issues.apache.org/jira/browse/HBASE-10965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13969266#comment-13969266
]
Anoop Sam John commented on HBASE-10965:
----------------------------------------
In initial time of 94 , I remember that Filter#hasFilterRow() was associated
with Filter#filterRow(List<KV>)
We used this boolean API in 2 places
1. To check whether Scan is with a Filter, which is having row filtering, and
with a batch value set. This is not correct way and we have to fail then
2. The place before we call Filter#filterRow(List<KV>) in HRegion
Later we made it like hasFilterRow() to return true when filterRow() is also
implemented and so same is used in code where we call filterRow() also.
Actually we need to use this boolean API only in case 1. When one uses a
filter and a Scan batch wrongly, we will fail the scan op 1st step itself.
So there is no need to check this boolean API value before calling the actual
Filter methods. The impl in FilterBase do nothing and no problem in calling
that I believe.
So with this Jira, if there is consensus to remove even the hasFilterRow()
method, we can simplify the things. Just in place where we check the Scan
filter and batch to see whether we can proceed with the open scanner, just do
this auto detect of method impls and act. In other places of HRegion scan
flow, no need to rely on any of these boolean values of hasFilterRow() returns.
Make some sense?
When we auto detect presence of methods take care of the FL case. ( FL inside
FL) which I was saying above.
> Automate detection of presence of Filter#filterRow()
> ----------------------------------------------------
>
> Key: HBASE-10965
> URL: https://issues.apache.org/jira/browse/HBASE-10965
> Project: HBase
> Issue Type: Task
> Reporter: Ted Yu
> Assignee: Ted Yu
> Attachments: 10965-v1.txt, 10965-v2.txt, 10965-v3.txt, 10965-v4.txt
>
>
> There is potential inconsistency between the return value of
> Filter#hasFilterRow() and presence of Filter#filterRow().
> Filters may override Filter#filterRow() while leaving return value of
> Filter#hasFilterRow() being false (inherited from FilterBase).
> This JIRA aims to remove the inconsistency by automatically detecting the
> presence of overridden Filter#filterRow(). If filterRow() is implemented and
> not inherited from FilterBase, it is equivalent to having hasFilterRow()
> return true.
--
This message was sent by Atlassian JIRA
(v6.2#6252)