hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10965) Automate detection of presence of Filter#filterRow()
Date Tue, 13 May 2014 06:06:15 GMT

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

Lars Hofhansl commented on HBASE-10965:
---------------------------------------

-0 on this change. Just seems to add complexity for little gain.
If we could remove hasFilterRow completely from the interface (which we can do in 1.0, I think)
that would be a different story.
Now we have the worst of both worlds. Filter still has hasFilterRow() and on top of that we
have the reflection stuff.


> Automate detection of presence of Filter#filterRow()
> ----------------------------------------------------
>
>                 Key: HBASE-10965
>                 URL: https://issues.apache.org/jira/browse/HBASE-10965
>             Project: HBase
>          Issue Type: Task
>          Components: Filters
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>         Attachments: 10965-v1.txt, 10965-v2.txt, 10965-v3.txt, 10965-v4.txt, 10965-v6.txt,
10965-v7.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).
> Downside to purely depending on hasFilterRow() telling us whether custom filter overrides
filterRow(List) or filterRow() is that the check below may be rendered ineffective:
> {code}
>           if (nextKv == KV_LIMIT) {
>             if (this.filter != null && filter.hasFilterRow()) {
>               throw new IncompatibleFilterException(
>                 "Filter whose hasFilterRow() returns true is incompatible with scan with
limit!");
>             }
> {code}
> When user forgets to override hasFilterRow(), the above check becomes not useful.
> Another limitation is that we cannot optimize FilterList#filterRow() through short circuit
when FilterList#hasFilterRow() turns false.
> See https://issues.apache.org/jira/browse/HBASE-11093?focusedCommentId=13985149&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13985149
> This JIRA aims to remove the inconsistency by automatically detecting the presence of
overridden Filter#filterRow(). For FilterBase-derived classes, if filterRow() is implemented
and not inherited from FilterBase, it is equivalent to having hasFilterRow() return true.
> With precise detection of presence of Filter#filterRow(), the following code from HRegion
is no longer needed while backward compatibility is kept.
> {code}
>       return filter != null && (!filter.hasFilterRow())
>           && filter.filterRow();
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message