Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
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:
if (nextKv == KV_LIMIT) { if (this.filter != null && filter.hasFilterRow()) { throw new IncompatibleFilterException( "Filter whose hasFilterRow() returns true is incompatible with scan with limit!"); }
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.
return filter != null && (!filter.hasFilterRow()) && filter.filterRow();
Attachments
Attachments
Issue Links
- blocks
-
HBASE-11093 FilterList#filterRow() iterates through its filters even though FilterList#hasFilterRow() returns false
- Closed