stoty commented on code in PR #5955:
URL: https://github.com/apache/hbase/pull/5955#discussion_r1622734680
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterListWithAND.java:
##########
@@ -206,17 +238,20 @@ public boolean filterRowKey(Cell firstRowCell) throws
IOException {
if (isEmpty()) {
return super.filterRowKey(firstRowCell);
}
- boolean retVal = false;
+ boolean anyFiltered = false;
+ boolean anyHintingPassed = false;
for (int i = 0, n = filters.size(); i < n; i++) {
Filter filter = filters.get(i);
if (filter.filterAllRemaining() || filter.filterRowKey(firstRowCell)) {
// Can't just return true here, because there are some filters (such
as PrefixFilter) which
// will catch the row changed event by filterRowKey(). If we return
early here, those
// filters will have no chance to update their row state.
- retVal = true;
+ anyFiltered = true;
+ } else if (hintingFilters[i]) {
+ anyHintingPassed = true;
Review Comment:
Because currently if any of the filters returns true on filterRowKey(), the
we return true, and then the filterCell() in this class never gets called, and
HBase just goes the next rowkey (i.e. performs a full scan).
If any filters that may return SEEK_NEXT_USING_HINT has returned false, we
must call filterCell() on that one to get the possible seek hint, and we won't
get a chance to do that if our fiterCell() never gets called.
In theory, we could cache which HintingFilters have returned false for
filterRowKey() and only check those, but I'm not sure if that would be a
real-world speedup, as filters that skip on a rowkey tend to cache the result
already.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]