From c8903cc20ac734cba9a8f7c7adff76a23b7f88ec Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Mon, 1 Aug 2016 11:13:47 -0700 Subject: [PATCH] HBASE-16296 Reverse scan performance degrades when using filter lists (Ted Yu) --- .../java/org/apache/hadoop/hbase/regionserver/HRegion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index c497ec05f60..4a2ae50d1f4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -6023,6 +6023,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi // Technically, if we hit limits before on this row, we don't need this call. if (filterRowKey(currentRow, offset, length)) { incrementCountOfRowsFilteredMetric(scannerContext); + // early check, see HBASE-16296 + if (isFilterDoneInternal()) { + return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues(); + } // Typically the count of rows scanned is incremented inside #populateResult. However, // here we are filtering a row based purely on its row key, preventing us from calling // #populateResult. Thus, perform the necessary increment here to rows scanned metric